Comment 14 for bug 1567807

Revision history for this message
Marcos Simental (mrkzmrkz) wrote :

Hello Ching,
The workaround we did for Clear Linux about this was something like:

diff --git a/nova/virt/libvirt/guest.py b/nova/virt/libvirt/guest.py
index 263f873..1df0476 100644
--- a/nova/virt/libvirt/guest.py
+++ b/nova/virt/libvirt/guest.py
@@ -199,8 +199,13 @@ class Guest(object):
     def delete_configuration(self):
         """Undefines a domain from hypervisor."""
         try:
- self._domain.undefineFlags(
- libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE)
+ if '<nvram template=' in self._domain.XMLDesc():
+ self._domain.undefineFlags(
+ libvirt.VIR_DOMAIN_UNDEFINE_NVRAM |
+ libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE)
+ else:
+ self._domain.undefineFlags(
+ libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE)
         except libvirt.libvirtError:
             LOG.debug("Error from libvirt during undefineFlags. %d"
                       "Retrying with undefine", self.id)

That way the `VIR_DOMAIN_UNDEFINE_NVRAM` flag will be called only if the instance was booted using uefi (NVRAM)

As you can check in our nova src.rpm in https://download.clearlinux.org/releases/7310/clear/source/SRPMS/nova-12.0.2-133.src.rpm
( you could extract the files by running
$ rpm2cpio https://download.clearlinux.org/releases/7310/clear/source/SRPMS/nova-12.0.2-133.src.rpm | cpio -divm
and then take a look at the 0006-Enable-UEFI-boot-for-kvm-and-qemu.patch )