OpenStack instance is recorded in the instances table in the Nova database, the simplest way is to delete the record.
1.Recycle floatIP
Unbind
Nova Remove-floating-ip Vm_name xx.xx.xx.xx
put IP Pool
Nova Floating-ip-delete xx.xx.xx.xx
2.Delete Instance Records2.1Force Delete
default MySQL The foreign Key association is turned on, and deleting the associated data directly will result in the following error
Cannot delete or update a parent ROW:A FOREIGN KEY constraint fails
can be closed by closing ( SET foreign_key_checks=0; ) to eliminate the error, after the deletion is turned on ( SET Foreign_key_checks=1; ).
Use Nova;
Select Id,display_name,uuid from instances;
Set foreign_key_checks=0;
Delete from instances where id= ' ... ';
Set Foreign_key_checks=1;
2.2.Associate Delete
The foreign Key association is not closed, and all relevant data is deleted before the instance record is deleted.
2.2.1Querying instance Information
Select Id,display_name,uuid from instances;
2.2.2Deletesecurity_group_instance_associationthe data in the table
Delete from security_group_instance_association where instance_uuid= ' ... ';
2.2.3Deleteinstance_info_cachesthe data in the table
Delete from instance_info_caches where id= ...;
2.2.4Deleteblock_device_mappingthe data in the table
Delete from block_device_mapping where instance_uuid= ' ... ';
2.2.5Deleteinstancesthe data in the table
Delete from where id= ' ... ';
This article is from the "Broken Million book" blog, please be sure to keep this source http://powanjuanshu.blog.51cto.com/9779836/1627715
Delete an OpenStack Zombie instance