Bug 1545105 - OVF parsing fails if the HE VM is in an affinity group
Summary: OVF parsing fails if the HE VM is in an affinity group
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-ha
Classification: oVirt
Component: Agent
Version: 2.2.1
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-4.2.2
: ---
Assignee: Andrej Krejcir
QA Contact: Polina
URL:
Whiteboard:
Depends On:
Blocks: 1458711
TreeView+ depends on / blocked
 
Reported: 2018-02-14 10:29 UTC by Andrej Krejcir
Modified: 2018-03-29 11:03 UTC (History)
2 users (show)

Fixed In Version: ovirt-hosted-engine-ha-2.2.6-1.el7ev
Clone Of:
Environment:
Last Closed: 2018-03-29 11:03:50 UTC
oVirt Team: SLA
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 87587 0 master MERGED ovf: Read VM id from the correct <Section> tag, regardless of tag order 2018-02-15 15:42:55 UTC
oVirt gerrit 87756 0 v2.2.z MERGED ovf: Read VM id from the correct <Section> tag, regardless of tag order 2018-02-15 16:16:06 UTC

Description Andrej Krejcir 2018-02-14 10:29:19 UTC
Description of problem:
The OFV parser tries to read the VM ID attribute from the first <Section>
tag in the file. If the VM is part of an affinity group, the <Section>
containing affinity information is before the <Section> with VM ID.
This causes the parsing to fail and the agent crashes.

The error is:
MainThread::ERROR::2018-02-14 11:23:05,214::hosted_engine::434::ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine::(start_monitoring) Unhandled monitoring loop exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 431, in start_monitoring
    self._monitoring_loop()
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 450, in _monitoring_loop
    for old_state, state, delay in self.fsm:
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/fsm/machine.py", line 127, in next
    new_data = self.refresh(self._state.data)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/state_machine.py", line 123, in refresh
    ] = self.hosted_engine.min_memory_threshold
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 184, in min_memory_threshold
    return int(self._config.get(config.VM, config.MEM_SIZE))
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 213, in get
    self._load_config_files(dict([(type, self._dynamic_files[type])]))
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 201, in _load_config_files
    self.refresh_local_conf_file(config_type)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 385, in refresh_local_conf_file
    result = refresh_method()
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 515, in refresh_vm_conf
    content_from_ovf = self._get_vm_conf_content_from_ovf_store()
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 443, in _get_vm_conf_content_from_ovf_store
    conf = ovf2VmParams.confFromOvf(heovf)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/ovf/ovf2VmParams.py", line 298, in confFromOvf
    vmConf = toDict(ovf)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/ovf/ovf2VmParams.py", line 222, in toDict
    vmParams['vmId'] = tree.find('Content/Section').attrib[OVF_NS + 'id']
  File "lxml.etree.pyx", line 2272, in lxml.etree._Attrib.__getitem__ (src/lxml/lxml.etree.c:55336)
KeyError: '{http://schemas.dmtf.org/ovf/envelope/1}id'


Version-Release number of selected component (if applicable):
ovirt-hosted-engine-ha   2.2.2-1.el7.centos

How reproducible:
100%

Steps to Reproduce:
1. Create an affinity group containing the HE VM.
2. Edit the HE VM, so the new OVF is saved to the storage domain. (For example, change maximum memory)
3. Wait a while and look to the HA agent logs

Actual results:
The agent keeps crashing with the above error.

Expected results:
The agent starts normally.

Comment 1 Polina 2018-03-07 09:54:16 UTC
verified in:
build rhv-release-4.2.2-4-001.noarch
ovirt-hosted-engine-ha-2.2.6-1.el7ev.noarch
ovirt-hosted-engine-setup-2.2.11-1.el7ev.noarch
steps:
1.created several affinity groups from HostedEngine VM with positive/negative, enforcing true/false.
2. changed max memory property

checked that there are no errors in /var/log/ovirt-hosted-engine-ha/ageng.log

Comment 2 Sandro Bonazzola 2018-03-29 11:03:50 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.