On the vmware side you'd need something to talk to the UPS to report the upstream power status, and something to start/stop the virtual machines depending on the power status.
Since vmware mostly uses SuSE and Photon OS the software would need to be compatible with that and installed on the host (so not on a guest). Such custom work is error-prone and not supported and likely to break when applying vmware patches. As for what it needs to do, it's mostly just glue logic between standard components, shell scripts or python or javascript could do this.
1. Set VMs to not auto-start when the hypervisor is booted
2. Use a cronjob to launch a script that uses either apcupsd or nut to talk to the UPS
3. Ask the UPS if upstream power is on or off, if off, stop the virtual machines and shut down the hypervisor when power down is complete, tell UPS to go silent, if on, check if the virtual machines are running and if not, power them up; check if UPS alarms are silenced if they are, turn then back on
3. Either a mains-powered pulse relay or a mainboard that is capable of USB-based power-on. In case of the relay, put the pulse output on the on/off pins on the mainboard and only set it to pulse when the power is switched on
What happens when everything is off and the generator is started: pulse is sent to the mainboard, system powers on, cronjob starts running, VMs get powered on.
What happens when everything is on and the generator is turned off: UPS notices power is missing, starts beeping, cronjob asks the UPS, UPS says power is missing and is beeping, VMs are powered down, alarms are silenced, hypervisor is powered down.
You can make all of this more smarter with more work. For example, you could add a stand-alone power management system that is directly attached to all devices and has its own battery. It can turn all devices on or off as desired, communicate over the network to do it gracefully as well. Such a device could be an SBC like a Pi with a UPS HAT.