Server Event Hook Examples
Mitigating a Libvirt Bug
RHEL introduced a UEFI bug in one of their Libvirt builds. We can use a hooks to fix this issue.
Hook Filename: server-before-boot_php_0001_fix-rhel-libvirt.event
Hook Contents:
<?php
function event($data)
{
    if (!property_exists($data, 'uuid')) return;
    if ($data->settings->uefi) {
        if (!file_exists('/home/vf-data/server/' . $data->uuid . '/OVMF_VARS.fd')) {
            copy('/home/vf-data/lib/uefi/ovmf/OVMF_VARS.fd', '/home/vf-data/server/' . $data->uuid . '/OVMF_VARS.fd');
        }
    }
}