libvirt-python 在 Ubuntu 12.04 下使用 stack.sh 停止安装 devstack

libvirt-python 在 Ubuntu 12.04 下使用 stack.sh 停止安装 devstack

我正在尝试使用 在 Ubuntu 12.04 下安装 devstack stack.sh,但我遇到了这个错误。当前的 Python 版本是 2.7.3

从 开始遵循 devstack 安装程序的标准方法(一体式单机)sudo apt-get update。如果需要更多信息,请告诉我。

Reading state information... Done
libvirt-bin is already the newest version.
libvirt-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 213 not upgraded.
+ real_install_package libvirt-bin libvirt-dev
+ is_ubuntu
+ [[ -z deb ]]
+ '[' deb = deb ']'
+ apt_get install libvirt-bin libvirt-dev
++ set +o
++ grep xtrace
+ local 'xtrace=set -o xtrace'
+ set +o xtrace
+ sudo DEBIAN_FRONTEND=noninteractive http_proxy= https_proxy= no_proxy= apt-get --option Dpkg::Options::=--force-confold --assume-yes install libvirt-bin libvirt-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libvirt-bin is already the newest version.
libvirt-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 213 not upgraded.
+ pip_install_gr libvirt-python
+ local name=libvirt-python
++ get_from_global_requirements libvirt-python
++ local package=libvirt-python
+++ grep -i -h '^libvirt-python' /opt/stack/requirements/global-requirements.txt
+++ cut -d# -f1
++ local 'required_pkg=libvirt-python>=1.2.5                   '
++ [[ libvirt-python>=1.2.5                    == '' ]]
++ echo 'libvirt-python>=1.2.5'
+ local 'clean_name=libvirt-python>=1.2.5'
+ pip_install 'libvirt-python>=1.2.5'
++ set +o
++ grep xtrace
+ local 'xtrace=set -o xtrace'
+ set +o xtrace
+ sudo -H http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS=file:///opt/stack/.wheelhouse /usr/local/bin/pip install 'libvirt-python>=1.2.5'
Collecting libvirt-python>=1.2.5
  Using cached libvirt-python-1.2.16.tar.gz
Building wheels for collected packages: libvirt-python
  Running setup.py bdist_wheel for libvirt-python
  Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-XwqhSl/libvirt-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp2i3WSspip-wheel-:
  running bdist_wheel
  running build
  /usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
  error: command '/usr/bin/pkg-config' failed with exit status 1

  ----------------------------------------
  Failed building wheel for libvirt-python
Failed to build libvirt-python
Installing collected packages: libvirt-python
  Running setup.py install for libvirt-python
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-XwqhSl/libvirt-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_Rbsrk-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    /usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
    error: command '/usr/bin/pkg-config' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-XwqhSl/libvirt-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_Rbsrk-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-XwqhSl/libvirt-python
+ exit_trap
+ local r=1
++ jobs -p
+ jobs=
+ [[ -n '' ]]
+ kill_spinner
+ '[' '!' -z '' ']'
+ [[ 1 -ne 0 ]]
+ echo 'Error on exit'
Error on exit
+ [[ -z /opt/stack/logs ]]
+ /home/test/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2015-06-11-125626.txt for details
+ exit 1

答案1

此问题是由于“libvirt”版本过低造成的。如果您从“trusty”更新 Ubuntu 12.04 软件包,此问题将得到解决。

默认情况下,Ubuntu 从“precise”下载软件包,但 openstack 需要从“trusty”下载一些 lib 文件,例如这个“libvirt”。以下步骤解决了此问题。

sudo -s
apt-get install ubuntu-cloud-keyring
echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main" > /etc/apt/sources.list.d/cloudarchive-juno.list
apt-get update
exit

注意:deb httpurl 可以从任何其他有效的 Ubuntu 站点档案中使用。

确保检查 libvirt 版本

$ libvirtd --version
libvirtd (libvirt) 1.2.2

输出应大于0.9.11stack.sh由于此检查条件而停止的,您可以在查询中找到相同的内容。

相关内容