devstack 虚拟机IP配置失败

通过如下命令查看虚拟机启动日志

下面命令的最后一个参数可通过nova list获取。

openstack console log show cd0cd260-9d98-4ca8-8ceb-db773db33a27  

=== cirros: current=0.3.4 uptime=263.86 ===
route: fscanf
=== pinging gateway failed, debugging connection ===
############ debug start ##############
### /etc/init.d/sshd start
Starting dropbear sshd: OK
route: fscanf
### ifconfig -a
eth0      Link encap:Ethernet  HWaddr FA:16:3E:DC:80:CA  
          inet6 addr: fe80::f816:3eff:fedc:80ca/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6620 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:426454 (416.4 KiB)  TX bytes:1132 (1.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1020 (1020.0 B)  TX bytes:1020 (1020.0 B)

### route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
route: fscanf
### cat /etc/resolv.conf
cat: can't open '/etc/resolv.conf': No such file or directory
### gateway not found

原因:

subnet未设置dhcp

解决方法:

    1. 在创建实例时,在Configuration选项卡中,勾选Configuration Drive以启用此功能。(推荐)
    2. 在openstack网络配置的子网Subnet Details中勾选Enable DHCP以启用DHCP。
posted @ 2019-08-16 14:30  kissrule  阅读(341)  评论(0编辑  收藏  举报