Bug 1532151 - cannot run vm after upgrade to 4.2-beta - AttributeError: 'Element' object has no attribute '_elem'
Summary: cannot run vm after upgrade to 4.2-beta - AttributeError: 'Element' object h...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: General
Version: 4.20.11
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ovirt-4.2.1
: ---
Assignee: Milan Zamazal
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-08 07:46 UTC by Jiri Belka
Modified: 2019-04-28 14:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
VMs with devices having custom properties couldn't be started from pre-4.2 Engine on hosts running oVirt 4.2. This has been fixed.
Clone Of:
Environment:
Last Closed: 2018-02-12 11:52:46 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 86050 0 master MERGED virt: Don't assume devices from _process_devices are all vmxml.Element's 2018-01-08 11:03:22 UTC

Description Jiri Belka 2018-01-08 07:46:01 UTC
Description of problem:

i can't run any VM on a host which was upgraded from 4.1 to 4.2 - still managed with 4.1.8 engine:

2018-01-08 08:37:50,749+0100 ERROR (vm/7dcb82ea) [virt.vm] (vmId='7dcb82ea-582e-47b1-8e9b-7c5a85d1b69e') The vm start process failed (vm:915)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 844, in _startUnderlyingVm
    self._run()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2729, in _run
    domxml = hooks.before_vm_start(self._buildDomainXML(),
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2189, in _buildDomainXML
    return self._make_domain_xml()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2237, in _make_domain_xml
    domxml._devices.appendChild(element=dev)
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmxml.py", line 395, in appendChild
    append_child(self._elem, element, etree_element)
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmxml.py", line 237, in append_child
    element.append(child._elem)
AttributeError: 'Element' object has no attribute '_elem'
2018-01-08 08:37:50,754+0100 INFO  (vm/7dcb82ea) [virt.vm] (vmId='7dcb82ea-582e-47b1-8e9b-7c5a85d1b69e') Changed state to Down: 'Element' object has no attribute '_elem' (code=1) (vm:1634)
2018-01-08 08:37:50,759+0100 INFO  (vm/7dcb82ea) [virt.vm] (vmId='7dcb82ea-582e-47b1-8e9b-7c5a85d1b69e') Stopping connection (guestagent:438)

events (newest first):

Jan 8, 2018 8:37:54 AM
Failed to run VM jbelka-sles-01 (User: jbelka@redhat-authz).
e75bb1b7-5a1e-46d5-a561-2b74ed027705
oVirt

Jan 8, 2018 8:37:54 AM
Failed to run VM jbelka-sles-01 on Host slot-7c.
e75bb1b7-5a1e-46d5-a561-2b74ed027705
oVirt

Jan 8, 2018 8:37:54 AM
VM jbelka-sles-01 is down with error. Exit message: 'Element' object has no attribute '_elem'.
oVirt

Jan 8, 2018 8:37:47 AM
VM jbelka-sles-01 was started by jbelka@redhat-authz (Host: slot-7c).
e75bb1b7-5a1e-46d5-a561-2b74ed027705
oVirt

Version-Release number of selected component (if applicable):
ovirt-host-4.2.0-1.el7ev.x86_64
vdsm-4.20.11-1.el7ev.x86_64
libvirt-daemon-3.2.0-14.el7_4.7.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.13.x86_64
iscsi-initiator-utils-6.2.0.874-4.el7.x86_64
kernel-3.10.0-693.11.6.el7.x86_64
redhat-release-server-7.4-18.el7.x86_64

engine - 4.1.8.2-0.1.el7

How reproducible:
100%

Steps to Reproduce:
1. have 4.1 env
2. upgrade a host to 4.2
3.

Actual results:
start of VMs fails with an exit message: 'Element' object has no attribute '_elem'.

Expected results:
should work

Additional info:

Comment 2 Jiri Belka 2018-01-08 08:58:30 UTC
downgrade to 4.1 vdsm caused VM start be successful.

# rpm -q vdsm ; virsh list
vdsm-4.19.43-3.el7ev.x86_64
 Id    Name                           State
----------------------------------------------------
 1     jbelka-sles-01                 running
 2     system-ge-host-6               running

Comment 3 Milan Zamazal 2018-01-08 10:12:51 UTC
The problem apparently appears when 
- not using Engine XML
and
- the VM has a device with custom properties (e.g. ifacemacspoof in a network interface).

I'm working on a fix.

Comment 4 Jiri Belka 2018-01-16 16:08:03 UTC
ok, vdsm-python-4.20.13-1.el7ev.noarch

vm with custom device property can be started on 4.2 host and migrated to such host without issues (using 4.1 engine).

Comment 5 Sandro Bonazzola 2018-02-12 11:52:46 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.1 release, it has been closed with a resolution of CURRENT RELEASE.

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


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