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