Is there any way to detect (and fire off a script) when a guest starts to vmotion?
We have an Exchange DAG, and a couple of times in the past month DRS has started a vMotion on them both at the same time, and as a result we've had issues with Exchange. Is there any way to detect when a vMotion starts, so that I can fire a script off to lock the other guest to it's current host until the vmotion has completed?
I've looked through the alarms in vCenter, and I can't find anything there that would trigger when a vMotion starts or completes.
You can define an alarm based on a specific event that is fired.
See my Alarm expressions – Part 2 : Event alarms post.
I would look at the VmBeingMigratedEvent and the VmBeingRelocatedEvent events to start with.
With Get-VIEvent you should be able to check which events are fired in the situation where VMs are being migrated
Unrelated to the powercli question, but why don't you set your DAG's to manual or partially automated for their DRS setting to keep them from migrating? From what I understand exchange has built in HA for the application.