Bug 1504606 - [Blocked] Use the Domain XML to create the HE VM
Summary: [Blocked] Use the Domain XML to create the HE VM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-ha
Classification: oVirt
Component: General
Version: ---
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-4.2.2
: 2.2.10
Assignee: Andrej Krejcir
QA Contact: Liran Rotenberg
URL:
Whiteboard:
: 1533524 (view as bug list)
Depends On: 1505333 1560666 1560976
Blocks: 1326983
TreeView+ depends on / blocked
 
Reported: 2017-10-20 10:13 UTC by Francesco Romani
Modified: 2018-04-27 07:21 UTC (History)
6 users (show)

Fixed In Version: v2.2.10
Clone Of:
Environment:
Last Closed: 2018-04-27 07:21:57 UTC
oVirt Team: SLA
Embargoed:
msivak: ovirt-4.2?
msivak: ovirt-4.3?
msivak: blocker?
msivak: planning_ack?
msivak: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1547095 0 unspecified CLOSED QEMU image locking on NFSv3 prevents VMs from getting restarted on different hosts upon an host crash, seen on RHEL 7.5 2021-09-09 13:14:28 UTC
oVirt gerrit 86435 0 master MERGED libvirtxml: Use the libvirt XML if present in OVF 2020-10-09 20:30:31 UTC
oVirt gerrit 86578 0 master MERGED libvirtxml: Send only XML when creating the VM, if the vm.conf contains it 2020-10-09 20:30:31 UTC
oVirt gerrit 86581 0 master MERGED core: Fix libvirt XML creation for hosted engine 2020-10-09 20:30:31 UTC
oVirt gerrit 86885 0 master MERGED core: libvirt XML: Change parameters for HE disk. 2020-10-09 20:30:31 UTC
oVirt gerrit 87230 0 ovirt-hosted-engine-setup-2.2 MERGED libvirtxml: Send only XML when creating the VM, if the vm.conf contains it 2020-10-09 20:30:31 UTC
oVirt gerrit 89483 0 master MERGED Ignore engine generated libvirt XML 2020-10-09 20:30:40 UTC
oVirt gerrit 89485 0 v2.2.z MERGED Ignore engine generated libvirt XML 2020-10-09 20:30:31 UTC
oVirt gerrit 89873 0 master MERGED domxml_preprocess: lease: always use strings 2020-10-09 20:30:31 UTC
oVirt gerrit 89878 0 ovirt-4.2 MERGED domxml_preprocess: lease: always use strings 2020-10-09 20:30:31 UTC

Internal Links: 1547095

Description Francesco Romani 2017-10-20 10:13:37 UTC
Description of problem:
Hosted Engine bootstrap the VM on which the Engine will run using vdsm client and the JSON-like configuration format that Vdsm supported since early 3.y versions.
Starting from version 4.2, Vdsm can create VMs out of the standard libvirt domain XML, augmented with minimal metadata specific to oVirt.

Hosted Engine should switch to the domain XML to configure the Engine's VM.


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


How reproducible:
100%


Steps to Reproduce:
1. create the Engine VM

Actual results:
VM gets created using the legacy JSON-like vm configuration format

Expected results:
VM gets created using the libvirt domain XML format


Additional info:
The end result (VM configuration) is expected to be exactly identical, what changes is just how the data is sent to Vdsm

Comment 1 Martin Sivák 2018-01-15 12:24:23 UTC
*** Bug 1533524 has been marked as a duplicate of this bug. ***

Comment 2 Artyom 2018-02-19 22:26:52 UTC
Verified on ovirt-hosted-engine-setup-2.2.10-1.el7ev.noarch

Comment 3 Simone Tiraboschi 2018-03-27 10:14:03 UTC
Blocking this since the VM could fail to start as for https://bugzilla.redhat.com/1560666

Comment 4 Red Hat Bugzilla Rules Engine 2018-03-27 10:14:40 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 5 Sandro Bonazzola 2018-03-27 14:26:25 UTC
Re-targeting tentatively to 4.2.3

Comment 6 Martin Sivák 2018-04-03 08:41:37 UTC
This was basically reverted to workaround a libvirt bug https://bugzilla.redhat.com/show_bug.cgi?id=1547095.

The feature has to be re-enabled before we ship a downstream version as quite a lot of other fixes depend on it.

Comment 7 Simone Tiraboschi 2018-04-05 13:46:48 UTC
http://jenkins.ovirt.org/job/ovirt-system-tests_he-basic-ansible-suite-master/143/artifact/exported-artifacts/test_logs/he-basic-ansible-suite-master/post-he_deploy/lago-he-basic-ansible-suite-master-host0/_var_log/vdsm/vdsm.log

it seams that we have another regression with this, at least on master:
2018-04-05 09:27:22,765-0400 ERROR (vm/9bb2deab) [virt.vm] (vmId='9bb2deab-f686-4629-acee-90e2774a66b6') The vm start process failed (vm:945)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 874, in _startUnderlyingVm
    self._run()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2832, in _run
    domxml = hooks.before_vm_start(self._buildDomainXML(),
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2258, in _buildDomainXML
    return vmxml.format_xml(dom, pretty=True)
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmxml.py", line 71, in format_xml
    stream, encoding='utf-8', xml_declaration=True)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 820, in write
    serialize(write, self._root, encoding, qnames, namespaces)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 932, in _serialize_xml
    v = _escape_attrib(v, encoding)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1092, in _escape_attrib
    _raise_serialization_error(text)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1052, in _raise_serialization_error
    "cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize 0 (type int)
2018-04-05 09:27:22,765-0400 INFO  (vm/9bb2deab) [virt.vm] (vmId='9bb2deab-f686-4629-acee-90e2774a66b6') Changed state to Down: cannot serialize 0 (type int) (code=1) (vm:1685)

Comment 8 Liran Rotenberg 2018-04-26 18:11:26 UTC
Verified on:
ovirt-hosted-engine-setup-2.2.18-1.el7ev.noarch
ovirt-hosted-engine-ha-2.2.10-1.el7ev.noarch
rhvm-appliance-4.2-20180420.0.el7.noarch

ovirt-engine version in the appliance:
ovirt-engine-4.2.3.2-0.1.el7.noarch

Steps:
1. Deploy HE, and wait until the installation is finished.
2. Force OVF update by editing the HE VM (for example changing memory)
3. Wait a minute until the OVF is updated
4. Set global maintenance mode on the HE and shut down the HE VM
5. Start the HE VM using 'hosted-engine --vm-start'
6. Check VDSM logs, around the VM.create command.

Result:
Under VM.create the VM XML is printed in a bridge:
"... DEBUG (jsonrpc/3) [jsonrpc.JsonRpcServer] Calling 'VM.create' in bridge with {u'vmParams': {u'xml': u'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<domain xmlns:ovirt ..."

and

"... INFO  (jsonrpc/3) [api.virt] START create(vmParams={u'xml': u'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<domain xmlns:ovirt ..." 

by comment #7 now the hook passed:

2018-04-26 20:51:55,495+0300 DEBUG (vm/75f93aba) [root] /usr/bin/taskset --cpu-list 0-7 /usr/libexec/vdsm/hooks/before_vm_start/50_hostedengine (cwd None) (commands:65)
2018-04-26 20:51:55,687+0300 DEBUG (vm/75f93aba) [root] SUCCESS: <err> = ''; <rc> = 0 (commands:86)
2018-04-26 20:51:55,688+0300 INFO  (vm/75f93aba) [root] /usr/libexec/vdsm/hooks/before_vm_start/50_hostedengine: rc=0 err= (hooks:110)
2018-04-26 20:51:55,688+0300 DEBUG (vm/75f93aba) [root] /usr/bin/taskset --cpu-list 0-7 /usr/libexec/vdsm/hooks/before_vm_start/50_vfio_mdev (cwd None) (commands:65)
2018-04-26 20:51:55,876+0300 DEBUG (vm/75f93aba) [root] SUCCESS: <err> = ''; <rc> = 0 (commands:86)
2018-04-26 20:51:55,876+0300 INFO  (vm/75f93aba) [root] /usr/libexec/vdsm/hooks/before_vm_start/50_vfio_mdev: rc=0 err= (hooks:110)
2018-04-26 20:51:55,877+0300 DEBUG (vm/75f93aba) [root] /usr/bin/taskset --cpu-list 0-7 /usr/libexec/vdsm/hooks/before_vm_start/50_vhostmd (cwd None) (commands:65)
2018-04-26 20:51:56,038+0300 DEBUG (vm/75f93aba) [root] SUCCESS: <err> = ''; <rc> = 0 (commands:86)
2018-04-26 20:51:56,039+0300 INFO  (vm/75f93aba) [root] /usr/libexec/vdsm/hooks/before_vm_start/50_vhostmd: rc=0 err= (hooks:110)
2018-04-26 20:51:56,039+0300 INFO  (vm/75f93aba) [virt.vm] (vmId='75f93aba-949f-49de-bbb9-b71f68e19678') <?xml version="1.0" encoding="utf-8"?><domain type="kvm" xmlns:ns0="http://ovirt.org/vm/tune/1.0" xmlns:ov
irt-vm="http://ovirt.org/vm/1.0">
    <name>HostedEngine</name>
    <uuid>75f93aba-949f-49de-bbb9-b71f68e19678</uuid>
    <memory>4194304</memory>
...

Comment 9 Sandro Bonazzola 2018-04-27 07:21:57 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 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.