On the hypervisor so it can directly backup the LVs, zvols or whatever block devices your VMs are using.
Not sure about the script. But I guess something like iterate through all VMs, stop them so all caches are flushed and block devices not in use. Then find out all blockdevices that VM is using, do a backup of those block devices to the PBS and start the VM again in case it was shutdown for the backup.