VMware Cloud Community
mikeanderson173
Enthusiast
Enthusiast

Set snapshot and recompose a VDI pool using VMware Horizon PowerCLI

Hello,

We have Horizon 7.7 installed and am currently running a powershell script while RDP'd to a connection manager where we set the snapshot of a specific linked clone floating pool and then recompose it using the following methods:

- Update-AutomaticLinkedClonePool

- Get-Pool

- Get-DesktopVM

- Send-LinkedCloneRecompose

These only work on the connection managers and I'm trying to perform these same operations from my desktop leveraging the VMware.Hv.Helper module. This seems like it should be a pretty straightforward task, but I cannot seem to complete it successfully. A couple of things... I am setting the desktop pool, parent VM and snapshot name through other means in the script, so I do not need to get run queries to get those as I will already know the names. An example of the below code we are running is below:

Update-AutomaticLinkedClonePool -Pool_ID $PoolID -ParentSnapshotPath "/$Snapshot"

Get-Pool -Pool_ID $PoolID | Get-DesktopVM | Send-LinkedCloneRecompose -Schedule (Get-Date) -ParentVMPath $ParentVMPath/$ParentVM "/$Snapshot" -ForceLogoff $false

Any help would be much appreciated.

Thanks!

0 Kudos
1 Reply
LucD
Leadership
Leadership

Afaik this functionality is not yet incorporated in the VMware.HV.Helper module.

You would have to write the functionality yourself, using the View API, just like the VMware.HV.Helper module is doing.

Not sure why you are using a RDP session.
You could use a Remote PS session from your station to the Connection Server.
Unless that is not allowed by Security


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos