Skip to content

Instantly share code, notes, and snippets.

@mancdaz
mancdaz / nuke-instance
Created September 19, 2012 10:39
force remove instance from nova database (including all foreign key constraints)
USE nova;
SET @uuid = '0b8f832f-f013-441a-9f37-51b68f755359';
UPDATE floating_ips SET fixed_ip_id=NULL,host=NULL WHERE fixed_ip_id IN ( SELECT id FROM fixed_ips WHERE instance_id IN ( SELECT id FROM instances WHERE uuid = @uuid ) );
UPDATE fixed_ips SET updated_at=NULL,deleted_at=NULL,deleted=0,instance_id=NULL,allocated=0,leased=0,reserved=0,virtual_interface_id=NULL,host=NULL WHERE instance_id IN ( SELECT id FROM instances WHERE uuid = @uuid );
DELETE FROM security_group_instance_association WHERE instance_id IN ( SELECT id FROM instances WHERE uuid = @uuid );
DELETE FROM instance_info_caches WHERE instance_id IN ( SELECT id FROM instances WHERE uuid = @uuid );
DELETE FROM instances WHERE uuid = @uuid;
@mancdaz
mancdaz / rcpe_deploy-new
Created February 10, 2012 11:35
conceptual implementation of targeted crowbar proposals within rcpe_deploy
{
"id": "rcb deployment setup",
"description": "Setup for deploy script",
"attributes": {
"network": {
"reserved": {
"bastion": "172.31.0.5",
"pxeapp": "172.31.0.6",
"infra": "172.31.0.9",
"infra_mac": "60:eb:69:6e:f0:31",