Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1886750 - VM host device is not removed while removing the host
Summary: VM host device is not removed while removing the host
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.4.1
Hardware: All
OS: Linux
Target Milestone: ovirt-4.4.4
: 4.4.4
Assignee: Arik
QA Contact: Nisim Simsolo
Depends On:
TreeView+ depends on / blocked
Reported: 2020-10-09 10:24 UTC by nijin ashok
Modified: 2021-02-09 11:32 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-
Doc Type: Bug Fix
Doc Text:
Previously, when removing a host, neither the virtual machine's host device nor the host dependency list were removed. As a result, this sometimes caused error messages when running the virtual machine on another host, and leaving behind incorrect entries in the database. In this release, the virtual machine host device and entry in the virtual machine's dependency list for the removed host are no longer included in the database, and the associated error messages no longer occur.
Clone Of:
Last Closed: 2021-02-02 13:58:29 UTC
oVirt Team: Virt
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:0312 0 None None None 2021-02-02 13:58:44 UTC
oVirt gerrit 112195 0 master MERGED core: Remove Host devices when removing a Host 2021-02-19 14:57:55 UTC

Description nijin ashok 2020-10-09 10:24:03 UTC
Description of problem:

A pci host device was added to the VM.

engine=# select device,type from vm_device where vm_id='4a474e30-dcde-4541-8f2f-5607ae22f563' and type='hostdev';
      device      |  type   
 pci_0000_00_07_0 | hostdev
(1 row)

Then the host was removed from the manager. However the device was not removed from the from the vm_device table although it's not showing up in the "Host Devices" tab of VM.

The VM will will to start on any other host with below error.

2020-10-09 15:21:04,082+0530 ERROR (vm/59df4177) [virt.vm] (vmId='59df4177-e10b-4cc1-a4b2-94ae86979d6f') Failed to setup device pci_0000_00_07_0 (vm:2629)

Even if the original host is added back, the Host devices tab of VM doesn't show this device. Also if a user try to add te same device again using "add device" option in GUI, it will not show this PCI device.

The only option to reolve the issue is to remove the device manually from the database.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Attach a host device to the VM. 
2. Remove the host.
3. Check the vm_device table. The hostdev device will be still in that table.
4. Check the "Host Devices" tab of that VM in manager GUI. That device will not be visbile. 
5. Add the host back to the manager.
6. Try to add host device for the same VM. It will filter out the device which is in vm_device table.

Actual results:

VM host device is not removed while removing the host

Expected results:

I think there should be some validation while removing the host if there are VMs still using the host devices. Or it should automatically remove the device from the vm_device table.

Additional info:

Comment 5 Tamir 2020-12-27 09:21:02 UTC
Verified on RHV 4.4.4-6. All looks good to me.

  - Engine instance with RHV 4.4.4-6 (ovirt-engine- and RHEL 8.3 installed.
  - 2 hosts with RHV 4.4.4-6 and RHEL 8.3, 3 hosts with vdsm-4.40.40-1.el8ev

In Admin Portal:

1. Create a 4.5 data center and a 4.5 cluster.
2. Install the host and create a new NFS storage domain.
3. Create a VM with a disk with RHEL 8.3 installed and OS set to RHEL 8 and wait for its creation.
4. Add a PCI host device.
5. Check in the host devices tab and in the vm_device table that the host device is attached to the VM.
6. Remove the host which it's pci device was attached to the VM.
7. Check  in the host devices tab and in the vm_device table that the host device is't attached anymore to the VM.
8. Install the same host we removed.
9. Add the same PCI device you added from the host to the same VM
10. Check in the host devices tab and in the vm_device table that the host device is attached to the VM.

Results (As Expected):
1. The 4.5 data center and the 4.5 cluster were created.
2. The host was installed and the NFS storage domain was created.
3. The VM was created.
4. The PCI host device was added.
5. The host device is attached to the VM.
6. The host was removed.
7. The host device isn't attached to the VM.
8. The host was installed.
9. The PCI host device was added.
10. The host device is attached to the VM.

Comment 10 errata-xmlrpc 2021-02-02 13:58:29 UTC
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 (RHV Engine and Host Common Packages 4.4.z [ovirt-4.4.4]), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.