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.
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>
- In the parentVMPath parameter, we should pass the path to the Virtual Machine (VM) from which we wish to create the pool.
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
The vmFolderPath parameter refers to the path where the VMs (created for the pool) are to be stored.
- In the resourcePoolPath parameter, we specify the path to the resource pool.
This path will be:
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)
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.
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.