Remove failing VMs in OpenStack
Occasionally OpenStack VMs fail to spawn or fail to terminate and cannot be removed from the VM list. Deleting the VM using the command line or web interface has no effect, they are stuck in the “spawning” or “deleting” state. To get rid of these zombie entries I remove them from the database using the following bash script (pass the machine UUID as parameter):
#!/bin/bash
mysql -uroot -ppassword << EOF
use nova;
DELETE a FROM nova.security_group_instance_association AS a INNER JOIN nova.instances AS b ON a.instance_id=b.id where b.uuid='$1';
DELETEĀ FROM nova.instance_info_caches WHERE instance_id='$1';
DELETEĀ FROM nova.instances WHERE uuid='$1';
EOF
jhalter 3:16 pm on May 13, 2012 Permalink
Thanks, this saved me a lot of time!
askstack 6:41 am on May 16, 2012 Permalink
thanks! I spend at least 4 hours on this problem.
davidpc 12:39 am on May 23, 2012 Permalink
thanks for sharing!
love_essex 1:05 pm on October 25, 2012 Permalink
thanks a lot
jeff 2:13 pm on October 26, 2012 Permalink
thank you!
Max 11:10 pm on November 8, 2012 Permalink
Thank you very much! Helped a lot