mthiha207au
Contributor
Contributor

Set-VMHost Maintenance Mode including Powered-off VMs

Jump to solution

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

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

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
Contributor
Contributor

Thanks LucD. I missed that switch.

I can confirm -Evacuate works. 

 

 

0 Kudos