Open irvingpop opened 9 years ago
I noticed that machine_image will delete the node and client, but it does not destroy the instance it created.
- Create image irving-windows-image from machine irving-windows-image with options {}[2015-07-11T09:06:40-07:00] INFO: [AWS EC2 200 0.078596 0 retries] describe_tags(:filters=>[{:name=>"resource-id",:values=>["ami-f3d023b7"]},{:name=>"resource-type",:values=>["image"]}]) [2015-07-11T09:06:40-07:00] INFO: [AWS EC2 200 0.215079 0 retries] create_tags(:resources=>["ami-f3d023b7"],:tags=>[{:key=>"From-Instance",:value=>"i-ba5f2971"}]) - applying tags {"From-Instance"=>"i-ba5f2971"}[2015-07-11T09:06:40-07:00] INFO: Processing chef_data_bag[machine_image] action create (basic_chef_client::block line 62) [2015-07-11T09:06:40-07:00] INFO: HTTP Request Returned 404 Object Not Found: error - create data bag machine_image at https://ip-ub-backend1-trusty-aws-1164570181.us-west-2.elb.amazonaws.com/organizations/ponyville[2015-07-11T09:06:40-07:00] INFO: Processing chef_data_bag_item[machine_image/irving-windows-image] action create (basic_chef_client::block line 65) [2015-07-11T09:06:41-07:00] INFO: HTTP Request Returned 404 Object Not Found: Cannot load data bag item irving-windows-image for data bag machine_image - create data bag item irving-windows-image at https://ip-ub-backend1-trusty-aws-1164570181.us-west-2.elb.amazonaws.com/organizations/ponyville - add reference = {"driver_version"=>"1.2.1", "image_id"=>"ami-f3d023b7", "allocated_at"=>1436630800} - add driver_url = "aws:default:us-west-1" - add run_list = [][2015-07-11T09:06:41-07:00] INFO: Processing chef_data_bag_item[images/irving-windows-image] action delete (basic_chef_client::block line 96) [2015-07-11T09:06:41-07:00] INFO: HTTP Request Returned 404 Object Not Found: error [2015-07-11T09:06:41-07:00] INFO: [AWS EC2 200 0.107433 0 retries] describe_images(:filters=>[{:name=>"image-id",:values=>["ami-f3d023b7"]}]) [2015-07-11T09:06:41-07:00] INFO: [AWS EC2 200 0.07065 0 retries] describe_images(:filters=>[{:name=>"image-id",:values=>["ami-f3d023b7"]}]) [2015-07-11T09:06:41-07:00] INFO: [AWS EC2 200 0.068333 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - Waiting for image to be ready ...[2015-07-11T09:06:41-07:00] INFO: [AWS EC2 200 0.078408 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - waiting for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:06:41-07:00] INFO: [AWS EC2 200 0.067531 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 0/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:06:52-07:00] INFO: [AWS EC2 200 0.18853 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 10/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:02-07:00] INFO: [AWS EC2 200 0.20279 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 20/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:12-07:00] INFO: [AWS EC2 200 0.185638 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 30/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:22-07:00] INFO: [AWS EC2 200 0.212472 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 40/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:32-07:00] INFO: [AWS EC2 200 0.209802 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 50/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:43-07:00] INFO: [AWS EC2 200 0.641463 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 60/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:07:53-07:00] INFO: [AWS EC2 200 0.20134 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 70/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:03-07:00] INFO: [AWS EC2 200 0.200919 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 80/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:14-07:00] INFO: [AWS EC2 200 0.220103 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 90/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:24-07:00] INFO: [AWS EC2 200 0.205107 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 100/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:34-07:00] INFO: [AWS EC2 200 0.230238 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 110/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:45-07:00] INFO: [AWS EC2 200 0.713975 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 120/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:08:55-07:00] INFO: [AWS EC2 200 0.198693 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 130/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:05-07:00] INFO: [AWS EC2 200 0.220641 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 140/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:16-07:00] INFO: [AWS EC2 200 0.21671 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 150/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:26-07:00] INFO: [AWS EC2 200 0.205143 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 160/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:36-07:00] INFO: [AWS EC2 200 0.236448 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 170/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:47-07:00] INFO: [AWS EC2 200 0.688414 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 180/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:09:57-07:00] INFO: [AWS EC2 200 0.205998 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - been waiting 190/300 -- sleeping 10 seconds for irving-windows-image (ami-f3d023b7 on aws:default:us-west-1) to be ready ...[2015-07-11T09:10:07-07:00] INFO: [AWS EC2 200 0.384453 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) [2015-07-11T09:10:07-07:00] INFO: [AWS EC2 200 0.097031 0 retries] describe_images(:image_ids=>["ami-f3d023b7"]) - Image irving-windows-image is now ready[2015-07-11T09:10:07-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/irving-windows-image [2015-07-11T09:10:07-07:00] INFO: Processing aws_instance[irving-windows-image] (no AWS object id) action destroy (basic_chef_client::block line 506) [2015-07-11T09:10:07-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/irving-windows-image [2015-07-11T09:10:07-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/irving-windows-image [2015-07-11T09:10:07-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/irving-windows-image [2015-07-11T09:10:07-07:00] INFO: Processing chef_node[irving-windows-image] action delete (basic_chef_client::block line 39) - delete node irving-windows-image at https://ip-ub-backend1-trusty-aws-1164570181.us-west-2.elb.amazonaws.com/organizations/ponyville[2015-07-11T09:10:08-07:00] INFO: Processing chef_client[irving-windows-image] action delete (basic_chef_client::block line 43) [2015-07-11T09:10:08-07:00] INFO: chef_client[irving-windows-image] deleted client irving-windows-image at https://ip-ub-backend1-trusty-aws-1164570181.us-west-2.elb.amazonaws.com/organizations/ponyville - delete client irving-windows-image at clients[2015-07-11T09:10:08-07:00] INFO: Processing chef_node[irving-windows-image] action delete (basic_chef_client::block line 91) [2015-07-11T09:10:08-07:00] INFO: HTTP Request Returned 404 Object Not Found: error ...
Hmm, it should be deleting the machine because of https://github.com/chef/chef-provisioning/blob/f476b135f87b7230a7ca6355e6ba882183d97b8c/lib/chef/provider/machine_image.rb#L77 - this needs investigation
I noticed that machine_image will delete the node and client, but it does not destroy the instance it created.