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.
DescriptionBenjamin Schmaus
2021-11-02 18:15:31 UTC
Description of problem:
libvirt fails to undefine a guest that has 'nvram' XML element with
[root@master-0 openshift-aio]# virsh list --all
Id Name State
-------------------------------
- ocp4-bastion shut off
- ocp4-master1 shut off
- ocp4-master2 shut off
- ocp4-master3 shut off
[root@master-0 openshift-aio]# virsh undefine ocp4-bastion
error: Failed to undefine domain 'ocp4-bastion'
error: Requested operation is not valid: cannot undefine domain with nvram
Version-Release number of selected component (if applicable):
[root@master-0 openshift-aio]# uname -r; rpm -q libvirt-daemon-kvm libvirt libvirt-client
4.18.0-305.19.1.el8_4.aarch64
libvirt-daemon-kvm-7.0.0-14.1.el8.aarch64
libvirt-7.0.0-14.1.el8.aarch64
libvirt-client-7.0.0-14.1.el8.aarch64
How reproducible:
100%
Steps to Reproduce:
1.Have a guest (AArch64 in this case) with 'nvram' XML element:
[root@master-0 openshift-aio]# virsh dumpxml ocp4-bastion
<domain type='kvm'>
<name>ocp4-bastion</name>
<uuid>2b6d9b4d-be35-435e-b23f-49b1149dea29</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://redhat.com/rhel/8.1"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>
<vcpu placement='static'>8</vcpu>
<os>
<type arch='aarch64' machine='virt-rhel8.4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
<nvram>/var/lib/libvirt/qemu/nvram/ocp4-bastion_VARS.fd</nvram>
<boot dev='hd'/>
</os>
2. [root@master-0 openshift-aio]# virsh undefine ocp4-bastion
error: Failed to undefine domain 'ocp4-bastion'
error: Requested operation is not valid: cannot undefine domain with nvram
Actual results:
[root@master-0 openshift-aio]# virsh undefine ocp4-bastion
error: Failed to undefine domain 'ocp4-bastion'
error: Requested operation is not valid: cannot undefine domain with nvram
Expected results:
It should be possible to undefine the libvirt guest with 'nvram' XML element.
Additional info:
Can be deleted through virt-manager
Could you please retry with the '--nvram' option for 'virsh undefine'?
'man virsh' says:
undefine
Syntax:
undefine domain [--managed-save] [--snapshots-metadata]
[--checkpoints-metadata] [--nvram] [--keep-nvram]
[ {--storage volumes | --remove-all-storage
[--delete-storage-volume-snapshots]} --wipe-storage]
[...]
--nvram and --keep-nvram specify accordingly to delete or keep nvram (/domain/os/nvram/) file. If the domain has an nvram
file and the flags are omitted, the undefine will fail.
That does indeed seem to work:
[root@master-0 openshift-aio]# virsh undefine ocp4-bastion
error: Failed to undefine domain 'ocp4-bastion'
error: Requested operation is not valid: cannot undefine domain with nvram
[root@master-0 openshift-aio]# virsh undefine ocp4-bastion --nvram
Domain 'ocp4-bastion' has been undefined
Description of problem: libvirt fails to undefine a guest that has 'nvram' XML element with [root@master-0 openshift-aio]# virsh list --all Id Name State ------------------------------- - ocp4-bastion shut off - ocp4-master1 shut off - ocp4-master2 shut off - ocp4-master3 shut off [root@master-0 openshift-aio]# virsh undefine ocp4-bastion error: Failed to undefine domain 'ocp4-bastion' error: Requested operation is not valid: cannot undefine domain with nvram Version-Release number of selected component (if applicable): [root@master-0 openshift-aio]# uname -r; rpm -q libvirt-daemon-kvm libvirt libvirt-client 4.18.0-305.19.1.el8_4.aarch64 libvirt-daemon-kvm-7.0.0-14.1.el8.aarch64 libvirt-7.0.0-14.1.el8.aarch64 libvirt-client-7.0.0-14.1.el8.aarch64 How reproducible: 100% Steps to Reproduce: 1.Have a guest (AArch64 in this case) with 'nvram' XML element: [root@master-0 openshift-aio]# virsh dumpxml ocp4-bastion <domain type='kvm'> <name>ocp4-bastion</name> <uuid>2b6d9b4d-be35-435e-b23f-49b1149dea29</uuid> <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:os id="http://redhat.com/rhel/8.1"/> </libosinfo:libosinfo> </metadata> <memory unit='KiB'>16777216</memory> <currentMemory unit='KiB'>16777216</currentMemory> <vcpu placement='static'>8</vcpu> <os> <type arch='aarch64' machine='virt-rhel8.4.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader> <nvram>/var/lib/libvirt/qemu/nvram/ocp4-bastion_VARS.fd</nvram> <boot dev='hd'/> </os> 2. [root@master-0 openshift-aio]# virsh undefine ocp4-bastion error: Failed to undefine domain 'ocp4-bastion' error: Requested operation is not valid: cannot undefine domain with nvram Actual results: [root@master-0 openshift-aio]# virsh undefine ocp4-bastion error: Failed to undefine domain 'ocp4-bastion' error: Requested operation is not valid: cannot undefine domain with nvram Expected results: It should be possible to undefine the libvirt guest with 'nvram' XML element. Additional info: Can be deleted through virt-manager