Created
July 25, 2013 18:13
-
-
Save jkordish/6082303 to your computer and use it in GitHub Desktop.
Clean up the OpenStack Nova Database -- I think I found some of this somewhere else online but can't recall the source. Putting here for perpetuity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM security_group_instance_association WHERE id IN (SELECT id FROM instances WHERE deleted = "1"); | |
DELETE FROM block_device_mapping WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1"); | |
DELETE FROM instance_info_caches WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1"); | |
DELETE FROM instance_system_metadata WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1"); | |
DELETE FROM virtual_interfaces WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1"); | |
UPDATE fixed_ips SET allocated = 0 WHERE instance_uuid IN (SELECT uuid FROM instances WHERE deleted = "1"); | |
DELETE FROM instances WHERE deleted = "1"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment