nova计算服务一直处于activating (start)

[root@node7 html]# systemctl status  openstack-nova-compute.service
● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
   Active: activating (start) since Fri 2019-08-16 11:01:37 CST; 4s ago
 Main PID: 10840 (nova-compute)
    Tasks: 1
   CGroup: /system.slice/openstack-nova-compute.service
           └─10840 /usr/bin/python2 /usr/bin/nova-compute

Aug 16 11:01:37 node7 systemd[1]: Starting OpenStack Nova Compute Server...
[root@node7 html]# systemctl status  openstack-nova-compute.service
● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
  Active: active (running) since Fri 2019-08-16 11:01:42 CST; 103ms ago
 Main PID: 10840 (nova-compute)
    Tasks: 22
   CGroup: /system.slice/openstack-nova-compute.service
           └─10840 /usr/bin/python2 /usr/bin/nova-compute

Aug 16 11:01:37 node7 systemd[1]: Starting OpenStack Nova Compute Server...
Aug 16 11:01:42 node7 systemd[1]: Started OpenStack Nova Compute Server.
[root@node7 html]# systemctl status  openstack-nova-compute.service
● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
   Active: activating (start) since Fri 2019-08-16 11:01:42 CST; 3s ago
 Main PID: 11077 (nova-compute)
    Tasks: 1
   CGroup: /system.slice/openstack-nova-compute.service
           └─11077 /usr/bin/python2 /usr/bin/nova-compute

Aug 16 11:01:42 node7 systemd[1]: Starting OpenStack Nova Compute Server...

nova compute服务一直在启动中

  • 查看日志文件
    [root@node7 nova]# tail -n 100 /var/log/nova/nova-compute.log
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 729, in run_service
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service     service.start()
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/nova/service.py", line 161, in start
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service     self.manager.init_host()
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1149, in init_host
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service     self.driver.init_host(host=self.host)
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 529, in init_host
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service     self._version_to_string(MIN_QEMU_VERSION))
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service InternalError: Nova requires QEMU version 2.1.0 or greater.
2019-08-16 11:02:42.607 13372 ERROR oslo_service.service 

InternalError: Nova requires QEMU version 2.1.0 or greater
推断应该时QEMU版本问题

  • 检查qemu版本:
 [root@node7 nova]# qemu-img --help | grep version
    qemu-img version 2.10.0(qemu-kvm-ev-2.10.0-21.el7_5.7.1)
    '-V', '--version'    output version information and exit
       conversion. If the number of bytes is 0, the source will not be scanned for     
 [root@node7 nova]# /usr/libexec/qemu-kvm -version
     QEMU emulator version 2.10.0(qemu-kvm-ev-2.10.0-21.el7_5.7.1)
    Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
 [root@node7 nova]# virsh -c qemu:///system version --daemon
    Compiled against library: libvirt 4.5.0
    Using library: libvirt 4.5.0
    Using API: QEMU 4.5.0
    Running hypervisor: QEMU 2.0.0
    Running against daemon: 4.5.0

运行的hypervisor的版本时QEMU 2.0.0 与已经安装的QEMU 2.10.0版本不一致,因此推断是这的问题:

  • 解决方法
    1.已经安装了所需要版本,但是Running hypervisor: QEMU xxx不一样
     [root@node7 nova]# sudo yum remove qemu-system-x86
     [root@node7 nova]# systemctl restart libvirtd.service
     [root@node7 nova]# virsh -c qemu:///system version --daemon
        Compiled against library: libvirt 4.5.0
        Using library: libvirt 4.5.0
        Using API: QEMU 4.5.0
        Running hypervisor: QEMU 2.10.0
        Running against daemon: 4.5.0
    [root@node7 nova]# systemctl restart  openstack-nova-compute.service
    [root@node7 nova]# systemctl status openstack-nova-compute
        ● openstack-nova-compute.service - OpenStack Nova Compute Server
        Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
        Active: active (running) since Fri 2019-08-16 11:19:27 CST; 11s ago
        Main PID: 23713 (nova-compute)
            Tasks: 22
        CGroup: /system.slice/openstack-nova-compute.service
                └─23713 /usr/bin/python2 /usr/bin/nova-compute
    
        Aug 16 11:19:22 node7 systemd[1]: Starting OpenStack Nova Compute Server...
        Aug 16 11:19:27 node7 systemd[1]: Started OpenStack Nova Compute Server.
    
    2.没有安装所需要QEMU版本,则需要安装所需版本
        yum -y install gcc gcc-c++ automake libtool zlib-devel glib2-devel bzip2-devel libuuid-devel spice-protocol spice-server-devel usbredir-devel libaio-devel
        wget https://download.qemu.org/qemu-3.1.0-rc0.tar.xz
        tar xvJf qemu-3.1.0-rc0.tar.xz
        cd qemu-3.1.0-rc0
        ./configure
        make && make install
        
        ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-kvm
        ln -s /usr/local/bin/qemu-system-x86_64 /usr/libexec/qemu-kvm
        ln -s /usr/local/bin/qemu-img /usr/bin/qemu-img
        
        qemu-img --version
        qemu-kvm –version
        virsh -c qemu:///system version --daemon
    

版权声明:本文为qq_36163711原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。