posted

0 Comments

PowerCLI is no doubt one of the most widely used automation tools among traditional vSphere Administrators.

In the past, we have made separate PowerCLI modules available to manage vCloud Director resources. As many of you know, vCloud Director is a core tenet we use to deliver the compute service in VMware vCloud® Air™ (for both subscription and OnDemand environments).

PowerCLI 6.0 R1 is the first step to make the experience “one and the same” by including the vCloud Director related module in the core product.

If you are a vSphere administrator, you can start leveraging the power of PowerCLI (no pun intended) today, with a brand new VMware compatible infrastructure consumed with an OPEX model (i.e. vCloud Air).

If you are a vCloud Air consumer, you can start leveraging one of the easiest and most powerful automation tools vSphere admins have been enjoying for years.

There are a lot of mutual benefits – after all, it is a hybrid world.

When you install PowerCLI just make sure you include the “vCloud Air/vCD PowerCLI” module. By default, the installer doesn’t install it.

powercli

Assuming you have a valid vCloud Air account, you are now one command away from consuming vCloud Air with PowerCLI.

As you can see from the installer, PowerCLI 6.0 R1 comes with a couple of “cloud” modules. We will explore them in further detail in future “vCloud Air meets PowerCLI” chapters.

You can see these modules running the following command:

PowerCLI C:\PowerCLI> Get-Module *Cloud

The VMware.VimAutomation.Cloud module is a refined and newer version of the previous “vSphere PowerCLI for Tenants” module. It allows interaction with vCloud Director via PowerCLI.

The VMware.VimAutomation.PCloud module is specifically designed to communicate and integrate with vCloud Air.

As you may know we use vCloud Director to deliver the compute (core IaaS) services in vCloud Air. This is the same software that our Service Provider partners in the vCloud Air Network program uses.

The Cloud module is not only compatible with the vCloud Air compute service, but also with all of the vCloud Air Network clouds.

The PCloud module, on the other hand, is a vCloud Air specific module that allows a vCloud Air customer to locate all of his/her computer resources. In other words this module is what allows you to interact with the root of the vCloud Air service.

We will discuss this in further detail in the following chapters of this blog series.

Now you are ready to start.

Just type:

C:\PowerCLI> Connect-PIServer

You don’t need to type any parameter because the tool knows what the root of the service is (vchs.vmware.com). Also, if you don’t type any credentials (which you can do in various ways), PowerCLI will prompt you for those:

powercli

You are now connected to vCloud Air.

Now, you can list all of the compute resources you have available. 

Just type:

PowerCLI C:\PowerCLI> Get-PIDatacenter

This is what the command returns with my credentials:

Name

 —-

Technical_Marketing_Team

VMTM_DOT_ORG

Engineering-Demo

VMTM_DaaS

Benchmark

Marketing-Demo

5-37

M579570327-1045

M598551135-4965

M579570327-5454

M662710264-4626

These are all the virtual data centers I have available across the world, in my vCloud Air tenant.

In other words, the Get-PIDatacenter command automates what you had to previously do manually in the UI to enumerate the virtual data centers and their vCloud Director end-points. See this blog post for more details.

Note: today the PCloud module only works if you have a vCloud Air subscription account, it doesn’t work (yet) if you have a vCloud Air OnDemand account.

Now, let’s assume I want to work with my virtual data center M598551135-4965 (which I know is in the UK region for the records).

Just type:

PowerCLI C:\PowerCLI> Get-PIDatacenter M598* | Connect-CIServer

And this is what you get:

Name                                                                  User                                                                   Org

 —-                                                                      —-                                                                     —

 p6v1-vcd.vchs.vmware.com                         mreferre@vmware.com                              M598551135-4965

Now you are connected to the specified vCloud Director Organization.

We will explore in more details the relationship between Organizations and VDCs but for the sake of this introductory discussion you can assume that Organizations and VDCs are the same thing.

Now that you are connected to the Organization, you can list the vApps that have been deployed inside it.

Just type:

C:\PowerCLI> Get-CIVM

And the command returns:

PowerCLI C:\PowerCLI> Get-CIVM

Name                           Status                             GuestOSFullName                                           CpuCount  MemoryGB

 —-                                ——                                —————                                                       ——–        ——–

 DH-ADFS                    PoweredOn                   Microsoft Windows Server 2012 (64-bit)    1                 4.000

 DHW2k12UK            PoweredOn                   Microsoft Windows Server 2012 (64-bit)    1                 4.000

GKOBAR-xxxx            PoweredOn                   Ubuntu Linux (64-bit)                                 1                1.000

In the next series we will explore in more detail the characteristics of the two modules (including the limitations) and we will explore more advanced commands.

For now we wanted to get you started with the power (again, no pun intended) of both worlds (PowerCLI and vCloud Air).

Enjoy!

For more information about VMware vCloud Air, visit vcloud.vmware.com, and keep an eye on the blog for upcoming tips and best practices for using vCloud Air

Be sure to subscribe to the vCloud blog with your favorite RSS reader, or follow our social channels at @vCloud andFacebook.com/VMwarevCloud for the latest updates.