chef-provisioning-aws
chef-provisioning-aws copied to clipboard
machine_image :destroy action doesn't remove the AMI or the snapshot
Given the following code
machine_image 'irving-windows-image' do
action :destroy
end
it only removes the data bag entry, doesn't delete the AMI and associated Snapshot as you'd expect:
* machine_image[irving-windows-image] action destroy[2015-07-11T09:51:58-07:00] INFO: Processing machine_image[irving-windows-image] action destroy (@recipe_files::/oc/src/windows-fleet/recipes/destroy.rb line 34)
[2015-07-11T09:51:58-07:00] INFO: HTTP Request Returned 404 Object Not Found: error
[2015-07-11T09:51:58-07:00] INFO: Processing chef_node[irving-windows-image] action delete (basic_chef_client::block line 91)
[2015-07-11T09:51:58-07:00] INFO: HTTP Request Returned 404 Object Not Found: error
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/machine_image/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/images/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: Processing aws_image[irving-windows-image] (no AWS object id) action destroy (basic_chef_client::block line 402)
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/machine_image/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/images/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/machine_image/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/images/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/machine_image/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/data/images/irving-windows-image
[2015-07-11T09:51:59-07:00] INFO: Processing chef_data_bag_item[machine_image/irving-windows-image] action delete (basic_chef_client::block line 96)
- delete data bag item irving-windows-image at https://ip-ub-backend1-trusty-aws-1164570181.us-west-2.elb.amazonaws.com/organizations/ponyville[2015-07-11T09:51:59-07:00] INFO: Processing chef_data_bag_item[images/irving-windows-image] action delete (basic_chef_client::block line 96)
[2015-07-11T09:51:59-07:00] INFO: HTTP Request Returned 404 Object Not Found: error
[2015-07-11T09:51:59-07:00] INFO: Chef Run complete in 4.091186 seconds
I know this was working as expected at one point in time.
I'm going to take a wild guess and say it was caused by 12596ab9365db4566be3bc9a6214e72d69966699.