Place a VSAN Witness host into maintenance through PowerCLI
The PowerCLI documentation is actually really good, but sometimes the documentation is just silly aswell. I was trying to make a vSAN Witness host go into Maintenance Mode through PowerCLI and had trouble doing it.
The Set-VMHost command has some parameters you can set for VSAN Data Migration and stuff like that, so i thought maybe it wanted to do something with vSAN even though the GUI is the normal Maintenance Mode dialog box.
When I tried using the Set-VMHost command i got the error A specified parameter was not correct:
I went into my LogInsight installation and tried to find the error, and sure enough PowerCLI tries to evacuateAllData, see below:
What fixed it for me was using the -VsanDataMigrationMode parameter with “NoDataMigration”.
So the full command for me was: Get-VMHost vsanwitness01.mylab.local | -State Maintenance -VsanDataMigrationMode NoDataMigration