Erro em nova-compute strart - libvirt: Falha ao conectar o soquete a '/ var / run / libvirt / libvirt-sock': Nenhum arquivo ou diretório

2

Qualquer tentativa de iniciar novos serviços de computação falha com o erro HypervisorUnavailable: Connection to the hypervisor is broken on host:

O log de rastreamento é o seguinte (obtido de /var/log/nova/nova-compute.log )

AUDIT nova.service [-] Starting compute node (version 2014.1.1)
ERROR nova.virt.libvirt.driver [-] Connection to libvirt failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
TRACE nova.virt.libvirt.driver Traceback (most recent call last):
TRACE nova.virt.libvirt.driver   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 787, in _connect
TRACE nova.virt.libvirt.driver     libvirt.openAuth, uri, auth, flags)
TRACE nova.virt.libvirt.driver   File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 139, in proxy_call
TRACE nova.virt.libvirt.driver     rv = execute(f,*args,**kwargs)
TRACE nova.virt.libvirt.driver   File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 77, in tworker
TRACE nova.virt.libvirt.driver     rv = meth(*args,**kwargs)
TRACE nova.virt.libvirt.driver   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 105, in openAuth
TRACE nova.virt.libvirt.driver     if ret is None:raise libvirtError('virConnectOpenAuth() failed')
TRACE nova.virt.libvirt.driver libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
TRACE nova.virt.libvirt.driver
ERROR nova.openstack.common.threadgroup [-] Connection to the hypervisor is broken on host: <HOST_NAME>
TRACE nova.openstack.common.threadgroup Traceback (most recent call last):
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py", line 117, in wait
TRACE nova.openstack.common.threadgroup     x.wait()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py", line 49, in wait
TRACE nova.openstack.common.threadgroup     return self.thread.wait()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 168, in wait
TRACE nova.openstack.common.threadgroup     return self._exit_event.wait()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 116, in wait
TRACE nova.openstack.common.threadgroup     return hubs.get_hub().switch()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 187, in switch
TRACE nova.openstack.common.threadgroup     return self.greenlet.switch()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main
TRACE nova.openstack.common.threadgroup     result = function(*args, **kwargs)
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/openstack/common/service.py", line 483, in run_service
TRACE nova.openstack.common.threadgroup     service.start()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/service.py", line 163, in start
TRACE nova.openstack.common.threadgroup     self.manager.init_host()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1006, in init_host
TRACE nova.openstack.common.threadgroup     self.driver.init_host(host=self.host)
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 656, in init_host
TRACE nova.openstack.common.threadgroup     self._do_quality_warnings()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 639, in _do_quality_warnings
 TRACE nova.openstack.common.threadgroup     caps = self.get_host_capabilities()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2849, in get_host_capabilities
TRACE nova.openstack.common.threadgroup     xmlstr = self._conn.getCapabilities()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 721, in _get_connection
TRACE nova.openstack.common.threadgroup     wrapped_conn = self._get_new_connection()
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 674, in _get_new_connection
TRACE nova.openstack.common.threadgroup     wrapped_conn = self._connect(self.uri(), self.read_only)
TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 796, in _connect
TRACE nova.openstack.common.threadgroup     raise exception.HypervisorUnavailable(host=CONF.host)
TRACE nova.openstack.common.threadgroup HypervisorUnavailable: Connection to the hypervisor is broken on host: <HOST_NAME>

Nenhum outro arquivo de log indica qualquer erro syslog , dmesg e /var/log/libvirt/libvirtd.log não mostram nenhum problema

A configuração libvirt ( /etc/libvirt/libvirtd.conf ) foi configurada para registrar os erros log_outputs="3:syslog:libvirtd"

Antes do erro aparecer, o nó estava funcionando sem problemas, sem alterações.

    
por Athafoud 23.03.2015 / 11:37

3 respostas

0

Parece que foi uma configuração errada do libvirt . Em resumo, o problema foi que libvirtd não estava iniciando com --listen flag e, portanto, não estava criando o arquivo adequado de sock que o serviço nova estava pesquisando.

Veja minha resposta relevante no askbug sobre como configurar o libvirt no modo 'listen'.

    
por 18.04.2015 / 15:34
2

No meu caso, eu tinha reinstalado o libvirt e os pacotes associados sem reiniciar o libvirtd . O erro foi assim resolvido com os três comandos a seguir:

systemctl stop libvirtd
systemctl start libvirtd
systemctl status libvirtd
    
por 25.03.2017 / 06:25
0

Eu tive um caso semelhante na noite passada quando tentei reiniciar meu serviço nova-compute . No glp que você forneceu, podemos usar a (s) seguinte (s) linha (s)

Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory TRACE nova.virt.libvirt.driver "

Assim, podemos saber que o problema resulta do libvirtd service não funcionar.

No meu caso, verifiquei o status de libvirtd service para descobrir por que ele falha e tentei reiniciá-lo como descrito abaixo

Eupesquiseimuitosobreoproblema(g-io-error-quark,1)acima.Mastodososresultadossãosobreumproblemade/etc/fstab.

Nomeucaso,tenteiusarocomandolibvirtd-lparaobteralgumasdicas

Finalmente eu descobri isso! O problema é sobre o /var/run e que é um link para o caminho / execução e o link falha. Por isso, redefini o link para / run e, em seguida, reiniciei o serviço libvirtd com êxito.

Espero que isso funcione para você.

    
por 13.04.2017 / 09:18