OpenStack 虚机异常断电处理
落城
于 2017-11-10 09:17:36 发布 1908
收藏 2
分类专栏: OpenStack 云计算
版权
OpenStack 同时被 2 个专栏收录
12 篇文章 0 订阅
订阅专栏
云计算
3 篇文章 0 订阅
订阅专栏
一般来说控制节点执行下面两条指令可重启异常断电虚机(虚机状态为shutoff)
nova reset-state --active uuid
nova reboot --hard uuid
如果上面两条指令执行后虚机仍未启动,可以试试下面的方法
查看虚机的信息,可以看到电源状态是4.而正常的应该是1
[root@host]# nova show 880c8601-bcd0-4c97-baad-1376ba984c9b
| OS-EXT-SRV-ATTR:hypervisor_hostname | host-compute (虚机所在计算节点)
| OS-EXT-SRV-ATTR:instance_name | instance-000010b5 (虚机名)
| OS-EXT-STS:power_state | 4 (虚机电源状态)
解决办法:
修改虚机状态和电源状态
nova reset-state --active uuid
进入nova数据库
[root@host]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3821317
Server version: 5.5.36-MariaDB-wsrep MariaDB Server, wsrep_25.9.r3961
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use nova;
MariaDB [nova]> update instances set power_state=1 where uuid="xxxxxxxxxxxxxxxxxxxxx(修改成虚机uuid)";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
登录到虚机所在计算节点 ssh host-compute
virsh list --all 看这个刀片所有的虚机 instance号在nova show 里能看到。
[root@host-compute ~]# virsh list --all
Id Name State
----------------------------------------------------
- instance-00000fae shut off
- instance-00000fc2 shut off
- instance-00000fd8 shut off
- instance-00000fee shut off
启动这个实例
[root@host-compute ~]# virsh start instance-000010d1
————————————————
版权声明:本文为CSDN博主「落城」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u011211976/article/details/78496195