Hi Folks - amateur scripter here -
I created a simple script to evacuate our hosts licensed with standard licensing without DRS capability.
After connecting to vCenter, it is as follows:
This script works to move all VMs, even powered off, to other hosts in the cluster after typing in the cluster and host to evacuate.
Oddly, for every VM that resides on the host the following error is generated:
Can someone shed light on why I am seeing this error despite the script working? Also, is it possible to change the $VM parameter to only include powered on VMs?
Thanks
Could it be that you have more than 1 vCenter connection open?
Check what it says in $global:defaultVIServers
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Could it be that you have more than 1 vCenter connection open?
Check what it says in $global:defaultVIServers
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Apparently that was it, I don't recall trying to connect to any other VCenter. I am forced to re-authenticate each time i connect even when I don't disconnect but that I believe has to do with the appliance - https://kb.vmware.com/s/article/2050701.
I added in the code I need to only migrate powered on VMs.