標籤:openstack常見問題
1、在web介面找到要恢複的虛擬機器
2、查看虛擬機器的雲硬碟ID
3、列如:雲硬碟的ID是 49a426c8-6a9c-4047-a100-8ad07885952c
4、從資料庫cinder庫中,卸載雲硬碟和虛擬機器的掛載
1)、查看此雲硬碟的資訊
mysql> select * from volumes where id="49a426c8-6a9c-4047-a100-8ad07885952c";
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+--------------------------------------+------------+----------------------------+--------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
| created_at | updated_at | deleted_at | deleted | id | ec2_id | user_id | project_id | host | size | availability_zone | instance_uuid | mountpoint | attach_time | status | attach_status | scheduled_at | launched_at | terminated_at | display_name | display_description | provider_location | provider_auth | snapshot_id | volume_type_id | source_volid | bootable | attached_host | provider_geometry | _name_id | encryption_key_id | migration_status |
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+--------------------------------------+------------+----------------------------+--------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
| 2014-08-07 14:54:04 | 2014-08-07 14:54:08 | NULL | 0 | 49a426c8-6a9c-4047-a100-8ad07885952c | NULL | 84a36a3ff48a44e89ef2d29b05f902bf | 4c86beee9fee46038b979f11e9fc5520 | os-node1 | 100 | nova | 37767555-6f49-4f84-aa96-c08f176f10d3 | vda | 2014-08-07T14:54:08.052233 | in-use | attached | 2014-08-07 14:54:04 | 2014-08-07 14:54:05 | NULL | | | NULL | NULL | 128cfccf-b1aa-4778-b9c6-32d251d05b45 | 64efb028-794c-4a7c-9cdf-9e8895222fab | NULL | 1 | NULL | NULL | NULL | NULL | NULL |
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+--------------------------------------+------------+----------------------------+--------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
1 row in set (0.00 sec)
2)、卸載雲硬碟和虛擬機器的掛載關係
mysql> update volumes set instance_uuid=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
mysql> update volumes set mountpoint=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
mysql> update volumes set attach_time=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
mysql> update volumes set status="available" where id="49a426c8-6a9c-4047-a100-8ad07885952c";
mysql> update volumes set attach_status="detached" where id="49a426c8-6a9c-4047-a100-8ad07885952c";
mysql> update volumes set instance_uuid=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update volumes set mountpoint=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update volumes set attach_time=NULL where id="49a426c8-6a9c-4047-a100-8ad07885952c";
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update volumes set status="available" where id="49a426c8-6a9c-4047-a100-8ad07885952c";
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update volumes set attach_status="detached" where id="49a426c8-6a9c-4047-a100-8ad07885952c";
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
3)、再次查看雲硬碟的資訊
mysql> select * from volumes where id="49a426c8-6a9c-4047-a100-8ad07885952c";
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+---------------+------------+-------------+-----------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
| created_at | updated_at | deleted_at | deleted | id | ec2_id | user_id | project_id | host | size | availability_zone | instance_uuid | mountpoint | attach_time | status | attach_status | scheduled_at | launched_at | terminated_at | display_name | display_description | provider_location | provider_auth | snapshot_id | volume_type_id | source_volid | bootable | attached_host | provider_geometry | _name_id | encryption_key_id | migration_status |
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+---------------+------------+-------------+-----------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
| 2014-08-07 14:54:04 | 2014-08-07 14:54:08 | NULL | 0 | 49a426c8-6a9c-4047-a100-8ad07885952c | NULL | 84a36a3ff48a44e89ef2d29b05f902bf | 4c86beee9fee46038b979f11e9fc5520 | os-node1 | 100 | nova | NULL | NULL | NULL | available | detached | 2014-08-07 14:54:04 | 2014-08-07 14:54:05 | NULL | | | NULL | NULL | 128cfccf-b1aa-4778-b9c6-32d251d05b45 | 64efb028-794c-4a7c-9cdf-9e8895222fab | NULL | 1 | NULL | NULL | NULL | NULL | NULL |
+---------------------+---------------------+------------+---------+--------------------------------------+--------+----------------------------------+----------------------------------+----------+------+-------------------+---------------+------------+-------------+-----------+---------------+---------------------+---------------------+---------------+--------------+---------------------+-------------------+---------------+--------------------------------------+--------------------------------------+--------------+----------+---------------+-------------------+----------+-------------------+------------------+
1 row in set (0.00 sec)
mysql>
5、在dashboard介面查看雲硬碟的狀態,此時就可以用這個雲硬碟建立虛擬機器了
6、用上面的雲硬碟在其他的宿主機建立一個虛擬機器恢複故障的虛擬機器。
本文出自 “zhanguo1110” 部落格,請務必保留此出處http://zhanguo1110.blog.51cto.com/5750817/1543029