HI,
I am trying to use powerCLI to create automatic pool (linked clone). I came across the following cmdlet in theVMware powershell integration white paper:
Get-ViewVC -serverName <IP/FQDN> | Add-AutomaticLinkedClonePool -pool_id
TestAutomaticLinkedClonePool -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>
Now, I want help with finding out (with an example will be very helpful) how do you specify and how do you locate each of the following (like what should i put after each of these):
-parentVMPath
-parentSnapshotPath
-vmFolderPath
-resourcePoolPath
-dataStoreSpecs
-composer_ad_id
Please give an example of each if possible.
Thanks!
Ok, I'll give it a try.
The parentVMPath parameter expects the path to the VM from which you want to spawn the pool (obviously).
Such a path looks something like this: /MyDC/vm/MyVM
Where MyDC is the datacentername, the vm folder is the hidden folder that holds the VMs and Templates hierachy and finally the name of the VM itself.
If your master VM is deeper in the folder structure, just add the folders to the path.
Ex: /MyDC/vm/Folder1/Folder2/MyVM
The parentSnapshotPath is similar to the previous parameter, but obviously should point to the snapshot from which the pool should clone.
Alan has a nice function to retrieve the snapshotpath in Update and re-composure of View Pools.
The vmFolderPath is where the VMs that are created for the pool should be stored.
Again similar to the previous parameters, but now for the folder.
Ex: /MyDC/vm/PoolFolder
resourcePoolPath should point to a resourcepool.
Such a path will look something like this: /MyDC/host/MyCluster/Resources/MyResourcePool
Note that host and Resources are again hidden folders !
datastoreSpecs: this one is not the most obvious one.
It wants the full path to a datastore in a cluster as specified by a resource pool.
See the VVGetDatastorePath function presented in Determining Paths to vSphere Datastore Objects
The composer_ad_id wants the ID of the AD domain in which the composer is a member server.
You can get this through: Get-ComposerDomain | select composer_ad_id
As a side note, have a look at the PowerShell Integration with View 5.0 white paper. It's perhaps not intended for the latest View version,
but it explains some of the parameters a lot better than I could :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, I'll give it a try.
The parentVMPath parameter expects the path to the VM from which you want to spawn the pool (obviously).
Such a path looks something like this: /MyDC/vm/MyVM
Where MyDC is the datacentername, the vm folder is the hidden folder that holds the VMs and Templates hierachy and finally the name of the VM itself.
If your master VM is deeper in the folder structure, just add the folders to the path.
Ex: /MyDC/vm/Folder1/Folder2/MyVM
The parentSnapshotPath is similar to the previous parameter, but obviously should point to the snapshot from which the pool should clone.
Alan has a nice function to retrieve the snapshotpath in Update and re-composure of View Pools.
The vmFolderPath is where the VMs that are created for the pool should be stored.
Again similar to the previous parameters, but now for the folder.
Ex: /MyDC/vm/PoolFolder
resourcePoolPath should point to a resourcepool.
Such a path will look something like this: /MyDC/host/MyCluster/Resources/MyResourcePool
Note that host and Resources are again hidden folders !
datastoreSpecs: this one is not the most obvious one.
It wants the full path to a datastore in a cluster as specified by a resource pool.
See the VVGetDatastorePath function presented in Determining Paths to vSphere Datastore Objects
The composer_ad_id wants the ID of the AD domain in which the composer is a member server.
You can get this through: Get-ComposerDomain | select composer_ad_id
As a side note, have a look at the PowerShell Integration with View 5.0 white paper. It's perhaps not intended for the latest View version,
but it explains some of the parameters a lot better than I could :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Immensely Helpful. Thanks a lot!!
Hey,
if i was to write a function to which i pass 3 strings, and then use these as my pool_id, what would be the syntax?
for e.g. if i passed it (number 1, word, number 2)
and then i want these to be used as my pool id (-pool_id "number1_word_number2"),
what should be the syntax?
Thanks
Ok, assume the parameter of your function looks like this
param([int]$arg1,[string]$arg2,[int]$arg3)
then you could create a string with the pool_id as follows
$poolId = [string]$arg1 + "_" + $arg2 + "_" + [int]$arg3
and use it as
... -pool_id $poolId...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
awesome!! thanks