I have a PowerCli script to move guests to another datastore. After moving some guests, the script will loose the connection after approx. 10 minutes to the vcenter. Surely, moving lasts just a few minutes - additionaly I have to restart the powershell Session after the break and to change the .csv file. Any ideas solving this lousy problem are welcome 😉
Snippets:
Function Main {
Get-Module -Name VMware* -ListAvailable | Import-Module
Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 1800 -Confirm:$false
$vms = Import-Csv \\verein\sys\admin\PScript\VMware\VCenter01\MoveDatastore.csv -UseCulture
Connect-VIServer vCenter01
foreach ($VM in $VMs) {
Move-VM -VM $VM -Datastore $($VM.NewStore) -DiskStorageFormat 'Thick'
}
}
Great news. Thanks for the effort to get this information. I will test it this week on our 8.x instances and report back 🙂
This solved it for me. No more object reference not found after a reboot of a host when executing an maintenance script.
Thanks!
Also confirmed as solved. thank you