How to delete an OpenStack Nova zombie instance

Source: Internet
Author: User
Tags mysql delete

http://www.vpsee.com/2011/11/how-to-delete-a-openstack-nova-zombie-instance/

Forced restart of an OpenStack Nova control node the day before the virtual machine disappears, but the euca-describe-instances command shows that instances is still running state, using The Euca-terminate-instances Abort command is still invalid, temporarily calling such a instance "zombie instance (zombie instance)":

# Virsh List

Id Name State

----------------------------------

# euca-describe-instances

Reservation r-bkl83j20 Bangcloud Default

INSTANCE i-0000001d ami-00000002 172.16.39.121 172.16.39.121 running Vpsee (vpseecloud, node00) 0 2011-11-10t12:45:12z Nova aki-00000001 ami-00000000

Reservation R-j335q6ny Bangcloud Default

INSTANCE i-0000001e ami-00000002 172.16.39.122 172.16.39.122 running Vpsee (vpseecloud, node00) 0 2011-11-10t12:54:27z Nova aki-00000001 ami-00000000

# euca-terminate-instances i-0000001d

# euca-terminate-instances I-0000001E

error_deleting issues encountered while removing OpenStack Nova Volume This article mentions the workaround, just manipulate the database directly to delete the records of these 2 zombie instances. Log in to MySQL, use the Nova database, find the ID to remove instance, and then delete:

# mysql-u Root-p

Enter Password:

Mysql> use Nova;

Mysql> select * from instances;

Mysql> Delete from instances where id = ' 29 ';

ERROR 1451 (23000): Cannot delete or update a parent ROW:A FOREIGN KEY constraint fails (' Nova '. ' Virtual_interfaces ', CON STRAINT ' Virtual_interfaces_ibfk_1 ' FOREIGN KEY (' instance_id ') REFERENCES ' instances ' (' ID '))

MySQL Delete ID 29 instance when the foreign key limit error is triggered, the simple way is to temporarily close the foreign key check, and then open after deletion:

Mysql> SET foreign_key_checks=0;

Query OK, 0 rows Affected (0.00 sec)

Mysql> Delete from instances where id = ' 29 ';

Query OK, 1 row affected (0.04 sec)

Mysql> Delete from instances where id = ' 30 ';

Query OK, 1 row affected (0.04 sec)

Mysql> SET Foreign_key_checks=1;

Query OK, 0 rows Affected (0.00 sec)

After deleting instance 29 and 30, verify with the euca-describe-instances command:

# euca-describe-instances

How to delete an OpenStack Nova zombie instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.