foreach ($esxi in (Get-VMHost vsp50esx01*,vsp50esx03*)) {($esxi|Get-EsxCli).storage.vmfs.snapshot.list()|%{($esxi|Get-EsxCli).storage.vmfs.snapshot.mount($false,$_.VolumeName,$null)}} Get-ResourcePool SITE_0|Get-VM|Shutdown-VMGuest -Confirm:$false Get-ResourcePool SITE_0|Get-VM|Move-VM -Destination vsp50esx01* -Confirm:$false Get-VMHost vsp50esx01*|Set-VMHost -State Maintenance -Confirm:$false Get-VMHost vsp50esx01*|Get-VM|?{$_.PowerState -eq "PoweredOn"}|Move-VM -Destination vsp50esx03* -Confirm:$false Get-VMHost vsp50esx01*|Set-VMHost -State Disconnected -Confirm:$false foreach ($esxi in (Get-VMHost vsp50esx03*|Get-View|%{Get-View $_.ConfigManager.StorageSystem})) {$esxi.FileSystemVolumeInfo.mountinfo|?{$_.volume.ForceMountedInfo}|%{(Get-View (Get-View ServiceInstance).Content.StorageResourceManager).ConfigureDatastoreIORM_Task((Get-Datastore $_.Volume.name|Get-View).Moref,(New-Object VMware.Vim.StorageIORMConfigSpec -Property @{enabled=$false}))}} foreach ($esxi in (Get-VMHost vsp50esx03*|Get-View|%{Get-View $_.ConfigManager.StorageSystem})) {$esxi.FileSystemVolumeInfo.mountinfo|?{$_.volume.ForceMountedInfo}|%{$esxi.UnmountForceMountedVmfsVolume($_.volume.uuid)}} Get-ResourcePool SITE_0|Get-VM|?{$_.PowerState -ne "PoweredOn"}|Get-View|%{(Get-Datacenter dc0.dc1|Get-View).PowerOnMultiVM_Task($_.moref, $null)} Get-VMHost vsp50esx01*|Set-VMHost -State Connected -Confirm:$false #foreach ($esxi in (Get-VMHost vsp50esx01*|Get-View|%{Get-View $_.ConfigManager.StorageSystem})) {$esxi.FileSystemVolumeInfo.mountinfo|?{$_.volume.ForceMountedInfo}|%{$esxi.UnmountForceMountedVmfsVolume($_.volume.uuid)}} Get-VMHost vsp50esx01*|Set-VMHost -State Connected -Confirm:$false