VMware vCloud Director (vCD) is VMware's product for cloud service providers to build multitenant cloud services. VMware vCloud Air is VMware's public cloud platform built on vCD. Virtual machines managed by vCloud Director should not be modified in VMware vSphere. Both products can be managed using PowerCLI. The PowerCLI modules VMware.VimAutomation.Cloud
and VMware.VimAutomation.PCloud
provides cmdlets to use vCD and vCloud Air. In this chapter, you will learn to how to manage vCD and vCloud Air virtual appliances as well as virtual machines using PowerCLI.
This chapter covers the following topics:
Get-CIView
Before you can start to use PowerCLI cmdlets to manage a vCloud Air or a vCD environment, you have to establish a connection to a vCloud Air or vCD server.
You can start any of the VMware Hands-on Labs for vCloud Air, to get a temporary vCloud Air account. Such a temporary vCloud Air account can be used to try the examples in this chapter. The temporary account will be reset after exiting the lab. You can find the VMware Hands-on Labs at http://labs.hol.vmware.com/ . While writing this chapter, I used HOL-1782-HBD-1 - VMware vCloud Air - Data Center Extension for testing. After starting the lab, you have to go to http://checkin.vcahol.com and enter your e-mail address to get your student account.
In the following image, you will see the temporary credentials we received from the Hands-on Lab.
The Connect-CIServer
cmdlet establishes a connection to the specified vCD servers.
The syntax of the Connect-CIServer
cmdlet is as follows, and the first parameter set is the default:
Connect-CIServer [-Server] <String[]> [-Org <String>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Port <Int32>] [-NotDefault] [-SaveCredentials][-WhatIf] [-Confirm] [<CommonParameters>]
The -Server
parameter is required.
The second parameter set is to re-establish a connection to an existing vCloud server session:
Connect-CIServer [-Server] <String[]> [-SessionId] <String> [-Port <Int32>] [-NotDefault] [-WhatIf] [-Confirm] [<CommonParameters>]
The -Server
and -SessionId
parameters are required.
The third parameter set is required to connect to a specific vCloud Air data center:
Connect-CIServer [-NotDefault] [-PIDatacenter] <CIServerRelatedObject> [-WhatIf] [-Confirm] [<CommonParameters>]
The -PIDatacenter
parameter is required.
The fourth parameter set is for the selection of a cloud server from a list of recently connected servers:
Connect-CIServer -Menu [-WhatIf] [-Confirm] [<CommonParameters>]
The -Menu
parameter is required.
In the following example, we will connect to the vCloud Director server we received from the Hands-on Lab:
PowerCLI C:> Connect-CIServer -Server p13v37-vcd.vchs. vmware.com -Org student501 -User [email protected] -Password PLGAl79hA Name User Org ---- ---- --- p13v37-vcd.vchs.vmware.com [email protected] student501
In the following image, you will see a screenshot of the vCloud Air portal after the login:
18.224.33.107