-
1. Re: Looking for a script to remove VMs (Not delete)
jrodsguitar Apr 5, 2018 10:04 PM (in response to Lyghtnin)Please explain what you want to do. You don’t want to delete a Vm from Horizon but you want to remove it. Does that mean you still want to keep the VM but remove it from being managed by Horizon?
-
2. Re: Looking for a script to remove VMs (Not delete)
Lyghtnin Apr 6, 2018 7:55 AM (in response to jrodsguitar)That's exactly what I need.
Horizon View Management Console is just managing the desktops IN vCenter. I want to remove the desktop from the Horizon View pool in the management console but not delete it from vCenter.
Reason - Users have a full clone and when they leave the company we want to be able to retain the desktop for 45 days in vCenter (powered off) but not have it listed in the Horizon View Pool any longer. We currently have it automated to mark custom attributes in the VM and power it off and moved to a specific folder in vCenter, we just need to be able to remove it from Horizon with an automated process/script to complete the task. (We do not have vRO/vRA).
Thanks for the reply!
-
3. Re: Looking for a script to remove VMs (Not delete)
jrodsguitar Apr 7, 2018 2:55 PM (in response to Lyghtnin)I think one way to do this is to:
- Clone existing VM to new VM
- Remove / Delete original VM from Horizon
- Remove Horizon Agent from new cloned VM.
Since you are already using automation, you could probably incorporate some of the code from my remove-HVMachine function to accomplish step 2.
So ironically you will end up deleting VM. At least the original
https://get-cj.com/2018/04/07/delete-vmware-horizon-machine-using-powercli-horizon-api/
It's very straight forward to use:
remove-HVMachine -cred $cred -viewserver $viewserver -machine $machine
-
4. Re: Looking for a script to remove VMs (Not delete)
butlpau02 Jul 9, 2019 1:31 AM (in response to Lyghtnin)Hey,
How are your desktops provisioned? Manual, Linked Clones etc?
Have you looked at ADSIEDIT to do this - depending on how desktops are provisioned, you may have to change Pool sizes etc so they are not recreated etc....
Cheers,
Paul.