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 )
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 virt/libvirt/ guest.py virt/libvirt/ guest.py configuration( self):
"""Undefines a domain from hypervisor.""" undefineFlags( VIR_DOMAIN_ UNDEFINE_ MANAGED_ SAVE) XMLDesc( ): undefineFlags( VIR_DOMAIN_ UNDEFINE_ NVRAM | VIR_DOMAIN_ UNDEFINE_ MANAGED_ SAVE) undefineFlags( VIR_DOMAIN_ UNDEFINE_ MANAGED_ SAVE) libvirtError:
LOG. debug(" Error from libvirt during undefineFlags. %d"
"Retrying with undefine", self.id)
index 263f873..1df0476 100644
--- a/nova/
+++ b/nova/
@@ -199,8 +199,13 @@ class Guest(object):
def delete_
try:
- self._domain.
- libvirt.
+ if '<nvram template=' in self._domain.
+ self._domain.
+ libvirt.
+ libvirt.
+ else:
+ self._domain.
+ libvirt.
except libvirt.
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 /download. clearlinux. org/releases/ 7310/clear/ source/ SRPMS/nova- 12.0.2- 133.src. rpm | cpio -divm UEFI-boot- for-kvm- and-qemu. patch )
( you could extract the files by running
$ rpm2cpio https:/
and then take a look at the 0006-Enable-