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.
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
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.