nova虚拟机打不开console

在Ubuntu 14.04上用devstack装了Kilo,发现nova虚拟机的console都打不开。novnc的6080端口也能连上,安全组也没问题,sudo ufw disable也执行了,都不行。后来经同事指导,发现是nova-consoleauth没有运行。在此记录一下。

devstack中每个服务都在一个screen中启动,这个配置文件是devstack/stack-screenrc。为了让devstack启动nova-consoleauth,在该文件中增加一段:

screen -t n-cauth bash
stuff "/usr/bin/nova-consoleauth --config-file /etc/nova/nova.conf^M"
logfile /home/openstack/workspace/logs/n-cauth.log.2015-09-24-070303
log on

然后创建这个log文件:

touch /home/openstack/workspace/logs/n-cauth.log.2015-09-24-070303

下次启动devstack时就会自动启动nova-consoleauth了。

另外,nova生成libvirt.xml中没有vnc port,但是virsh dumpxml可以看到这个port,每个domain都不同:

maqi@asus:~|⇒  sudo virsh list
 Id    Name                           State
----------------------------------------------------
 3     instance-00000002              running
 4     instance-00000003              running
 5     instance-00000004              running
 6     instance-00000001              running

maqi@asus:~|⇒  sudo virsh dumpxml 3 | grep -i vnc
    'vnc' port='5901' autoport='yes' listen='127.0.0.1' keymap='en-us'>
maqi@asus:~|⇒  sudo virsh dumpxml 4 | grep -i vnc
    'vnc' port='5902' autoport='yes' listen='127.0.0.1' keymap='en-us'>

maqi@asus:~|⇒  grep vnc /home/openstack/workspace/data/nova/instances/1dc25ba1-0aa2-47d4-b468-c753d94a2fd6/libvirt.xml
    "vnc" autoport="yes" keymap="en-us" listen="127.0.0.1"/>
maqi@asus:~|⇒  sudo iptables -S | grep 5901
maqi@asus:~|⇒  sudo grep -r 5901 /home/openstack/workspace/data/nova/instances/
maqi@asus:~|⇒

maqi@asus:~|⇒  nc -v localhost 5901
Connection to localhost 5901 port [tcp/*] succeeded!
RFB 003.008

你可能感兴趣的:(openstack,nova,openstack)