Clearpath Insights: Managed Services | Cloud Services | IT Solutions

Deploying Linked-Clone Desktop Pools Using PowerCLI

Deploying pools can be done using the VMware View Administrator. The Add Pool wizard in the Administrator takes us through a series of steps which include user assignment, pool Identification, provisioning settings, advanced storage options etc. (refer to the figure below). In this article we will learn a different approach to deploying pools - using a powerCLI cmdlet.

Contact Clearpath's VMware Licensing and Professional Services Team

deploy pools using powerCLI cmdlet resized 600

In order to do deploy pools using powerCLI cmdlets, we will make use of the Add-AutomaticLinkedClonePool cmdlet.
The general syntax for the Add-AutomaticLinkedClonePool is:

Add-AutomaticLinkedClonePool -pool_id poolID -namePrefix pad
-parentVMPath /<datacenter>/vm/<parentVM> -parentSnapshotPath /<Snapshot>
-vmFolderPath /<datacenter>/vm -resourcePoolPath /<datacenter>/host/<ESX>/Resources
-dataStoreSpecs /<datacenter>/host/<ESX>/<datastore> -composer_ad_id <composer ad id>
This cmdlet must be run on view broker. However, we must first connect to the View Connection Server (VCS) using the following cmdlet:Get-ViewVC -serverName <IP/Name of the VCS>The parameters of the Add-AutomaticLinkedClonePool cmdlet can be confusing to new powerCLI users. Therefore, let us try and understand what each parameter of the Add-AutomaticLinkedClonePool cmdlet requires.
  • In the parentVMPath parameter, we should pass the path to the Virtual Machine (VM) from which we wish to create the pool.
The path should be of the following format:/<the name of your data center>/vm/<the VM which you wish to base your pool off>Note: The folder 'vm' is a hidden folder that holds the VMs and Templates hierarchy.
If the VM is within another folder, we should specify those folders in this path.
e.g: if the VM is in Folder1, we specify the path as/<the name of your data center>/vm/Folder1/<the VM which you wish to base your pool off>
  • The parentSnapshotPath refers to the path of the snapshot from which we wish to clone to the pool. We can specify this as
-parentSnapshotPath "/<the name of the snapshot>"(In another post, I will share how to create a snapshot from a VM using a powerCLI cmdlet)
  • The vmFolderPath parameter refers to the path where the VMs (created for the pool) are to be stored.

e.g.: /<the name of your data center>/vm/<name of the folder where you wish to store the created vm>
  • In the resourcePoolPath parameter, we specify the path to the resource pool.
    This path will be:
/<the name of your data center>/host/<the name of your cluster>/Resources/<your resource pool>Note: Like the 'vm' folder from above, the host and Resources folders are hidden too.
  • In the datastoreSpecs parameter, we specify the path to a data store in a cluster (same as the one specified in the resource pool path)

e.g. /<the name of your data center>/host/<the name of your cluster>/<name of the data store you wish to use>
  • The composer_ad_id can be obtained by using the following powerCLI cmdlet (separately) and then using the value obtained, in our Add-AutomaticLinkedClonePool:

Get-ComposerDomain | select composer_ad_idThe –namePrefix parameter is the equivalent to the naming pattern in the VMWare View Administrator (refer to the figure below). By default, it appends a unique number to the specified pattern to provide a unique name for each virtual machine.
e.g. vm-{n:fixed=2}

provisioning settings unique name each pool resized 600

Additional Parameters:We can specify some additional parameters for creating the linked clone pool. These include –minimumCount -maximumCount and –displayName (name of the pool) Note: If we provision the desktops ahead of their use, we should set -minimumCount and -maximumCount to the same value.Thus, we have learned the Add-AutomaticLinkedClonePool cmdlet and what each of its parameters expects.In the next post, we will learn how to create a snapshot from a VM using a powerCLI cmdlet within a C# program.

cta-engineers-customize

Our engineers customize
IT solutions for your business

The best hardware, software and cloud computing solutions are nothing without expert design and implementation.

Our team becomes your team. We take the time to understand your business needs first, and tailor high performance systems specifically for you.

Learn more
Live Chat Support Software