Skip to content

Instantly share code, notes, and snippets.

@robertstarmer
Created October 27, 2013 03:48
Show Gist options
  • Save robertstarmer/7177780 to your computer and use it in GitHub Desktop.
Save robertstarmer/7177780 to your computer and use it in GitHub Desktop.
Mysql openstack cleanup
volumes:
use nova;
select id,status,display_name from volumes;
delete from iscsi_targets where volume_id=$id;
delete from volumes where id=$id;
hosts:
select id,uuid,vm_state,display_name from instances;
delete from security_group_instance_association where instance_id=$id;
delete from instance_info_caches where instance_id=$uuid;
delete from instance_metadata where instance_id=$id;
delete from instances where id=$id;
find hosts:
select id,uuid,hostname,host from instances where vm_state='active';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment