Yes you can script via Perl from APC UPS's to trigger the hypervisor to shutdown / suspend VM's. See my picture above, this is the same feature as Hyper-V. That is a screengrab from an ESXi box.
Script wise it's probably best to head over to the VMware forums and ask. I grabbed mine from there IIRC.