nova fails with error: 'module' object has no attribute 'VIR_MIGRATE_POSTCOPY' after using libvirt 2.5.0 from UCA

Bug #1682692 reported by Sam Wan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Development Infrastructure
New
Undecided
Unassigned

Bug Description

commit https://review.openstack.org/#/c/451492/ uses libvirt 2.5.0 from UCA, and nova fails with below errors with this change.
===
2017-04-13 19:17:26.927 9868 DEBUG oslo_service.service [req-93d359eb-0146-49ff-aeca-48114f30793a - -] logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2778
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service [-] Error starting thread.
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service Traceback (most recent call last):
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/usr/local/lib/python2.7/dist-packages/oslo_service/service.py", line 721, in run_service
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service service.start()
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/opt/stack/new/nova/nova/service.py", line 144, in start
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service self.manager.init_host()
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/opt/stack/new/nova/nova/compute/manager.py", line 1135, in init_host
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service self.driver.init_host(host=self.host)
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 471, in init_host
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service self._parse_migration_flags()
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 629, in _parse_migration_flags
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service live_migration_flags)
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 606, in _handle_live_migration_auto_converge
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service (migration_flags & libvirt.VIR_MIGRATE_POSTCOPY) != 0):
2017-04-13 19:17:27.302 9868 ERROR oslo_service.service AttributeError: 'module' object has no attribute 'VIR_MIGRATE_POSTCOPY'
====

some example logs:

http://openstack-ci.tintri.com/tintri/refs-changes-78-455878-2/logs/screen-n-cpu.log.txt
http://publiclogs.emc.com/vnx_ostack/EMC_VNX_iSCSI/371/logs/screen-n-cpu.txt.gz

Sam Wan (sam-wan)
Changed in nova:
assignee: nobody → Sam Wan (sam-wan)
affects: nova → openstack-devel
Changed in openstack-devel:
assignee: Sam Wan (sam-wan) → nobody
Revision history for this message
Sam Wan (sam-wan) wrote :

It turns out to be some issue with local cached libvirt-python.

devstack uses 'sudo -H' to install pip package
------
./inc/python: local sudo_pip="sudo -H"
------

with '-H', pip will try to use the local cached version. In this case, it uses /root/.cache/pip/
Somehow for this case, there's something wrong with local cached version.
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite /usr/local/bin/pip2.7 install -c /opt/stack/new/requirements/upper-constraints.txt 'libvirt-python>=1.2.5' 2>/dev/null
Collecting libvirt-python===3.2.0 (from -c /opt/stack/new/requirements/upper-constraints.txt (line 224))
Installing collected packages: libvirt-python
Successfully installed libvirt-python-3.2.0
sam@cdh3h6:~> python -c 'import libvirt;libvirt.VIR_MIGRATE_POSTCOPY'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'VIR_MIGRATE_POSTCOPY'
~>
------

but if we tell pip to disable the cache with '--no-cache-dir', we won't run into this issue.
------
~> sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite /usr/local/bin/pip2.7 install --no-cache-dir -c /opt/stack/new/requirements/upper-constraints.txt 'libvirt-python>=1.2.5' 2>/dev/null
Collecting libvirt-python===3.2.0 (from -c /opt/stack/new/requirements/upper-constraints.txt (line 224))
  Downloading libvirt-python-3.2.0.tar.gz (174kB)
    100% |################################| 184kB 324kB/s
Installing collected packages: libvirt-python
  Running setup.py install for libvirt-python ... done
Successfully installed libvirt-python-3.2.0
~> python -c 'import libvirt;libvirt.VIR_MIGRATE_POSTCOPY'
------

would suggest to disable the cable when devstack install pip packages.

Revision history for this message
Sam Wan (sam-wan) wrote :
Revision history for this message
Juan Pedro Paredes (juampe) wrote :

This solved the problem for me
pip install libvirt-python==3.2.0

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.