VMware Cloud Community
mthiha207au
Enthusiast
Enthusiast
Jump to solution

Set-VMHost Maintenance Mode including Powered-off VMs

Hi,

Set-VMHost -VMHost $vmhost -State "Maintenance" 

Above command doesnt move powered off vms , although its default behaviour in vSphere UI while placing Maintenance Mode (ticked checked box using UI). Is there any parameter that we can set in set-vmhost command to achieve this?

regards,

Max

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

While the EnterMaintenanceMode method will work, did you already try using the Evacuate switch on the Set-VMHost cmdlet?

Set-VMHost $vmhost -State Maintenance -Evacuate


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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

While the EnterMaintenanceMode method will work, did you already try using the Evacuate switch on the Set-VMHost cmdlet?

Set-VMHost $vmhost -State Maintenance -Evacuate


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

0 Kudos
mthiha207au
Enthusiast
Enthusiast
Jump to solution

Thanks LucD. I missed that switch.

I can confirm -Evacuate works. 

 

 

0 Kudos