openstack虚拟机安装好重启操作–不可思议团队

openstack虚拟机安装好重启操作--小铁笔记

1、

-->cd

-->source adminrc

-->keystone user-list

-->keystone endpoint-list

-->keystone endpoint-list

-->keystone service-list

2、查看glance镜像

-->glance index

3、查看公网:

-->neutron net-list

4、查看内网ID

-->Ext_Net_ID=`neutron net-list | grep ext_net | awk '{ print $2 }'`

-->echo $Ext_Net_ID

。获取内网ID

-->Int_Net_ID=`neutron net-list | grep int_net | awk '{ print $2 }'`

-->echo $Int_Net_ID

5、查看虚拟机

-->nova flavor-list

查看虚拟机状态

-->nova list

6、 查看底层VNC端口

-->virsh list --all

-->virsh vncdisplay 2
:0

7、确保公网畅通

-->ping www.baidu.com

PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from 61.135.169.125: icmp_seq=1 ttl=55 time=4.61 ms
64 bytes from 61.135.169.125: icmp_seq=2 ttl=55 time=1.77 ms

如果网络不通,解决方法;

-->route   #查看网关是否为10.0.2.1不是的话重新设置

-->Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.56.1    0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 br-ex
192.168.56.0    *               255.255.255.0   U     0      0        0 eth0
192.168.57.0    *               255.255.255.0   U     0      0        0 eth1
192.168.58.0    *               255.255.255.0   U     0      0        0 eth2
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

-->route add default gw 10.0.2.1 br-ex

-->route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.1        0.0.0.0         UG    0      0        0 br-ex
default         192.168.56.1    0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 br-ex
192.168.56.0    *               255.255.255.0   U     0      0        0 eth0
192.168.57.0    *               255.255.255.0   U     0      0        0 eth1
192.168.58.0    *               255.255.255.0   U     0      0        0 eth2
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

-->ping www.baidu.com

注意:如果暂时不通,多等1~2分钟就通了

=====================================================================================
8、重启虚拟机

-->nova list

+--------------------------------------+---------------+--------+-----------------------+
| ID                                   | Name          | Status | Networks              |
+--------------------------------------+---------------+--------+-----------------------+
| 1020fb54-d592-4771-ab97-fbc1cdde14bd | Ubuntu_Trusty | ACTIVE | int_net=192.168.100.2 |
+--------------------------------------+---------------+--------+-----------------------+

。重置虚拟机

-->nova reset-state  1020fb54-d592-4771-ab97-fbc1cdde14bd

。停止虚拟机

-->nova stop  1020fb54-d592-4771-ab97-fbc1cdde14bd

。再次查看虚拟机状态:

-->nova list

+--------------------------------------+---------------+---------+-----------------------+
| ID                                   | Name          | Status  | Networks              |
+--------------------------------------+---------------+---------+-----------------------+
| 1020fb54-d592-4771-ab97-fbc1cdde14bd | Ubuntu_Trusty | SHUTOFF | int_net=192.168.100.2 |
+--------------------------------------+---------------+---------+-----------------------+

发现已经变成了:SHUTOFF

。启动虚拟机

-->nova start   1020fb54-d592-4771-ab97-fbc1cdde14bd

。启动后查看机器状态

-->nova list
+--------------------------------------+---------------+--------+-----------------------+
| ID                                   | Name          | Status | Networks              |
+--------------------------------------+---------------+--------+-----------------------+
| 1020fb54-d592-4771-ab97-fbc1cdde14bd | Ubuntu_Trusty | ACTIVE | int_net=192.168.100.2 |
+--------------------------------------+---------------+--------+-----------------------+

发现已经变成ACTIVE了

9、通过VNC访问虚拟机

windows机器安装:VNC-Viewer-5.2.0-Windows

打开登录:

-->VNC Server:  192.168.56.180:0

Encryption:Let VNC Server choose

-->Connect-->Continue (勾选Don't warn me about this again.)

-->username:cirros   #从web界面可以看到

password:cubswin
9、日志排查

-->nova list

+--------------------------------------+---------------+--------+-----------------------+
| ID                                   | Name          | Status | Networks              |
+--------------------------------------+---------------+--------+-----------------------+
| 1020fb54-d592-4771-ab97-fbc1cdde14bd | Ubuntu_Trusty | ACTIVE | int_net=192.168.100.2 |
+--------------------------------------+---------------+--------+-----------------------+

-->nova live-migration 1020fb54-d592-4771-ab97-fbc1cdde14bd   Ubuntu_Trusty

ERROR: Compute service of Ubuntu_Trusty is unavailable at this time. (HTTP 400)
(Request-ID: req-66d5ad7e-b634-436f-9162-05f79caac5c5)

-->nova show req-66d5ad7e-b634-436f-9162-05f79caac5c5  #用法不对

。查看日志

-->nova console-log  1020fb54-d592-4771-ab97-fbc1cdde14bd

。重启apache

-->service apache2 stop

-->service apache2 restart

-->service apache2 start

博主

让学习成为习惯,坚持-共享-开源-自由! 成功者决不放弃,放弃者绝不成功!

相关推荐

嗨、骚年、快来消灭0回复。