VMware Hands-on Labs - HOL-SDC-1307


Lab Overview

HOL-SDC-1307 - vCloud Automation Solutions


VMware vCloud Automation Solutions accelerate the journey to a lights-out, fully automated, and efficient Software-Defined Datacenter. vCenter Server, Orchestrator, PowerCLI, and AutoDeploy - working together to solve real-word problems.

There are considerable benefits to be gained by understanding and leveraging these tools to improve efficiency in datacenter operations. This lab's modules will focus on integration with vCenter Server. Orchestration and automation integrations with vCloud Automation Center are explored in HOL-SDC-1321.

This lab is broken up into 4 individual use case modules with lengths varying from 30 to 60 minutes. Use the "Modules" list to determine which use case you want to complete. You may choose to complete any or all modules, keeping in mind you have 90 minutes available per session.

Modules do not depend on each other, so you can take them in random order. Use the "Table of Contents" button in the menu bar for quick access to the module content.


 

Modules

Module 1 Overview
In this module, we will demonstrate the technologies and the steps required to implement Auto Deploy to support stateless ESXi hosts for upgrading hosts or rapidly deploying new hosts. This module will take you through the process of preparing the infrastructure, preparing the Boot Image and Rules, steps to configure servers and finish with an upgrade to one ESXi host from version 5.1 to version 5.5.
You will need about 60 minutes to complete the module.

Module 2 Overview
This module will introduce you to VMware vSphere PowerCLI - the administrator's choice for automating vSphere and vCloud Director. Novice users will easily learn to use the tool and more advanced users will get familiar with the new functionality available in the latest release of the product like vSphere tags management and opening a VM console. We will demonstrate how to perform common administrator tasks in both vSphere and vCloud and how easy it is to migrate to and manage the vCloud. You will walk away with a better understanding of PowerCLI and how it can help you in your day-to-day work.
You will need about 45 minutes to complete the module.

Module 3 Overview

This module will introduce you to the new VMware vSphere PowerCLI cmdlets for virtual distributed switch (vDS) automation. We will demonstrate how to perform common VDS related tasks with PowerCLI. You will walk away with better understanding of PowerCLI and how it can help you in your day-to-day work.
You will need about 45 minutes to complete the module.

Module 4 Overview
In this module we will demonstrate how the vCenter Orchestrator Active Directory plug-in allows organizations to automate the management of directory services tasks, particularly as they pertain to cloud provisioning use cases. For instance, the plug-in enables the automatic provisioning of vCloud Director organizations based on data retrieved from Active Directory. The plug-in also includes many administrative actions related to computers, organizations, user groups, and users, such as resetting passwords or adding users to a user group. The drag-and-drop workflow designer of vCenter Orchestrator allows you to easily assemble these actions into higher-level workflows to automate repetitive Active Directory administrative tasks.
You will need about 30 minutes to complete the module.

 

Module 1 - Enable Rapid Host Provisioning and Centralized Management with vSphere Auto Deploy

Module Overview


In this lab, we will demonstrate the technologies and the steps required to implement Auto Deploy to support stateless ESXi hosts for upgrading hosts or rapidly deploying new hosts. This lab will take you through the process of preparing the infrastructure, preparing the Boot Image and Rules, steps to configure servers and finish with an upgrade to one ESXi host from version 5.1 to version 5.5.

This lab will take approximately 60 minutes.

Each Lesson builds on the previous lesson, so make sure to complete each lesson before moving to the next lesson.


Case Study, Introduction, and Lab Basics


This introduction gives you a little background about our company scenario and lab architecture.


 

Case Study

The CIO of BigTelco has decided to implement a cloud-enabled datacenter to accommodate the agility and scalability requirements of their customers. He is in the final stage of closing an agreement with the CIO of Rainpole Systems, a software development firm that is interested in having BigTelco host their cloud infrastructure. For Rainpole Systems, this new cloud initiative will help redefine their development model and radically improve time to market for a wave of new customer facing applications.

RainPole has asked for the ability to rapidly deploy and maintain hundreds of servers within hours to meet potential demand. In an effort to prepare for the cloud computing partnership, the infrastructure teams at BigTelco have committed to spinning up VMware vSphere Servers on demand to host RainPole System's new projects. To streamline the numerous server deployments, the CIO has asked you and your team of engineers to find the best way to adapt BigTelcos cloud environment for this new challenge. You and your team have decided to leverage VMware vSphere Auto-Deploy and Stateless ESXi features.

 

 

What is Auto Deploy?

Auto Deploy was first introduced with vSphere 5.0 as a new way to rapidly deploy vSphere hosts. With Auto Deploy the vSphere host loads the ESXi software image over the network directly into the vSphere host's memory. Auto Deploy uses a PXE boot infrastructure in conjunction with vSphere Host Profiles to provision and customize the host. vCenter Server manages the state information for each host configured to use Auto Deploy. For this reason Auto Deployed vSphere hosts are often referred to as being "stateless".

The Auto Deploy server stores the ESXi Image Profiles and vCenter Host Profiles that are used to provision and configure vSphere Hosts in a local cache. Rules are configured on the Auto Deploy server (using PowerCLI) that use pattern matching to dynamically map booting vSphere hosts to the appropriate image profiles and host profiles.

 

 

Environment Overview

 

The diagram above shows the high-level architecture for the Auto Deploy lab.

Auto Deploy Components

 

 

Auto Deploy and PowerCLI

 

The table above describes the deployment information stored by the Auto Deploy Server.

The Auto Deploy server stores the ESXi Image Profiles and vCenter Host Profiles that are used to provision and configure vSphere Hosts in a local cache. Rules are configured on the Auto Deploy server (using PowerCLI) that use pattern matching to dynamically map booting vSphere hosts to the appropriate image profiles and host profiles.

Hosts deployed using Auto Deploy run in memory and do not require local storage. This helps reduce costs and simplify storage architectures by eliminating the need for a dedicated boot disk (SAN Boot, local hard disks, SD Cards or USB keys).

 

 

Control Center Desktop

 

When you start the lab, the system you first access is referred to as the ControlCenter. On the ControlCenter Desktop you will find shortcuts to applications you will use throughout the lab.

**Note: depending on screen resolutions of the Lab, your icons may reposition themselves and not be arranged as in the image above.

 

 

Logins and Passwords

Rainpole has established default logins and passwords for all personnel. Since you will be the administrator for these servers, you will be using your domain administrator account for much of the installs. Unless otherwise noted, the default Login ID and Passwords for this lab are:

User Name: administrator

Domain: corp.local

Password: VMware1!

 

 

Backup File

 

During this lab we will have to enter some long commands on the command line and also take note of some information so we can use it later. To make this easier, you will find a file named cheatsheet.txt on the desktop. This file has all the passwords, command line entries, and information that we will need for this lab. Feel free to open this file and copy/paste from it.

 

Verify the size of Auto Deploy repository


We'll now verify that the size reserved for the Auto Deploy repository is big enough to handle our ESXi image.


 

Login to the vCenter Server Appliance

 

1. Launch Internet Explorer from the Windows Quick Launch bar

2. Login as username: root and password: VMware1!

Hint: Copy and paste key-ins from the cheatsheet.txt file on the desktop or use the "Send Text" button in the HOL browser user interface just under the VM console. (OSK.exe can also assist non-QWERTY keyboard users.)

3. Click the Login button

 

 

Services Tab

 

1. Click on the Services tab

2. Make sure the vSphere Auto Deploy repository max size is set to 2.

3. Logout of the vCenter Server Appliance. Click Logout user root.

Close Internet Explorer

 

Verify PowerCLI Launches


We will use PowerCLI to create some rules that will make Auto Deploy install ESXi on the fly just on the machines that meet those rules. This will avoid Auto Deploy to try to install ESXi on every server that boots up.

We should verify that PowerCLI is running as it is used to upload the ESXi images we will be pushing out and is also used by vCenter Auto Deploy to execute a set of user-defined rules that guide the configuration of the ESXi instance.

 


 

Launching PowerCLI

 

In order to save time in this lab, PowerCLI has been preinstalled and configured. You will need to check that it launches correctly. From the ControlCenter desktop launch the “VMware vSphere PowerCLI” as Administrator:

  1. Right-Click the "VMware vSphere PowerCLI" Shortcut
  2. From the pop-up menu, select Run As Administrator.

Note: PowerCLI could take up to 90 seconds to load

 

 

Connect to vCenter

 

We will connect to the vCenter Server Appliance using the corp\administrator account.

Please type the following commands (Please watch out for the spaces):

1. Type:

cd \

2. Connect to vCenter, type:

connect-viserver vc-l-01a.corp.local -user corp\administrator -password VMware1!

** Note: It will take up to 15 or 20 seconds to connect to the vCenter Server Appliance.

**Note: you might receive a certificate warning. This is because we are using a self signed certificate, please ignore it.

Minimize the PowerCLI command prompt

 

 

Connected Successfully

 

You should receive verfication that you were able to connect to vCenter.

 

Verify that the Auto Deploy service is running on vCenter


The first thing we need to do is to check that Auto Deploy service is up and running with the vCenter. This is the heart of the solution.

 

To verify that the Auto Deploy Service is running on vCenter Server

1. Launch Internet Explorer and connect to https://vc-l-01a.corp.local:5480 or Click Site A vCenter Admin UI in the favorites bar.

2. Login to the vCenter Server Appliance with the following account:

Username root

Password: VMware1!


 

Login Image

 

 

 

Auto Deploy Service

Once logged in you will be on the Summary screen, towards the bottom of the screen you can see the vCenter services that are running, check that the 'vSphere Auto Deploy' service is running, if it's not running you can click Start to the right of the vSphere Auto Deploy service.

 

 

Auto Deploy Service Running Image

 

If the Auto Deploy service is not running, start it by clicking on the start button next to the vSphere Auto Deploy under services.

We need the Auto Deploy Service running because this is the main service responsable for the installation of the ESXi image on the fly.

 

Verify DHCP Manager is Working


Now we will begin verifying that the basic systems that form the foundation of the solution are working. Auto Deploy uses theses services to boot and configure the host images.

The first system that we will check is the DHCP Server.We need the DHCP Server working so it can assign the right IP address to the machine that we are going to install ESXi on.


 

Launching DHCP Server Console

 

1. From the ControlCenter desktop, Launch the DHCP Manager

2. Expand the controlcenter.corp.local scope

3. Make sure the IPv4 scope is active and shows a checkmark

4. Expand Scope [192.168.110.0] Rainpole

Minimize DHCP

 

Verify DNS


Next, we will need to check the DNS Server and the Forward Lookup Zone "corp.local" to ensure there are entries for our hosts.

DNS resolution is critical, because after our host receives an IP address, vCenter will be attempting to communicate with it by fully qualified domain name. We also need to check the Forward Lookup zones and see if there are entries for our hosts.


 

Launching DNS Server Console

 

We want to ensure that our ESXi Hosts names and IP addresses are recorded in the appropriate DNS zones. We require a Forward and Reverse lookup entry for ESXi hosts.

  1. From the ControlCenter desktop, Launch “DNS” by double-clicking the shortcut.
  2. Expand "Forward Lookup Zone"
  3. Expand the zone "corp.local"
  4. Verify DNS entries as shown above. Specifically look for the ESX-01a and ESX-02a entries.

Minimize DNS

 

Verify TFTP Server


Now we'll check on the TFTP Server. The TFTP Server will be used to hold the boot file with the configuration information to be used by the deployed ESXi host. The TFTP Server's address will be specified in a future step as a DHCP Scope Option. For now, let's just ensure we can connect to it.


 

Launch TFTP Server Manager

 

1. From the ControlCenter desktop, Launch “TFTP Server Manager” by double-clicking the shortcut.

2. Connect to the Local Server as the current Windows user.

3. Click OK.

3. Verify you can have connected to the TFTP folder (the folder is currently empty and you should just see \ )

Minimize TFTP Server Manager

 

Verify vSphere Web Client Access


The last part of the basic systems check is to see if our vCenter Web Console is up and running. We can do that by simply logging into it.

The vCenter Web Client is a major part of our lab. It is here that we will add our new ESXi host once it gets installed.


 

Launch vSphere Web Client

 

1. From the ControlCenter desktop, Launch “Internet Explorer” by double-clicking the shortcut.

2. On the Favorites bar click on "Site A vSphere Web Client".

3. Enter the following username and password:

4. Click Login.

Once you've successfully logged in, minimize the vSphere Web Client

 

Obtain MAC and Configure DHCP, DNS, TFTP


Now that we have verified that our DHCP, DNS, and TFTP Services are running, we will configure them in preparation for use with Auto Deploy.

Before our new host boots and attempts to connect to services, we want to obtain it's MAC address from vCenter and configure a DHCP reservation. DHCP reservations are permanent lease assignments that ensure a machine will always be assigned the same IP Address and the machine's unique MAC address is used as an identifier in this process. Address consistency is important because there are DNS records associated with the IP and these are used to identify our host when it connects to vCenter and to ensure we push the correct profile each time.


 

Obtaining the MAC Address: Open the vSphere Web Client

 

Maximize the vSphere Web Client (If you closed the IE or Chrome browser, open it again and go to the URL https://vc-l-01a.corp.local:9443/vsphere-client log in using the user: corp\administrator password: VMware1!)

1. Click on the Home Tab.

2. Click on Hosts and Clusters

 

 

Obtaining the MAC Address: Select the ESX Nested Host

 

Next

  1. Expand the inventory tree on the left (vc-l-01a -> Datacenter Site A -> Cluster Site A)
  2. Click on the esx-03a VM (For this lab we are using a nested ESXi, which means that our ESXi server is virtualized, this is used only in labs and should not be used in production)
  3. Click on the Summary Tab
  4. Expand Network Adapter 1
  5. Note the assigned MAC Address 00:50:56:82:f1:d8

 

 

 

Configuring a New DHCP Reservation

 

Maximize the DHCP server window (If you closed the DHCP Server window open it again using the shortcut on your desktop)

1. Expand the scope

2. Right click on Reservations and select New Reservation

 

 

DHCP Reservation Details

 

1. Enter the details for the ESXi Host:

2. For support types select Both

3. Click Add

Note that the MAC address entered in step 1 is the one obtained earlier from vCenter for esx-03a

 

 

Configure DHCP Reservation Scope Options

 

Next, we need to set the Scope Options for the DHCP server.

To do this, specify the TFTP Server and the default image it will use to boot.

  1. If the Scope is not expanded, expand Scope [192.168.110.0] Rainpole
  2. Right Click on the reservation you just created
  3. Select Configure Options

 

 

Edit DHCP Scope Option 66

 

You are now presented with a DHCP Scope Configuration Dialog window.

  1. Scroll down to the "066 Boot Server Host Name" and select it.
  2. Edit the values. Enter 192.168.110.10 in the String Value box.
  3. Select Apply

 

 

Edit DHCP Scope Option 67

 

  1. Scroll down to the "067 Bootfile Name" and select it.
  2. Edit the string value. Enter undionly.kpxe.vmw-hardwired in the string value box
  3. Click Apply
  4. Click OK.

** Note: we will be adding this file in a later step. This file is generated by the vCenter Auto Deploy as the boot file.

You can now close or minimize DHCP Manager.

 

 

Edit DNS

 

Reopen or maximize the DNS management console to edit the DNS Entry for our host esx-03a.corp.local

1. Expand the DNS tree

2. Expand Forward Lookup Zones> Corp.local zone.

3. Find the ESX-03a entry, Right Click it and select Properties

 

 

Create a DNS Entry

 

Fill the DNS Entry details for our host esxi-03a.corp.local

  1. If needed, edit the IP address to match the IP address used on our reservation, 192.168.110.200
  2. Enable "Update associated pointer (PTR) record"
  3. Click OK

 

 

Verify DNS Entry is Working

 

  1. Click Start
  2. Select Command Prompt

 

 

Verify Name Resolution Using NSLOOKUP

 

At the command prompt, type the following command:

nslookup 192.168.110.200

NSLOOKUP should return the valid name for the host we added to DNS in the previous step.

Close the command prompt window.

 

Download TFTP Boot Zip File


Now that we already configured all the basic systems, we need to download the boot file from the vCenter server.


 

Access The vSphere Web Client

 

Maximize the vSphere Web Client (IE). If you closed the browser, please open IE again and access the following URL: https://vc-l-01a.corp.local:9443/vsphere-client/#extensionId or click on the shortcut in IE named Site A vSphere Web Clientand re-authenticate to vCenter. Within the vCenter Web Client:

  1. Select Home
  2. Select vCenter

 

 

Select the vCenter Inventory List

 

1. Select vCenter Servers from Inventory Lists

 

 

Download the TFTP Boot

 

  1. Select vc-l-01a
  2. Select Manage tab
  3. Select Autodeploy from the list under Settings
  4. Click on Download TFTP Boot Zip

 

 

Accept the Certificate

 

Click Continue to this website (not recommended).

You are receiving this warning because in this lab we are using a self generated certificate.

 

 

Save the TFTP Boot File

 

1. At the bottom select the arrow next to the save button and select Save as

 

 

Save as Window

 

  1. When the Save As window appears, Save the file to the folder: C:\TFTP_Root
  2. Ensure the file name is "deploy-tftp", Save as type: Compressed (zipped) Folder
  3. Click Save button

 

 

Extract The TFTP Boot File

 

Open the Windows Explorer, then:

  1. Navigate to C:\TFTP_Root. Right click on the file deploy-tftp.zip
  2. Select Extract All...

 

 

Save the Extraction

 

  1. Extract the files to C:\TFTP_Root
  2. Click on Extract

 

 

Verify File

 

You should then see the extracted files in the C:\TFTP_Root.

** Note: The file name "undionly.kpxe.vmw-hardwired" matches the filename we specified when DHCP Scope options were configured in an earlier step.

Minimize Windows Explorer

 

Prepare the TFTP Server to receive the Boot files


After we've downloaded the file, we'll unzip it and verify that all of the files that we need are within the unzipped folder. After that, we will configure the TFTP Server to point to the location of the unzipped files.


 

Login to TFTP Server Manager

 

Maximize the TFTP Server Manager. If you closed it, open it again using the shortcut on your desktop named TFTP Server Manager.

1. Make sure you are connected to theLocal server.

2. Click OK

 

 

Manage Virtual Repository

 

We will now change the default location of the Virtual TFTP Folders.

1. Click Server from the drop down menu

2. Click Virtual TFTP Folders

3. Select Manage Repositories

 

 

Changing the Virtual Repository

 

We will now Edit the virtual folder default location to match the folder where we extracted the TFTP boot file.

1. Select the Virtual folder named "\".

2. Click Edit

3. Click "..." located next to the Local path text box

4. Select C:\TFTP_Root

5. Click OK.

6. Click OK again.

7. Click Close.

You will now see the files show up in the WinAgents TFTP Server Manager. For simplicity of the path, we chose to put the files in the root of the C: Drive.

Minimize WinAgents TFTP Server Manager.

 

Create host profile


Now we are going to start the Auto Deploy configuration part. For this part what we need to do first is to configure a host the way that we want. This host is what we call a reference host. After that we need to extract a host profile from this host. This host profile is a configuration file with the configuration that will be used to boot the ESXi.


 

Select Host Profile

 

Next we will need to create a host profile for AutoDeploy to use to configure the ESXi hosts after the software has been installed.

Maximize the vSphere Web Client (IE). If you close it, you can open the IE and access the following URL: https://vc-l-01a.corp.local:9443/vsphere-client or use the IE URL shortcut named Site A vSphere Web Client on your IE (username: corp\administrator password: VMware1!).

  1. Click on the Home button
  2. Click on Host Profiles icon

 

 

Open The Host Profile Wizard

 

The Host Profiles page opens

  1. Click the icon to create a new host profile

 

 

Select The Host we will use as Template

 

The Extract Host Profile Wizard opens. Now we will create a host profile based on one host that we configured exactly the way we wanted.

  1. Select the first host in the list
  2. Click Next

 

 

Name The Host Profile

 

Give the Host Profile a name and description.

  1. Enter Rainpole as the name and optionally add a description for other users who will use the Host Profile
  2. Click Next

Review the details then Click Finish

Note: After you click finish, the creation of the profile can take up to 3 minutes

 

 

Create Host Profile

 

You can review the task's progress on the right hand side under Recent Tasks. Once completed you will see the Host Profile in the objects lists

Minimize the vSphere Web Client.

 

Configure host profile / host customization


Now that we have created a Host Profile this will serve as the common or GOLD profile for the rest of our hosts (Named Rainpole).

Each host will be associated with a common host profile, and in many cases will require an associated Answer File. The Answer file will provide the ability to input Host specific information that cannot be "answered" in the common profile. As an example, if a VMKernel port was setup; specifically for VMotion or storage, the port information for these IP Addresses will need to be indicated in the Answer file. Another common need for the Answer file would be for iSCSI information. At the time of this writing, a host has to be part of the inventory and have a profile applied to it prior to having the ability to adding or updating an answer file. Remember, the profile is Global, while each host must have its own answer file.


 

Select Host Profiles

 

Next we will need to create a host profile for AutoDeploy to use to configure the ESXi hosts after the software has been installed.

Maximize the vSphere Web Client (IE)

  1. Click on the Home button
  2. Click on Host Profiles icon

 

 

Attach Host Profile to Cluster

 

First we need to attach the GOLD Profile (Rainpole) to the Cluster.

  1. Select the Rainpole Host profile
  2. Click on the Actions drop down and select Attach/Detach Hosts and Clusters

 

 

Attach Host Profile Wizard

 

The Attach/Detach Host and Cluster wizard opens

  1. Next select Cluster Site A
  2. Click on Attach, you will see the Cluster move to the right hand box.
  3. Click Next

 

 

Review

 

On the Next Screen you will see the individual customizable option for each host, including IP addresses for each VMKernel port group. These are unique to each host Feel free to review these items and then click Finish

 

Prepare the ESXi Depot Image


The ESXi software depot is the location in which a group of binaries and software packages in the form of "Images" (used to run ESXi) are stored. The images themselves can be either provided by VMware from the download page, or a customer could potentially modify (customise) an image with custom drivers or software (such as vendor specific CIM providers) by adding/removing "VIBs".

For the purposes of this exercise, we are using the VMware provided depot with one of the default Image Profiles. For the sake of time in the lab, the Software Depot has already been downloaded to a local folder that we will configure Auto Deploy to use.

The next few steps in this document will give specific commands to run from the PowerCLI with brief explanations. If you would like further details on each command, at the PowerCLI prompt type: help <cmdlet>

The key components of the software architecture are VIBs, Image Profile and Software Depots.

The VIB is a software package that can be installed on an ESXi host.

Image Profiles are a collection of VIBs that represent a full ESXi Image.

A Software Depot is a repository of VIBs used to create Image Profiles. Software depots can be accessed online via HTTP as well as offline using a .ZIP archive.

The image profile defines each of the ESXi images and consists of multiple VIBs.

The Software Depot location has to be accessible from the location you run the PowerCLI commands (Local drive or Mapped network drive). For this lab we have placed the depot package on the control center.


 

Verify the Depot Image Location

 

As mentioned the vSphere Software Depot that you will be using to create your Image Profile has already been download to the Control Center VM and is located in C:\Software\ folder under the name of VMware-ESXi-5.1.0-799733-depot.zip. We will use this depot image to create our image profile. Please open the Windows Explorer and verify that the file really exists.

 

 

Connect to The vCenter

 

Now we will need to open the PowerCLI console. If you already have it open and minimised, just maximise it and skip step one below.

  1. Click on the VMware PowerCLI shortcut on your desktop.
  2. Enter the following command:
connect-viserver vc-l-01a.corp.local

NOTE: You might see an certificate warning. This is because we are using a self generated certificate for this lab, please ignore the warning.

 

 

Verify That You Are Connected

 

Check that you successfully connect to the vCenter

NOTE: On your lab the user may be different that the one in the screenshot

 

 

Adding The ESXi Depot

 

Now you will will add the ESXi image to the software repository

1. In the PowerCLI console type the following command:

Add-ESXSoftwareDepot 'C:\software\VMware-ESXi-5.1.0-799733-depot.zip'

2. Verify that you got the Depot URL as response

** TIP - use TAB to auto complete.

Our Depot Image from VMware containing our VIB is contained within C:\software\ESXi Images\VMware-ESXi-5.1.0-799733-depot.zip. VIB Depot images can be downloaded from the VMware Website as part of the vSphere downloads or created by you with Image Builder.

 

 

Verify That The Image Profile Was Added

 

Verify the image profile was added to the repository.

1. Check by typing the following command:

Get-EsxImageProfile

 

 

Clone Image Profile

 

To Help us with the Deploy rule creation we will clone the ESXi-5.1.0-799733-standard image to an easier to remember profile name. We will call the image profile 'RainpoleImage'

1. Type the following command:

New-EsxImageProfile -CloneProfile ESXi-5.1.0-799733-standard -name RainpoleImage

2. Answer "VMware" as the vendor

 

 

Adding HA Agent Depot

 

Now we will need to add the HA Agent Depot image. vCenter needs to install this agent on the host before it can join a cluster. As we will need our new host to be added to a cluster, lets also prepare to install this agent. We can do this by getting the agent directly from the vCenter via http.

1. To do this, please execute the following command:

Add-ESXSoftwareDepot http://vc-l-01a.corp.local/vSphere-HA-depot

2. Verify that you received the Depot URL as a response

NOTE: This command is case sensitive.

 

 

 

Add HA Depot to The Image Profile

 

Now we will add the HA Depot to our Image Profile, so we will have everything we need to install into our new ESXi host in one image profile.

  1. In the PowerCLI console type the following command:
Add-EsxSoftwarePackage -imageprofile 'RainpoleImage' -SoftwarePackage vmware-fdm

 

Create deploy rules


Now we need to create a rule that specifies the hosts, on which the Host Profile will be applied.

In this case we will specify just the new host in our Cluster, however we can specify server vendor (HP,Dell etc) or, as we will do, we can specify by IPv4 range.


 

Create Deploy Rule

 

Now we need to create a rule will be used to configure the host.

In this case we will specify just the the new host, however we can specify server vendor (HP,Dell etc) or, as we will do, we can specify by IPv4 range.

1. For our Lab type the command:

$DeployNoSignatureCheck=$true

2. Then type (Please watch out for the spaces):

New-DeployRule -Name "RainpoleBoot" -Item "RainpoleImage" -Pattern "ipv4=192.168.110.200"

The following explains the parameters.

RainpoleBoot is the name given to the rule.

RainpoleImage is the ESXi Image Profile,

ipv4= is the IP Address to be used for the ESXi Host

Once you execute the command you'll see the ESXi Image being uploaded to the Auto Deploy Server.

NOTE: This can take a few minutes to complete. If the images are not already uploaded you may see PowerCli uploading them.

 

 

Add Deploy Rule

 

Now we need to make the rule active in our rule sets.

Type the following command:

Add-DeployRule RainpoleBoot

We are now almost ready to reboot our ESXi server! In the next few steps we are going to reboot our empty virtual machine that we are going to use as our new host and watch it as Auto Deploy installs the ESXi host on it.

 

 

Verify Deploy Rule

 

Just to verify that our deploy rule is set, lets execute the following command:

Get-DeployRule

 

Rebooting the ESXi host and applying host configuration


Now that the infrastructure has been setup and the hosts are ready for PXe boot, we will reboot ESX-03a. Then during the boot the Auto Deploy will deploy the ESXi image to the host and configure it accordingly


 

Open vSphere Web Client

 

Now we will Open the IE and access our vSphere Web Client to be able to boot our ESXi server. If you did not close the IE, just maximize it and move to the next step.

 

 

Logging in vSphere Web Client

 

After you accepted the certificate warning, log in to the vSphere Web Client. If you already had the IE open and logged in, please go to the next step.

To login you should use the following credentials:

username: corp\administrator

password: VMware1!

Note: It can take up to 3 minutes for you to login. This is due to the fact that this lab is done using an nested environment where we virtualised ESXi hosts on top of ESXi hosts. This kind of environment is very good for labs because of it's flexibility but is not supported as a production environment as you do not have a lot of performance on it.

 

 

Access Hosts and Clusters

 

Now that you are logged in, we will open the hosts and cluster view to boot our machine

1. Click on home tab

2. Click on the hosts and Cluster icon

 

 

esx-03a

 

For this lab, we are using a nested ESXi host. This means that for the purpose of this lab, we create a virtual machine and we will install the ESXi on this virtual machine. This will leave us with an ESXi running inside a ESXi which is not a supported environment as we do not have performance. But for the purpose of the lab it will work fine.

Please find the virtual machine named esxi-03a on the left of the console. In the next step we will power it on and open it's console.

NOTE: There is no action or command to be done on this step. The intention of this step is just to clarify the fact that we are using a nested environment as explained above.

Please proceed to the next step.

 

 

Powering on Esxi-03a

 

Execute the following commands on the vSphere Web Client

1. Right click on the esxi-03a virtual machine

2. click on the power on menu option

Note: It may take some minutes for the esx-03a to power on.

 

 

Open Esx-03a Console

 

Execute the following commands on the vSphere Web Client

1. Right click on the esxi-03a virtual machine

2. click on the Open Console menu option

Note: If the option Open Console is not available, this means that the esx-03a did not finish powering on. Please wait a Couple of seconds and try again. You can follow the powering on process on the upper right part of the console. On the recent tasks section.

 

 

Checking That esx-03a is empty

 

After the bios loads you will see a message saying that this machine does not have any OS installed. This is because this machine is not connected to the network yet, and we did this step to assure you that the machine was really empty.

After you receive the Operating System not found message, please execute the following command on the Browser:

1. Go back to the vSphere Web Client that is open on the previous tab

 

 

Edit The esx-03a Settings

 

Let's edit the settings of our esx-03a machine and connect it to the network:

1. Right Click the esx-03a.

2. Click on the Edit Settings option.

Now go to the next step where we connect our esx-03a to the network

NOTE: As mentioned before, for the purpose of this lab we are using a Virtual Machine as our esx-03a host. This is called a nested environment and it is not supported for production, but for our lab it fits its purpose.

 

 

Connect esx-03a to The Network

 

A new window pops up with the settings of our esx-03a. We will now connect it to the network. As you can see both network cards are not marked as connected. We’ll connect those two network adapters to their corresponding networks.

Please execute the following commands

1. Check the “connected” checkbox on the first network adapter.

2. Check the “connected” checkbox on the second network adapter.

3. Click the OK button. You will return to the previous screen.

Note: Please do not change the networks, just connect them to the networks already selected. The first Network adapter should be on the Management Network and the second one on the Storage Network.

 

 

 

Return to The Console

 

Now we will need to return to the Console of the esx-03a.

 

Please execute the following command:

1. Click on the browser tab named esx-03a

 

 

Reboot esx-03a

 

Now with our esx-03a machine properly connected to the network, we will reboot it and see the esxi being installed on the fly upon boot.

 

Please execute the following command:

1. Click on the send Ctrl-Alt-Del button. This will reboot the machine.

Please go to the next step where we will see the esxi being installed.

 

 

Auto Deploy Loading

 

Note that the machine will boot up, try to find an image locally, it will not find it. Than it will reboot again.

On the second time it boots up, you will see that we have a different message from the bios. Now with network connection the machine booted up using our PXE boot server, grab a DHCP address from our reservation, and is downloading the esxi image from our TFTP Server. After that it will apply the configurations that we set on the PowerCLI earlier on this lab.

Please go to the next step

 

 

Booting esx-03a

 

After the esxi image is downloaded to the esx-03a machine, it start to load itself. you can follow all the modules being installed and loaded on the fly.

Note: This installation and loading can take up to 10 minutes.

 

Verifying The Installation of ESXi Image


Now we will watch the Auto Deploy do its work as the host boots up. During the PXE boot Auto Deploy will download the ESXi image and configuration files needed to prepare host and make it compliant with the reference host used to create the profile.


 

ESXi Installed and Functional

 

As you can see, now we have a brand new ESXi installed and ready to be used. You can also check that our esx-03a host received the right ipv4 address from our DHCP server.

Now, please perform the following:

1. Click on the vSphere Web Client browser tab to return to the vSphere client

 

 

 

Refreshing the vSphere Web Client

 

Now we will see our esx-03a machine appear on the vCenter as a new host. This process can take up to 3 minutes, to accelerate the process do the following:

Please execute the following command:

1. Click on the refresh button

Please go to the next step

 

 

New Host Appears

 

1) After you click on the refresh button, we can see that the host esx-03a.corp.local now appears as an available host to be used. Please feel free to inspect our new esx-03a host settings.

For the purpose of this lab we will not automatically add the ESXi on the cluster in the intrest of time, but you can configure Auto Deploy to do so. Please check the Auto Deploy documentation to see how to configure the Auto Deploy to accomplish this.

 

Summary


This completes the Auto Deploy lab. VMware thanks you for taking time to explore how you can utilize Auto Deploy to quickly scale up a cloud infrastructure!

Auto Deploy Possibilities:

Auto Deploy now has two options that we can choose from. On this lab we just used the Auto Deploy Stateless Caching

Auto Deploy Stateless Caching – This feature allows you to cache the host's image locally on the host or on a network drive and continue to provision the host with Auto Deploy

Auto Deploy Stateful Installs – This feature allows you to install hosts over the network without setting up a complete PXE boot infrastructure. After the initial network boot, these hosts boot like other hosts on which ESXi is installed.

Thanks for again for taking this lab and enjoy VMworld 2013!


Module 2 - Introduction and new features in PowerCLI 5.5

Module Overview


This lab will introduce you to VMware vSphere PowerCLI - the administrator's choice for automating vSphere and vCloud Director. Novice users will easily learn to use the tool and more advanced users will get familiar with the new functionality available in the latest release of the product like vSphere tags management and opening a VM console. We will demonstrate how to perform common administrator tasks in both vSphere and vCloud and how easy it is to migrate to and manage the vCloud. You will walk away with a better understanding of PowerCLI and how it can help you in your day-to-day work. You will need about 45 minutes to complete the lab.


 

What's in this module

You will learn how to add new ESX host to vCenter Server and assign a license key to it, as well as how to effectively use PowerCLI for reporting of your virtual infrastructure. Using PowerCLI you will connect to a vCenter Server where you will add tags to several VMs. You will then import these VMs into a vApp in vCloud Director. Then you will power on one of the cloud VMs and open a console to it.

 

 

What is PowerCLI

VMware vSphere PowerCLI is a powerful command-line tool that lets you automate all aspects of vSphere management, including network, storage, VM, guest OS and more. PowerCLI is distributed as a Windows PowerShell snapin, and includes over 370 PowerShell cmdlets for managing and automating vSphere and vCloud, along with documentation and samples.

 

 

What Can PowerCLI Do For You

Using PowerCLI you will be able to do large scale deployments of VMs with a single line of script. You will be able to automate tedious repetitive tasks to save time. You will be able to manage thousands of objects just as easily as you would manage a single one. You can schedule scripts to run on a daily basis and monitor the performance of your environment. PowerCLI will enable you to easily prepare reports on your virtual environment by reusing hundreds of already available scripts in our community.

 

 

Free Download

VMware vSphere PowerCLI is a completely free product which takes less than 5 minutes to setup. You can download it from here:
http://vmware.com/go/powercli

The product can be installed on any Windows machine that has .NET Framework 2.0 and Microsoft PowerShell 2.0 or above installed. For your convenience we have already installed it for this lab.

Note: The lab does not have internet connectivity, so you should explore these sites after the lab.

 

 

Active Community

PowerCLI has a very active community where users share scripts and ideas, ask questions and get answers. This is a great place to find help if you are new to the product. It is very likely that the script you need is already available there:
http://vmware.com/go/powercli

 

Getting Started With PowerShell and PowerCLI


In this lesson you'll learn the basics of PowerShell and PowerCLI. You'll learn how to start the PowerCLI console and PowerGUI, how to list available commands and view their help.


 

Starting PowerCLI

 

After installation, PowerCLI can be started by double clicking the desktop icon labeled "VMware vSphere PowerCLI". This will open the PowerShell console and load all PowerCLI snapins.

 

 

Using PowerGUI Editor

 

As an alternative to the simple console, you can use a variety of script editors that provide a better user experience to the PowerCLI users. For this lab we will use the PowerGUI script editor. You can start the editor by double clicking its icon on the desktop (1). The upper pane is for viewing/editing script files, and the lower pane (2) (labeled "PowerShell Console") is for running individual commands and displaying their output (an analog of the standard PowerShell console).

During this lab you will execute various PowerCLI commands in the "Powershell Console" window (2) of PowerGUI. You can either type the commands yourself or copy-paste them from the "Module 2 HelpScript" file located on the desktop. Note that after you open the script in PowerGUI you can select commands line by line and execute selection with Ctrl+F7. Before typing a new command make sure the previous one is completed - you will see "Script execution completed" message at the bottom of the console (2).

The right pane (3) is the variables window. There you can see all variables defined in the current session and their respective values.

 

 

Listing Available Commands

 

Let's explore what we can do with PowerCLI. PowerCLI's Core snapin provides over 270 commands (called cmdlets in PowerShell) for managing vSphere. You can view the available PowerCLI commands by typing:

Get-Command -PSSnapin VMware.VimAutomation.Core

This will list all commands for managing vSphere. As the list is quite large, you may want to narrow it down to something more specific, for example all commands for managing VMs:

Get-Command -PSSnapin VMware.VimAutomation.Core -Noun VM

Hint: You can use the autocomplete for faster typing - just start typing the beginning of the command/parameter and press "Tab".

 

 

Connecting to vSphere

 

The first thing we need to do in order to manage our vCenter Server is to connect to it. This is done by using the Connect-VIServer command. Our vCenter is named "vc-l-01a" and here's how to connect to it:

Connect-VIServer vc-l-01a -User corp\administrator -Password VMware1!

The command will connect to the vCenter with the specified user's credentials.

 

 

Getting Help

 

If you are unsure how to use a specific cmdlet, you can easily view its help by typing Get-Help (or for short - just "help") and the name of the cmdlet:

help Connect-VIServer

If you want to see the full help with example usages of the cmdlet and parameters description you should open the full help of the cmdlet:

help Connect-VIServer -Full

If you want to see the examples only you can use -examples switch like this:

help Connect-VIServer -Examples

You can also search for a specific word in the entire help. Let's try searching for a cmdlet that vmotions VMs:

help vmotion

The third result is the cmdlet we need - Move-VM. We'll use it later in this module.

Feel free to check the help of any cmdlet we demonstrate in this lab.

 

Executing commands


In this lesson you will learn some of the most common PowerCLI commands and try them out for yourself.


 

Retrieving VMs

 

One of the most common things to do is list the VMs in your vCenter Server. That is useful for browsing the inventory, reporting as well as for further processing of specific VMs (e.g. batch modification of VMs). You can retrieve all VMs with:

Get-VM

You can also retrieve one or more VMs by name. Try out the following:

Get-VM sales-dpt-db
Get-VM sales*

 

 

Creating VM from scratch

 

Creating a VM from scratch is also quite easy. To create a basic VM you just need to choose a name and a place where you want to create it. For this exercise we'll also specify the size of the hard disk of the VM and set it to 4 MB since this is just a sample environment. First let's find a place where to place the VM. Type Get-Cluster to see what clusters are available in the environment:

Get-Cluster

We can see that there is a single cluster called "Cluster Site A". Let's retrieve this cluster and store it in a variable so that we can use it later. Variables in PowerShell are placeholders for objects (such as our cluster) and are denoted by $ sign and a name:

$cluster = Get-Cluster "Cluster Site A"

Tip: Since when you assign the result of a cmdlet call to a variable no output is produced you can check variable's value in the variables panel of PowerGUI (1), or just print its value to the screen by typing its name like this:

$cluster

Now let's create the VM. The cmdlet for creating a VM is called New-VM. We specify the VM's name, the cluster where we want to create it and the size of its hard disk:

New-VM -Name testVM -ResourcePool $cluster -DiskMB 4

 

 

Configuring VM

 

Creating a VM was easy. Now let's see how to modify an existing VM. Let's change the memory of the newly created VM to 512 MB. Modifying a VM is done through Set-VM cmdlet. We need to retrieve our VM and then pipe it to this cmdlet in order to change its memory:

Get-VM testVM | Set-VM -MemoryMB 512

Note: Here we use a PowerShell functionality called "pipeline" (or "piping"). Set-VM cmdlet actually has a parameter called "VM" that accepts VM objects. Instead of retrieving our VM, storing it in a variable and passing it to that parameter of Set-VM, we simply "pipe" the output of Get-VM to Set-VM. This way the output of the first cmdlet becomes the input of the second.

When you are prompted for confirmation - click yes.

Hint: Prompting for confirmation is good for interactive usage, however it is undesired in scripts since it will halt them. You can automatically confirm the operation by appending "-Confirm:$false" parameter to your cmdlet call.

 

 

Power on VM

 

Power operations of VMs (e.g. power on, power off, suspend) are done through dedicated cmdlets. Here's how to power on our VM:

Start-VM testVM

 

 

Adding an ESX Host

 

Another task, which you can easily automate with PowerCLI is adding a new ESX host to vCenter Server.

To add the ESX host we need the datacenter to add it to. To get the datacenter we'll use Get-Datacenter cmdlet:

$datacenter = Get-Datacenter -Name 'Datacenter Site A'

Now we'll use the Add-VMHost cmdlet to add ESX host to the vCenter Server:

$vmHost = Add-VMHost -Name esx-03a -Location $datacenter -User root -Password VMware1! -Force -Confirm:$false

NOTE: This call might fail if you have already added the ESX host to the VC while completing Module 1 or Module 3. If the host is already available make sure that you have it in the $vmHost variable. To retrieve the ESX host, use the Get-VMhost cmdlet:

$vmHost = Get-VMhost 'esx-03a.corp.local'

If you already have your ESX added to the VC and properly licensed you can skip the next step as well.

 

 

Assigning a license key to the Host

 

Now when the ESX host has been added we need to assign it a license. We'll use the -LicenseKey parameter of Set-VMHost to do that:

Set-VMHost -VMHost $vmHost -LicenseKey 'H168K-N900K-Q895T-0G1R4-3181J' -Confirm:$false

Now our ESX host is fully functional and is ready to accommodate some VMs.

 

 

vMotioning virtual machine to the host

 

After we have our new ESX host fully functional it's time to start using it. Let's move the VM we created in the previous steps to this host, so that we can free up some resources on the cluster it's currently on. Since the VM is currently started, we'll have to vMotion it from one host to another, and since the hosts don't have shared storage we'll have to make full vMotion (changing both host and storage). To do that we'll have to specify the new datastore, that we want to move the VM to. We'll retrieve it with Get-Datastore cmdlet:

$newDatastore = Get-Datastore -VMHost $vmHost

Now we're ready to move the VM to the new host

Move-VM testVM -Destination $vmhost -Datastore $newDatastore

Note: Since Move-VM operation could take significantly long time, you may want to move the VMs asynchronously and continue your work in the meantime. You can do that by specifying -RunAsync parameter of Move-VM. Many other cmdlets that may take long time to complete also support -RunAsync.

 

Using PowerCLI for reporting


With more than 100 Get-* cmdlets PowerCLI is also a powerful reporting tool. In this lesson you'll learn more about this usage of PowerCLI


 

Retrieving specific properties of an object

 

When you call a cmdlet (like Get-VM) the result you get is an object or array of objects (in the case of Get-VM that's VM objects). To see what properties the object(s) have you can use Get-Member cmdlet like this:

Get-VM | Get-Member

This will list all the available properties of the VM object.

Then you can use powershell's 'select' command to retrieve only the properties you need from resulting object:

Get-VM | Select Name, NumCPU, MemoryMB, PowerState, VMHost

 

 

Filtering report results

 

When the Get-* cmdlet has no parameter to filter the objects by the property you need, you can use powershell's 'where' command like this to filter the results from a cmdlet call:

Get-VM | Where {$_.Powerstate -eq "PoweredOn"} | Select Name, NumCPU, MemoryMB, PowerState, VMHost

Hint: $_ is a reserved powershell variable that holds the current object from the pipeline

 

 

Exporting results to HTML page

 

To present the data to your manager or another team you need them formatted in some way. You can export the data in HTML format by using ConvertTo-Html cmdlet. Since this command just formats the data in HTML you also need Set-Content cmdlet to write formatted data to file:

Get-VM | Select Name, NumCPU, MemoryMB, PowerState, VMHost | ConvertTo-Html | Set-Content "c:\myPowerCLIReport.html"

Now go to 'c:\' folder and open the report.

Hint: You can also export you data to CSV format with Export-CSV cmdlet and if you look on the internet you'll also find third-party implementations for Export-XLS cmdlet, which exports your data in excel format.

 

 

Making the report look better

 

If we want to make our report look a bit better we can apply some styles on it like this:

$a = "<style>"
$a = $a + "BODY{background-color:Gainsboro;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:SkyBlue}"
$a = $a + "TD{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:PaleTurquoise}"
$a = $a + "</style>"
Get-VM | Select Name, NumCPU, MemoryMB, PowerState, VMHost | ConvertTo-Html -head $a | Set-Content "c:\myPowerCLIReport.html"

If you open the report now you'll see that it looks much better

 

Assigning tag to a VM


In this lesson you'll learn how to assign tag to a VM. Later in the module we'll use this tag to filter VMs that will be imported to vCloud


 

Getting defined tags

 

Tags that are already defined in vSphere can be retrieved with Get-Tag cmdlet:

Get-Tag

Note: The first execution of Get-Tag could take longer to complete.

We want to get a tag named "vCloud" and tag all the VMs that we'll migradte to vCloud director with it. Let's retrieve this specific tag and save it into a variable:

$vCloudTag = Get-Tag -Name vCloud

 

 

Assigning tag to VMs

 

Assigning tag to different types of objects (VM, VApp, ResourcePool, Datastore, Folder, DistributedSwitch, etc. ) is done with New-TagAssignment cmdlet. Let's assign vCloud tag to the VMs that we will migrate to vCloud director. These are all the VMs of the sales department:

$vms = Get-VM sales-dpt*
$vms | New-TagAssignment -Tag $vCloudTag

 

Introduction to vCloud Director PowerCLI


In this lesson you'll get familiar with PowerCLI's vCloud Director Snap-in.


 

The vCloud Director Snap-in

PowerCLI 5.5 offers a snap-in with over 60 commands for managing vCloud Director. Using those you can easily create reports for your cloud environment and perform common administrative tasks. The snap-in is automatically loaded when you start PowerCLI (either from the desktop shortcut or from PowerGUI editor).

Note: While performing operations through PowerCLI you can open the vCloud Director UI and observe the result of your actions. In order to start the UI open Firefox browser and use "vCloud -> vCloud Hybrid Service" bookmark from the bookmarks toolbar. Skip the invalid certificate warning by selecting "I understand the risks -> Add exception... -> Confirm security exception". Then login with user "administrator" and password "VMware1!".

 

 

Connecting to vCloud

 

Similar to the way we connected to the vCenter Server, we'll now connect to the vCloud Director named "vcd-l-01a". We'll use Connect-CIServer cmdlet which will connect using the specified credentials:

Connect-CIServer vcd-l-01a -User administrator -Password VMware1!

If confirmation dialog for the server certificate is displayed, select "Accept Permanently". It's shown when server with "invalid" certificate is being connected.

You are now connected to both the vCloud Director and the vCenter Server, allowing you to perform operations on both.

 

 

Exploring the vCloud Snap-in

 

Let's see what commands are available in the Cloud snapin. You can view the full list by typing:

Get-Command -PSSnapin VMware.VimAutomation.Cloud

 

 

Retrieving objects from vCloud

 

You can explore the vCloud Director's inventory by using the available Get-* cmdlets. Here's how to retrieve the defined Organizations, Provider VDCs and Organization VDCs:

Get-Org
Get-ProviderVdc
Get-OrgVdc

 

Importing a vApp from vCenter Server to vCloud Director


In this lesson you will learn how to import VMs from vSphere to vCloud Director vApp. The vCenter Server is already attached to vCloud Director so the process is quite simple. The most efficient approach (in terms of performance and resources) - is to register the individual VMs one-by-one.

vApps and VMs in vCloud Director are called CIVApp and CIVM respectively to distinguish them from their vSphere counterparts.


 

Getting the VMs to be imported to vCloud Director

 

The VMs that we want to import to vCloud director have been tagged in the previous lesson with "vCloud" tag. So, let's retrieve all the VMs that are marked with this tag:

$vmsToImport = Get-VM -Tag 'vCloud'
$vmsToImport

 

 

Importing the first VM

 

Importing a VM from vSphere to vCloud Director is done through the Import-CIVApp cmdlet. Since VMs in vCD must always be a part of a CIVApp, importing the first VM will automatically create a CIVApp and place the CIVM inside it. We will import the remaining VMs in this CIVApp.

When importing the first VM we'll need to specify an Organization VDC where to place it. This will be the "corpVDC":

$orgVdc = Get-OrgVdc corpVDC

Now let's import the first VM and name the containing CIVApp "SalesDptInfrastructure"

Import-CIVApp -VM ($vmsToImport | select -first 1) -OrgVdc $orgVdc -Name SalesDptInfrastructure

 

 

Importing the rest of the VMs

 

Now we have a CIVApp in the vCloud Director named CoreInfrastructure containing a single CIVM. Let's import the rest of the VMs in that CIVApp. First we'll store the CIVApp in a variable that we'll reuse for the imports. The cmdlet for retrieving CIVApps in vCloud Director is named Get-CIVapp to distinguish it from its vSphere counterpart (Get-VApp):

$ciVApp = Get-CIVApp SalesDptInfrastructure

Now let's save the rest of the VMs from $vmsToImport array to another array and then import them:

$remainingVMs = $vmsToImport | select -last ($vmsToImport.Length-1)
$remainingVMs | Import-CIVApp -VApp $ciVApp

 

 

Verifying the successful import

 

Let's check the CIVApp to see that all VMs are successfully imported. The cmdlet for retrieving CIVMs from vCloud Director is Get-CIVM:

$ciVapp | Get-CIVM

Note: You can also use the vCloud Director UI to verify this.

 

Opening a console to a VM


In this lesson you'll learn how to open a console to a VM from PowerCLI.


 

Starting cloud VM

 

To open a console to a VM we need to start it first:

$vm = Get-CIVM 'sales-dpt-db' -VApp SalesDptInfrastructure
Start-CIVM $vm

 

 

Opening a console

 

You can access a virtual machine's desktop by launching a console to the virtual machine. From the console, you can perform activities in the virtual machine such as configure operating system settings, run applications, monitor performance, and so on. Opening a console to vSphere and vCloud VMs is done with Open-VMConsoleWindow cmdlet. Let's open a console to the VM we just started:

Open-VMConsoleWindow $vm

This will open a console to the VM in new tab in your default browser.

 

Further Reading


This lesson is for information purpose only and lists some of the more advanced features of PowerCLI as well as useful reading materials for both novice and advanced users. Feel free to experiment with these if you like.


 

Accessing the entire vSphere API

Although PowerCLI offers more than 300 cmdlets for managing vSphere they don't cover the entire functionality of the platform. Despite that you are still able to access all of the functionality by using the Get-View cmdlet. This special cmdlet is an access point to the entire vSphere API. The objects returned by the cmdlet are known as "Views" and represent an exact copy of the vSphere API objects. You can find more information about these objects in the vSphere API Reference

Documentation:

http://pubs.vmware.com/vsphere-51/index.jsp

Using this cmdlet you will be able to write scripts directly against the API in an object-oriented manner.

 

 

Project Onyx

Although having the entire vSphere API at your disposal is very powerfull, it is often hard to write scripts against the API compared to using cmdlets. That's where project Onyx comes to help you. This tool acts as a proxy between the vSphere Client and the vCenter Server. The job of Onyx is to generate script based on actions you perform in the vSphere Client. This comes very handy when you know how to perform a task in the vSphere Client and want to automate it with script, but have no idea how to write this script. Onyx is distributed as a free product from VMware and you can download it from here:

http://vmware.com/go/onyx

Note: Onyx only works with vSphere desktop client, not with vSphere Web Client.

 

 

Accessing the entire vCloud Director API

PowerCLI offers 60 cmdlets for vCloud Director management. This number will continue to grow in the future, but until then you can use the entire functionality through the API. Similar to the Get-View cmdlet for vSphere, there is a Get-CIView cmdlet for vCloud Director. It lets you access the vCloud Director API and create scripts based on it. You can find out more information about the API here:

http://pubs.vmware.com/vcd-51/index.jsp

 

 

Useful materials to get you started with advanced PowerCLI scripting

If you are new to PowerCLI or want to learn more about the product then here are a few blogs you can follow. There you can find great articles and scripts about PowerCLI:

• The official PowerCLI blog: http://blogs.vmware.com/vipowershell/

• Alan Renouf's blog: http://www.virtu-al.net

• Luc Dekens' blog: http://www.lucd.info

 

 

Final words

Thank You for taking this lab. We hope you found the presented information helpful and will use PowerCLI in your day-to-day work. Your opinion is important to us, so please spend a minute to fill out the survey at the end of the lab.

 

Module 3 - VDS automation with PowerCLI

Module Overview


This module will introduce you to the new VMware vSphere PowerCLI cmdlets for virtual distributed switch (vDS) automation. We will demonstrate how to perform common VDS related tasks with PowerCLI. You will walk away with a better understanding of PowerCLI and how it can help you in your day-to-day work. You will need about 45 minutes to complete the lab.


 

What's in this module

Using PowerCLI you will connect to a vCenter Server where you will add a new ESX host. You'll also migrate the host's networking to an existing VDS. You'll then create a new distributed portgroup on that VDS and will migrate the host VM networking to that portgroup. You'll also see how to configure different portgroup policies as well as private vlans. At the end you'll migrate the host networking back to the standard switch and will restore the VDS to the state you've backed up in the beginning of the lab.

 

 

What is PowerCLI

VMware vSphere PowerCLI is a powerful command-line tool that lets you automate all aspects of vSphere management, including network, storage, VM, guest OS and more. PowerCLI is distributed as a Windows PowerShell snapin, and includes over 370 PowerShell cmdlets for managing and automating vSphere and vCloud, along with documentation and samples.

 

 

What Can PowerCLI Do For You

Using PowerCLI you will be able to do large scale deployments of VMs with a single line of script. You will be able to automate tedious repetative tasks to save time. You will be able to manage thousands of objects just as easily as you would manage s single one. You can schedule scripts to run on a daily basis and monitor the performance of your environment. PowerCLI will enable you to easily prepare reports on your virtual environment by reusing hundreds of already available scripts in our community.

 

 

Free Download

VMware vSphere PowerCLI is a completely free product which takes less than 5 minutes to setup. You can download it from here:
http://vmware.com/go/powercli

The product can be installed on any Windows machine that has .NET Framework 2.0 and Microsoft PowerShell 2.0 or above installed. For your convenience we have already installed it for this lab.

Note: The lab does not have internet connectivity, so you should explore these sites after the lab.

 

 

Active Community

PowerCLI has a very active community where users share scripts and ideas, ask questions and get answers. This is a great place to find help if you are new to the product. It is very likely that the script you need is already available there:
http://vmware.com/go/powercli

 

Getting Started With PowerShell and PowerCLI


In this lesson you'll learn the basics of PowerShell and PowerCLI. You'll learn how to start the PowerCLI console and PowerGUI, how to list available commands and view their help.


 

Starting PowerCLI

 

After installation, PowerCLI can be started by double clicking the desktop icon labeled "VMware vSphere PowerCLI". This will open the PowerShell console and load all PowerCLI snapins.

 

 

Using PowerGUI Editor

 

As an alternative to the simple console, you can use a variety of script editors that provide a better user experience to the PowerCLI users. For this lab we will use the PowerGUI script editor. You can start the editor by double clicking its icon on the desktop (1). The upper pane is for viewing/editing script files, and the lower pane (2) (labeled "PowerShell Console") is for running individual commands and displaying their output (an analog of the standard PowerShell console).

During this lab you will execute various PowerCLI commands in the "Powershell Console" window (2) of PowerGUI. You can either type the commands yourself or copy-paste them from the "Module 3 HelpScript" file located on the desktop. Note that after you open the script in PowerGUI you can select commands line by line and execute selection with Ctrl+F7. Before typing a new command make sure the previous one is completed - you will see "Script execution completed" message at the bottom of the console (2).

The right pane (3) is the variables window. There you can see all variables defined in the current session and their respective values.

 

 

Listing Available Commands

 

Let's explore what we can do with PowerCLI. PowerCLI's VDS snapin provides over 30 commands (called cmdlets in PowerShell) for managing VDS infrastructure. You can view the available PowerCLI commands by typing:

Get-Command -PSSnapin VMware.VimAutomation.VDS

This will list all commands for managing VDS infrastructure. As the list is quite large, you may want to narrow it down to something more specific, for example all commands for managing VDSwitches:

Get-Command -PSSnapin VMware.VimAutomation.VDS -Noun VDSwitch

Hint: You can use the autocomplete for faster typing - just start typing the beginning of the command/parameter and press "Tab".

 

 

Connecting to vSphere

 

The first thing we need to do in order to manage our vCenter Server is to connect to it. This is done by using the Connect-VIServer command. Our vCenter is named "vc-l-01a" and here's how to connect to it:

Connect-VIServer vc-l-01a -User corp\administrator -Password VMware1!

The command will connect to the vCenter with the specified user's credentials.

 

 

Getting Help

 

If you are unsure how to use a specific cmdlet, you can easily view its help by typing Get-Help (or for short - just "help") and the name of the cmdlet:

help Connect-VIServer

If you want to see the full help with example usages of the cmdlet and parameters description you should open the full help of the cmdlet:

help Connect-VIServer -Full

If you want to see the examples only you can use -examples switch like this:

help Connect-VIServer -Examples

You can also search for a specific word in the entire help. Let's try searching for a cmdlet that modifies traffic shaping policy of a VDSwitch/VDPortGroup:

help "traffic shaping policy"

The first result is the cmdlet we need - Set-VDTrafficShapingPolicy.

Feel free to check the help of any cmdlet we demonstrate in this lab.

 

Adding ESX to the vCenter Server


In this lesson you will learn how to add ESX to the vCenter Server and assign the corresponding license to it. In the following lessons you'll see how to add this ESX Server to the virtual distributed switch (VDS) and how to modify the VDS configuration accordingly.


 

Adding the ESX Host

 

To add the ESX host we need the datacenter to add it to. To get the datacenter we'll use Get-Datacenter cmdlet:

$datacenter = Get-Datacenter -Name 'Datacenter Site A'

Now we'll use the Add-VMHost cmdlet to add ESX host to the vCenter Server:

$vmHost = Add-VMHost -Name esx-03a -Location $datacenter -User root -Password VMware1! -Force

NOTE: This call might fail if you have already added the ESX host to the VC while completing Module 1 or Module 3. If the host is already available make sure that you have it in the $vmHost variable. To retrieve the ESX host, use the Get-VMhost cmdlet:

$vmHost = Get-VMhost 'esx-03a.corp.local'

If you already have your ESX added to the VC and properly licensed you can skip the next step as well.

 

 

Assigning a license key to the Host

 

Now when the ESX host has been added we need to assign it a license. We'll use the -LicenseKey parameter of Set-VMHost to do that:

Set-VMHost -VMHost $vmHost -LicenseKey 'H168K-N900K-Q895T-0G1R4-3181J'

Now our ESX host is fully functional and is ready to be added to the virtual distributed switch.

 

Backing up a VDS


In this lesson you'll learn how to back up a VDS. The backup you'll make in this lesson will be applied back to the VDS in the end of the module to restore it to its current state


 

Backing up a VDS

 

Before we make any changes on a VDS we usually want to back it up. First lets retrieve the VDS that we want to back up.

$vds = Get-VDSwitch vds-site-a

Tip: Since when you assign the result of a cmdlet call to a variable no output is produced you can check variable's value in the variables panel of PowerGUI (1), or just print its value to the screen by typing its name like this:

$vds

We'll use Export-VDSwitch cmdlet to back up our VDS in a file called 'myVDS.zip':

Export-VDSwitch -VDSwitch $vds -Destination 'myVDS.zip'

 

Adding an ESX host to a virtual distributed switch and migrating host networking


In this lesson you'll learn how to migrate ESX host networking from standard to distributed switch. We'll add our new ESX host to the virtual distributed switch (VDS) and then we'll migrate its physical and VMKernel network adapters.


 

Adding ESX host to a VDS

 

We have both VDS and ESX host available in variables from previous lessons. We'll add the ESX host to the VDS with Add-VDSwitchVMHost cmdlet.

Add-VDSwitchVMHost -VDSwitch $vds -VMHost $vmhost

 

 

Migrating host networking to the VDS

 

Add-VDSwitchVMHost only registers the ESX host on the VDS, but does not migrate the host networking. To migrate the host networking we need to use Add-VDSwitchPhysicalNetworkAdapter. In order not to lose connectivity to the host the cmdlet allows moving virtual network adapters together with the physical adapters. So first we need to get the physical network adapters that will be migrated:

$pNics = Get-VMHostNetworkAdapter -VMHost $vmhost -Physical

Then we need to retrieve virtual network adapters that will be migrated together with physical nics. We want to migrate two virtual network adapters - management and vMotion nics:

$vNicManagement = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk0
$vNicvMotion = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk1

Since we want to migrate those two virtual nics to the corresponding portgroups on the VDS we need to retrieve them first as well:

$vdPortgroupManagement = Get-VDPortgroup -VDSwitch $vds -Name "Management Network"
$vdPortgroupvMotion = Get-VDPortgroup -VDSwitch $vds -Name "vMotion Network"

Now we are ready to execute the cmdlet to migrate all these network adapters to the vDS at once:

Add-VDSwitchPhysicalNetworkAdapter -DistributedSwitch $vds -VMHostPhysicalNic $pNics -VMHostVirtualNic $vNicManagement,$vNicvMotion -VirtualNicPortGroup $vdPortGroupManagement, $vdPortGroupvMotion

When you are prompted for confirmation - click yes.

Hint: Prompting for confirmation is good for interactive usage, however it is undesired in scripts since it will halt them. You can automatically confirm the operation by appending "-Confirm:$false" parameter to your cmdlet call.

This will move $vNicManagement to $vdPortgroupManagement and respectively $vNicvMotion to $vdPortGroupvMotion.

 

Creating new distributed portgroup and configuring its vlan settings


In this lesson you'll learn how to create a new distributed portgroup and configure its vlan settings. In the next lesson we'll migrate the VM network of the ESX to this portgroup.


 

Creating new distributed portgroup

 

New-VDPortGroup cmdlet is used to create a distributed portgroup:

$pgVMNetworkPVlan210 = New-VDPortGroup -VDSwitch $vds -Name "VM Network PVlan 210"

 

 

Configuring portgroup vlan settings

 

To assign a private VLan (PVLAN) to a portgroup we need to define the PVLAN in the VDS first. We want the VMs in our "VM Network PVlan 210" portgroup to be in a promiscuous secondary PVLAN with VlanID 210. To define it we will use New-VDSwitchPrivateVlan cmdlet:

New-VDSwitchPrivateVlan -VDSwitch $vds -PrivateVlanType Promiscuous -PrimaryVlanId 210 -SecondaryVlanId 210

Next we have to configure private vlan settings of the VDPortgroup. We'll use Set-VDVlanConfiguration to do that. With this cmdlet we can configure vlan settings to VDSwitch, VDPortgroup or VDPort:

Set-VDVlanConfiguration -VDPortGroup $pgVMNetworkPVlan210 -PrivateVlanId 210

 

Migrating VM networking to the vDS


In this lesson you'll learn how to migrate VM networking to the VDS


 

Migrating VM networking

 

First we have to get the network adapters of all the VMs on the ESX host, that we added to the VDS:

$vmNetworkAdapters = Get-VM -Location $vmhost | Get-NetworkAdapter

Next we'll migrate these network adapters to the portgroup that we created in the previous step:

Set-NetworkAdapter -NetworkAdapter $vmNetworkAdapters -Portgroup $pgVMNetworkPVlan210 -Confirm:$false

Now the network traffic of all the VMs is going through the VDSwitch.

 

Configuring traffic shaping policy of the portgroup


In this lesson you'll learn how to configure traffic shaping policy of the portgroup we created in the previous lessons. We want to limit the bandwidth of the incoming traffic used by the portgroup to 100 mbit/s, so that there is enough bandwidth for the other portgroups on the VDS. The cmdlets we'll use are Get/Set-VDTrafficShapingPolicy.


 

Configuring traffic shaping policy

 

First we'll retrieve the current traffic shaping policy of the portgroup:

$policy = Get-VDTrafficShapingPolicy -Direction In -VDPortGroup $pgVMNetworkPVlan210

Now we'll change this policy by setting its peak bandwidth to 100 mbit/s

Set-VDTrafficShapingPolicy -Policy $policy -PeakBandwidth (100*1024*1024) -Enabled $true

 

Configuring security policy of the portgroup


In this lesson you'll learn how to configure security policy of the portgroup we created in the previous lessons. We want to enable promiscuous mode on this portgroup to allow monitoring of the traffic generated by the VMs. The cmdlets we'll use are Get/Set-VDSecurityPolicy.


 

Configuring security policy

 

First we'll retrieve the current security policy of the portgroup:

$policy = Get-VDSecurityPolicy -VDPortGroup $pgVMNetworkPVlan210

Now we'll change this policy by enabling its promiscuous mode:

Set-VDSecurityPolicy $policy -AllowPromiscuous $true

 

Migrating networking back to the standard switch


You could face a scenario in which you have to migrate networking from VDS to a standard switch. In this lesson you'll learn how to do that.


 

Migrating physical and virtual nics

 

To migrate host networking we need to use Add-VirtualSwitchPhysicalNetworkAdapter. In order not to lose connectivity to the host the cmdlet allows moving virtual network adapters together with the physical adapters. So first we need to get the physical network adapters that will be migrated:

$pNics = Get-VMHostNetworkAdapter -VMHost $vmhost -Physical

Then we need to retrieve virtual network adapters that will be migrated together with physical nics. We want to migrate two virtual network adapters - management and vMotion nics:

$vNicManagement = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk0
$vNicvMotion = Get-VMHostNetworkAdapter -VMHost $vmhost -Name vmk1

We also need to retrieve the standard switch we'll move those adapters to:

$vSwitch = Get-VirtualSwitch -VMHost $vmhost -Name vSwitch0

Now we are ready to execute the cmdlet to migrate all these network adapters to the standard switch at once:

Add-VirtualSwitchPhysicalNetworkAdapter -VirtualSwitch $vSwitch -VMHostPhysicalNic $pNics -VMHostVirtualNic $vNicManagement,$vNicvMotion -Confirm:$false

 

 

Migrating Virtual Machine networking

 

After we have migrated physical and virtual nics we have to migrate virtual machine networking as well.

First we have to get the network adapters of all the VMs on the ESX host:

$vmNetworkAdapters = Get-VM -Location $vmhost | Get-NetworkAdapter

Then we have to retrieve the portgroup on the standard switch we want to migrate them to:

$pgVMNetwork = Get-VirtualPortgroup -VirtualSwitch $vswitch -Name 'VM Network'

Next we'll migrate these network adapters to the portgroup that we created in the previous step:

Set-NetworkAdapter -NetworkAdapter $vmNetworkAdapters -Portgroup $pgVMNetwork -Confirm:$false

 

Restoring VDS from backup


In this lesson you'll learn how to restore VDS configuration from backup


 

Restoring VDS from backup

 

Set-VDSwitch cmdlet is used to restore VDS from backup. To make sure that the restore is completed successfully we'll check that the private vlan we've created on the VDS is removed.

Get-VDSwitchPrivateVlan -VDSwitch $vds

Note that '210/210' private vlan is available.

Before restoring the backup we need to remove the portgroup we've created on the VDS. The reason is that the restore process does not remove the additional portgroups found on the VDS (it restores the previously available portgroups and their configuration as well as the VDS configuration). Hence the restoring process will result in error, because it will try to remove the private vlan, which on the other side is in use by our portgroup.

We'll remove the port group with the Remove-VDPortgroup cmdlet

Remove-VDPortgroup $pgVMNetworkPVlan210 -Confirm:$false

Then we'll remove the host from the VDS:

Remove-VDSwitchVMHost -VDSwitch $vds -VMHost $vmhost -Confirm:$false

Now let's restore the backup from the 'myVDS.zip' file:

Set-VDSwitch -VDSwitch $vds -BackupPath 'myVDS.zip'

And let's retrieve private vlans again:

Get-VDSwitchPrivateVlan -VDSwitch $vds

Note that '210/210' private vlan is gone, which means that the VDSwitch is restored to its initial configuration.

 

Further Reading


This lesson is for information purpose only and lists some of the more advanced features of PowerCLI as well as useful reading materials for both novice and advanced users. Feel free to experiment with these if you like.


 

Accessing the entire vSphere API

Although PowerCLI offers more than 300 cmdlets for managing vSphere they don't cover the entire functionality of the platform. Despite that you are still able to access all of the functionality by using the Get-View cmdlet. This special cmdlet is an access point to the entire vSphere API. The objects returned by the cmdlet are known as "Views" and represent an exact copy of the vSphere API objects. You can find more information about these objects in the vSphere API Reference Documentation:

http://pubs.vmware.com/vsphere-51/index.jsp

Using this cmdlet you will be able to write scripts directly against the API in an object-oriented manner.

 

 

Project Onyx

Although having the entire vSphere API at your disposal is very powerfull, it is often hard to write scripts against the API compared to using cmdlets. That's where project Onyx comes to help you. This tool acts as a proxy between the vSphere Client and the vCenter Server. The job of Onyx is to generate script based on actions you perform in the vSphere Client. This comes very handy when you know how to perform a task in the vSphere Client and want to automate it with script, but have no idea how to write this script. Onyx is distributed as a free product from VMware and you can download it from here:

http://vmware.com/go/onyx

Note: Onyx only works with vSphere desktop client, not with vSphere Web Client.

 

 

Accessing the entire vCloud Director API

PowerCLI offers 60 cmdlets for vCloud Director management. This number will continue to grow in the future, but until then you can use the entire functionality through the API. Similar to the Get-View cmdlet for vSphere, there is a Get-CIView cmdlet for vCloud Director. It lets you access the vCloud Director API and create scripts based on it. You can find out more information about the API here:

http://pubs.vmware.com/vcd-51/index.jsp

 

 

Useful materials to get you started with advanced PowerCLI scripting

If you are new to PowerCLI or want to learn more about the product then here are a few blogs you can follow. There you can find great articles and scripts about PowerCLI:

• The official PowerCLI blog: http://blogs.vmware.com/vipowershell/

• Alan Renouf's blog: http://www.virtu-al.net

• Luc Dekens' blog: http://www.lucd.info

 

 

Final words

Thank You for taking this lab. We hope you found the presented information helpful and will use PowerCLI in your day-to-day work. Your opinion is important to us, so please spend a minute to fill out the survey at the end of the lab.

 

Module 4 - Active Directory Automation with vCO

vCO Active Directory Plug-in Overview


 


 

About this Module

In this lab we will demonstrate how the vCenter Orchestrator Active Directory plug-in allows organizations to automate the management of directory services tasks, particularly as they pertain to cloud provisioning use cases. For instance, the plug-in enables the automatic provisioning of vCloud Director organizations based on data retrieved from Active Directory. The plug-in also includes many administrative actions related to computers, organizations, user groups, and users, such as resetting passwords or adding users to a user group. The drag-and-drop workflow designer of vCenter Orchestrator allows you to easily assemble these actions into higher-level workflows to automate repetitive Active Directory administrative tasks.

Please Note: This lab is using pre-release Beta code so not all features are fully functional. Please follow the lab exercises as they are explained for you. The lab environment is real time and the use of features that are not fully tested may cause your lab to malfunction at which point you will need to end the lab and get in line again before starting a new one.

 

Discover the vCO Active Directory Plug-in



 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Workflow Icon

 

 

 

 

Expand the Workflow Hierarchy

 

Click the arrow next to the following folders until the Active Directory Folder appears

 

 

Active Directory: Computer Workflows

 

Expand the Computer Folder, Notice the Computer related workflows

 

 

Active Directory: Organizational Unit Workflows

 

Expand the Organizational Unit Folder, Notice the Organizational Unit related workflows

 

 

Active Directory: User Workflows

 

Expand the User Folder, Notice the User related workflows

 

 

Active Directory: User Group Workflows

 

Expand the User Group Folder, Notice the User Group related workflows

 

Add User to Group with the vCO Plug-in



 

Launch Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder, Double-Click Domain Admins

 

 

 

Click the Members Tab

 

 

 

Validate VCO Test user is not present

 

Click OK to Close Domain Admin Windows Properties

 

 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Start a Workflow Button

 

 

 

 

Type Add a User in Choose a workflow to run Window

 

Highlight the Add a user to user group Workflow from the results list, Click Select

 

 

Select Group in which to put the user

 

Click Not set

 

 

Type Domain in Choose AD:User Group Filter

 

Highlight the Domain Admin User Group from the results list, Click Select

 

 

Select User to add to Domain Admins User Group

 

Click Not set

 

 

Type VCO in Choose AD:User Filter

 

Highlight the VCO Test User from the results list, Click Select

 

 

Validate Selections and Click Submit to Proceed with Workflow

 

Click Submit

 

 

Notice the Workflow Steps Displayed on the Right Side of the Screen

 

 

 

Return to Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder, Double-Click Domain Admins

 

 

 

Click the Members Tab

 

 

 

Validate VCO Test user is now present

 

Click OK to Close Domain Admin Windows Properties

 

Disable a User with the vCO Plug-in



 

Launch Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder, Locate and Double-Click VCO Test User

 

 

 

Click the Account Tab

 

 

 

Notice the Account options Section

 

 

 

 

Scroll down until you locate Account is disabled Field

 

Confirm Account is disabled is NOT checked

Click OK to Close VCO Test Properties Windows

 

 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Start a Workflow Button

 

 

 

 

Type Disable in Choose a workflow to run Window

 

Highlight the Disable a User Workflow from the results list, Click Select

 

 

Select User in which to disable

 

Click Not set

 

 

Using the AD Window, Filter Out until you Select VCO Test

 

Scroll down to find VCO Test user,

Highlight the VCO Test user from the results list, Click Select

 

 

Validate Selections and Click Submit to Proceed with Workflow

 

Click Submit

 

 

Notice the Workflow Steps Displayed on the Right Side of the Screen

 

 

 

Return to Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder, Locate and VCO Test User

 

 

 

Validate VCO Test user is now disabled

 

Notice the DOWN ARROW located on the User icon for VCO Test user

 

 

Destroy a User with the vCO Plug-in



 

Launch Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder, Locate VCO Test User

 

Confirm existence of VCO Test user

 

 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Start a Workflow Button

 

 

 

 

Type Destroy in Choose a workflow to run Window

 

Highlight the Destroy a User Workflow from the results list, Click Select

 

 

Select User in which to destroy

 

Click Not set

 

 

Using the AD Window, Filter Out until you Select VCO Test

 

Scroll down to find VCO Test user,

Highlight the VCO Test user from the results list, Click Select

 

 

Validate Selections and Click Submit to Proceed with Workflow

 

Click Submit

 

 

Notice the Workflow Steps Displayed on the Right Side of the Screen

 

*** The error message is ok... this lab features beta code! ***

 

 

Return to Active Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Users Folder

 

 

 

Validate VCO Test user is now destroyed

 

Scroll to the end of the user list to confirm theVCO Test user is destroyed

 

Create Computer Object with the vCO Plug-in



 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Workflow Icon

 

 

 

 

Expand the Workflow Hierarchy

 

Click the arrow next to the following folders until the Active Directory Folder appears

 

 

Expand the Computer Folder, Right click on 'Create a computer in a group" and select Start workflow

 

 

 

Select parent group for the new computer by clicking 'Not set'

 

 

 

Press enter to bring up all the active directory groups

 

 

 

Highlight Computers and Click Select

 

 

 

Enter a name for the new Computer

 

Enter: VCOrocks

Click submit

 

 

Notice the Workflow Steps Displayed on the Right Side of the Screen

 

 

 

Launch Activer Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Computers folder and notice VCOrocks Computer is Displayed

 

 

Destroy Computer Object with the vCO Plug-in



 

Launch the vCenter Orchestrator Client

 

From the Control Center Desktop, Double-Click the vCenter Orchestrator Client icon.

 

 

Login to vCenter Orchestrator Client

 

Type in the follow fields into the vCO Client Login Screen:

Hostname: vcac-w8-01a

Username: vcoadmin

Password: vcoadmin

 

 

Login to vCenter Orchestrator Client

 

Click Login.

 

 

Click the Workflow Icon

 

 

 

 

Expand the Workflow Hierarchy

 

Click the arrow next to the following folders until the Active Directory Folder appears

 

 

Expand the Computer Folder, Right click on 'Destroy a computer" and select Start workflow

 

 

 

Select parent group for the new computer by clicking 'Not set'

 

 

 

Type VCOrocks to display the VCOrocks Computer Object

 

 

 

Highlight VCOrocks Computer Object and Click Select

 

 

 

Confirm Computer to destroy is VCOrocks and Click Submit

 

 

 

 

Notice the Workflow Steps Displayed on the Right Side of the Screen

 

 

 

Launch Activer Directory Users and Computers

 

 

 

 

In Active Directory User and Computers, Select the Computers folder and notice VCOrocks Computer is Destroyed

 

 

Conclusion

Thank you for participating in the VMware Hands-on Labs. Be sure to visit http://hol.vmware.com/ to continue your lab experience online.

Lab SKU: HOL-SDC-1307

Version: 20140321-160905