Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Failed to delete shutoff vm if 'firmware=efi' to uefi guest xml via virt-manager
Version-Release number of selected component (if applicable):
virt-manager-2.2.1-3.el8.noarch
virt-install-2.2.1-3.el8.noarch
qemu-kvm-4.2.0-32.module+el8.3.0+7629+c86ce105.x86_64
libvirt-6.0.0-27.module+el8.3.0+7602+4b93512e.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Prepare a uefi vm with below xml and firmware shows 'UEFI x86_64: /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd' in virt-manager
# virsh dumpxml rhel8.2-efi
....
<os>
<type arch="x86_64" machine="pc-q35-rhel8.2.0">hvm</type>
<loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/rhel8.2-efi_VARS.fd</nvram>
<boot dev="hd"/>
</os>
....
2. Power off vm and add "firmware='efi'" to vm's xml, check vm xml file
# virsh dumpxml rhel8.2-efi --inactive |grep firmware -A 5
<os firmware="efi">
<type arch="x86_64" machine="pc-q35-rhel8.2.0">hvm</type>
<boot dev="hd"/>
</os>
3. Power on vm to ensure the vm can boot up successfully.
Result: vm can start successfully
4. Power off vm again and delete it via virt-manager
Error deleting virtual machine 'rhel8.2-efi': Requested operation is not valid: cannot undefine domain with nvram
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1303, in delete
self._backend.undefineFlags(flags)
File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2924, in undefineFlags
if ret == -1: raise libvirtError ('virDomainUndefineFlags() failed', dom=self)
libvirt.libvirtError: Requested operation is not valid: cannot undefine domain with nvram
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/delete.py", line 191, in _async_delete
vm.delete()
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
ret = fn(self, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1307, in delete
self._backend.undefine()
File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2888, in undefine
if ret == -1: raise libvirtError ('virDomainUndefine() failed', dom=self)
libvirt.libvirtError: Requested operation is not valid: cannot undefine domain with nvram
Additionally, there were errors removing certain storage devices:
Actual results:
As described.
Expected results:
Fix it.
Additional info:
The VM can be deleted by # virsh undefine $vm --nvram command, thanks.
I can reproduce this issue with package:
virt-install-2.2.1-3.el8.noarch
virt-manager-common-2.2.1-3.el8.noarch
Steps as Comment 0.
Then try to verify this bug with new build:
virt-manager-common-2.2.1-4.el8.noarch
virt-install-2.2.1-4.el8.noarch
libvirt-6.0.0-30.module+el8.4.0+8705+34397d87.x86_64
qemu-kvm-4.2.0-37.module+el8.4.0+8837+c89bcfe6.x86_64
kernel-4.18.0-249.el8.x86_64
Steps:
1. Prepare a uefi vm with below xml and firmware shows 'UEFI x86_64: /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd' in virt-manager
# virsh dumpxml rhel8.3
....
<os>
<type arch='x86_64' machine='pc-q35-rhel8.2.0'>hvm</type>
<loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/rhel8.3_VARS.fd</nvram>
<boot dev='hd'/>
</os>
....
2. Power off vm and add "firmware='efi'" to vm's xml, check vm's xml file
# virsh dumpxml rhel8.2-efi --inactive |grep firmware -A 5
<os firmware="efi">
<type arch="x86_64" machine="pc-q35-rhel8.2.0">hvm</type>
<boot dev="hd"/>
</os>
3. Power on vm to ensure the vm can boot up successfully.
Result: vm can start successfully
4. Power off vm again and delete it via virt-manager
Result: Vm can be deleted successfully.
5. Restart vm again and delete it via virt-manager when it's running.
Result: Vm can be deleted successfully.
So I move this bug from ON_QA to VERIFIED status based on above testing.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (virt-manager bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2021:1843
Description of problem: Failed to delete shutoff vm if 'firmware=efi' to uefi guest xml via virt-manager Version-Release number of selected component (if applicable): virt-manager-2.2.1-3.el8.noarch virt-install-2.2.1-3.el8.noarch qemu-kvm-4.2.0-32.module+el8.3.0+7629+c86ce105.x86_64 libvirt-6.0.0-27.module+el8.3.0+7602+4b93512e.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a uefi vm with below xml and firmware shows 'UEFI x86_64: /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd' in virt-manager # virsh dumpxml rhel8.2-efi .... <os> <type arch="x86_64" machine="pc-q35-rhel8.2.0">hvm</type> <loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/rhel8.2-efi_VARS.fd</nvram> <boot dev="hd"/> </os> .... 2. Power off vm and add "firmware='efi'" to vm's xml, check vm xml file # virsh dumpxml rhel8.2-efi --inactive |grep firmware -A 5 <os firmware="efi"> <type arch="x86_64" machine="pc-q35-rhel8.2.0">hvm</type> <boot dev="hd"/> </os> 3. Power on vm to ensure the vm can boot up successfully. Result: vm can start successfully 4. Power off vm again and delete it via virt-manager Error deleting virtual machine 'rhel8.2-efi': Requested operation is not valid: cannot undefine domain with nvram Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/object/domain.py", line 1303, in delete self._backend.undefineFlags(flags) File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2924, in undefineFlags if ret == -1: raise libvirtError ('virDomainUndefineFlags() failed', dom=self) libvirt.libvirtError: Requested operation is not valid: cannot undefine domain with nvram During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/delete.py", line 191, in _async_delete vm.delete() File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn ret = fn(self, *args, **kwargs) File "/usr/share/virt-manager/virtManager/object/domain.py", line 1307, in delete self._backend.undefine() File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2888, in undefine if ret == -1: raise libvirtError ('virDomainUndefine() failed', dom=self) libvirt.libvirtError: Requested operation is not valid: cannot undefine domain with nvram Additionally, there were errors removing certain storage devices: Actual results: As described. Expected results: Fix it. Additional info: The VM can be deleted by # virsh undefine $vm --nvram command, thanks.