Fairly new to Powershell and CLi but not to scripting - is it possible to script HA so that it restarts VMs on specific hosts? Unfortunately the cost of 10 Enterprise ESXi 5.x licenses is prohibitive just for DRS and Accessibility Control won't do what we want. I really want the affinity and anti-affinity rules. Really, Really badly!
Everything is possible in PowerCLI :smileygrin:
For a simple simulation of affinity/anti-affinity rules, you should do all start/stop of VMs through a script.
In that script you can test on which ESXi a VM can be started, talking into account the rules you would have in a file somewhere.
A tentative start VM logic
That should be quite simple to code in PowerCLI.
But remember that this is a very crude simulation fo what HA offers.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc. It's just the migration to other hosts I'm looking at not restarting the VM on it's normally homed host. Don't really have lots of time but I'll have a play with it and see how it goes. Can't do the resource checking either.
I with they'd put DRS on the Standard license.
Ok, I see.
In that case you could still use the external file with the rules, and then eventually use the Move-VM cmdlet to vMotion the VM to the correct ESXi host.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference