VMware Cloud Community
sayaho
VMware Employee
VMware Employee

Rebuild a virtual machine in a full-clone desktop pool

I'd like to know if it is possible to create a script with PowerCLI to rebuild a virtual machine in a full-clone desktop pool, as in the following document:
https://docs.vmware.com/en/VMware-Horizon-7/7.13/horizon-virtual-desktops/GUID-7B6737E8-DD82-482F-BF...

Thanks.

Reply
0 Kudos
4 Replies
Magneet
Hot Shot
Hot Shot

That is certainly possible, first perform a query to get the machine or machine's that you need to rebuild and after that use the machine.machine(rebuild(machineid) api method

https://vdc-download.vmware.com/vmwb-repository/dcr-public/a2b06b81-997f-45cb-a52c-39c44f7a819e/010b...

f there are more machines use machine.machine_rebuildmachines([machineids]) make sure it's an array if the machineid's only.

https://vdc-download.vmware.com/vmwb-repository/dcr-public/a2b06b81-997f-45cb-a52c-39c44f7a819e/010b...

to build the query use this on how to build it:

https://www.retouw.nl/2018/10/19/horizon-view-apis-back-to-basics-part-2-queries/

and for the

after that use either of the methods to rebuild the machine(s)

sayaho
VMware Employee
VMware Employee

Thank you very much. I have learned a lot from the sites you have provided.
Is it possible to use Hv.Helper to implement the Horizon View API in an environment where it is not subscribed?

Reply
0 Kudos
Magneet
Hot Shot
Hot Shot

you can copy the vmware.hv.helper to any machine that has powercli installed and use it. 

Reply
0 Kudos
sayaho
VMware Employee
VMware Employee

Thank you. I'll try it.

Reply
0 Kudos