OpenStack 虚机异常断电处理

一般来说控制节点执行下面两条指令可重启异常断电虚机(虚机状态为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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值