VMware Cloud Community
TryllZ
Expert
Expert
Jump to solution

Deselecting Move powered-off VMs in vSAN with PowerCLI..

Hi All,

I have a vSAN Cluster which I need to shutdown, I have the following code which I have tested. The below code works fine if I manually deselect the checkbox "Move powered-off and suspended Vvirtual machines to other hosts in the clutster"

Spoiler
Get-Datacenter | Get-Cluster -Name vSAN_Cluster | Get-VMHost -Name HostName | Set-VMHost -State Maintenance -VsanDataMigrationMode NoDataMigration

vSAN.png

I could not find how to deselect this checkbox using PowerCLI, anyone knows how can I deselect this with PowerCLI.

Thank You

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you try with the -Evacuate:$false switch on the Set-VMHost cmdlet?


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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Did you try with the -Evacuate:$false switch on the Set-VMHost cmdlet?


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

0 Kudos
TryllZ
Expert
Expert
Jump to solution

No I haven't as I could not find it anywhere, but I will try it tomorrow.

Thanks @LucD

0 Kudos
TryllZ
Expert
Expert
Jump to solution

Thanks @LucD that worked perfectly.

Tags (1)
0 Kudos