Bug 741790

Summary: instance.stop needs to be instance.terminate when using python-boto-2.0-1.fc15.noarch
Product: [Retired] CloudForms Cloud Engine Reporter: chris alfonso <calfonso>
Component: imagefactoryAssignee: Ian McLeod <imcleod>
Status: CLOSED ERRATA QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 1.0.0CC: akarol, dajohnso, deltacloud-maint, dgao, hbrock, jrd, ssachdev
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-15 20:12:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description chris alfonso 2011-09-27 21:51:30 UTC
Description of problem:
ebs backed images are not properly stopped when pushing a fedora image to ec2.  Fedora_ec2_Builder.py needs to call instance.terminate() instead of instance.stop().

Comment 1 wes hayutin 2011-09-28 00:01:16 UTC
note.. this is an issue when pushing fedora, seems to work w/ RHEL.
Are there different boto calls for fedora vs RHEL?? that seems crazy to me.  Just out of curiosity where is that script.. Fedora_ec2_Builder.py?

recreated:

2011-09-27 18:07:43,355 INFO imgfac.ImageWarehouse.ImageWarehouse pid(4541) Message: Creating a bucket returned status 500.
2011-09-27 18:07:43,358 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(4541) Message: Setting metadata ({'target_image': 'ab6848f3-7e99-490f-b14f-039479fd2e64', 'uuid': 'd591b1ef-c417-479a-bd39-11fee31cadea', 'icicle': 'edb742c7-73f3-48ff-b61a-a31745c2e47a', 'target_identifier': 'ami-d9b07db0', 'object_type': 'provider_image', 'provider': 'ec2-us-east-1'}) for http://localhost:9090/provider_images/d591b1ef-c417-479a-bd39-11fee31cadea
2011-09-27 18:07:43,365 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder pid(4541) Message: Stopping EC2 instance and deleting temp security group
2011-09-27 18:07:44,858 ERROR boto pid(4541) Message: 400 Bad Request
2011-09-27 18:07:44,858 ERROR boto pid(4541) Message: <?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>UnsupportedOperation</Code><Message>The instance 'i-6481ee04' does not have an 'ebs' root device type and cannot be stopped.</Message></Error></Errors><RequestID>85fe2245-7db1-4364-846f-de4170fa6030</RequestID></Response>
2011-09-27 18:07:44,859 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder pid(4541) Message: Exception caught in ImageFactory
2011-09-27 18:07:44,889 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder pid(4541) Message: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_ec2_Builder.py", line 425, in push_image
    credentials)
  File "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_ec2_Builder.py", line 664, in push_image_snapshot_ec2
    instance.stop()
  File "/usr/lib/python2.7/site-packages/boto/ec2/instance.py", line 248, in stop
    rs = self.connection.stop_instances([self.id])
  File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 655, in stop_instances
    [('item', Instance)], verb='POST')
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 680, in get_list
    raise self.ResponseError(response.status, response.reason, body)
EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>UnsupportedOperation</Code><Message>The instance 'i-6481ee04' does not have an 'ebs' root device type and cannot be stopped.</Message></Error></Errors><RequestID>85fe2245-7db1-4364-846f-de4170fa6030</RequestID></Response>

2011-09-27 18:07:44,889 DEBUG imgfac.BuildJob.BuildAdaptor pid(4541) Message: Raising event with agent handler (<ImageFactoryAgent(Thread-1, initial)>), changed status from PUSHING to FAILED

Comment 2 wes hayutin 2011-09-28 00:02:26 UTC
[root@unused conductor]# rpm -qa | grep aeolus
aeolus-conductor-0.4.0-0.20110926211730git1cc372b.fc15.noarch
aeolus-conductor-daemons-0.4.0-0.20110926211730git1cc372b.fc15.noarch
aeolus-all-0.4.0-0.20110926211730git1cc372b.fc15.noarch
aeolus-conductor-doc-0.4.0-0.20110926211730git1cc372b.fc15.noarch
aeolus-conductor-devel-0.4.0-0.20110926211730git1cc372b.fc15.noarch
rubygem-aeolus-image-0.1.0-3.20110919115936gitd1d24b4.fc15.noarch
aeolus-configure-2.0.2-4.20110926142838git5044e56.fc15.noarch
[root@unused conductor]#

Comment 3 chris alfonso 2011-09-28 02:29:59 UTC
(In reply to comment #1)
> note.. this is an issue when pushing fedora, seems to work w/ RHEL.
> Are there different boto calls for fedora vs RHEL?? that seems crazy to me. 
> Just out of curiosity where is that script.. Fedora_ec2_Builder.py?
> 
> recreated:
> 
> 2011-09-27 18:07:43,355 INFO imgfac.ImageWarehouse.ImageWarehouse pid(4541)
> Message: Creating a bucket returned status 500.
> 2011-09-27 18:07:43,358 DEBUG imgfac.ImageWarehouse.ImageWarehouse pid(4541)
> Message: Setting metadata ({'target_image':
> 'ab6848f3-7e99-490f-b14f-039479fd2e64', 'uuid':
> 'd591b1ef-c417-479a-bd39-11fee31cadea', 'icicle':
> 'edb742c7-73f3-48ff-b61a-a31745c2e47a', 'target_identifier': 'ami-d9b07db0',
> 'object_type': 'provider_image', 'provider': 'ec2-us-east-1'}) for
> http://localhost:9090/provider_images/d591b1ef-c417-479a-bd39-11fee31cadea
> 2011-09-27 18:07:43,365 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder
> pid(4541) Message: Stopping EC2 instance and deleting temp security group
> 2011-09-27 18:07:44,858 ERROR boto pid(4541) Message: 400 Bad Request
> 2011-09-27 18:07:44,858 ERROR boto pid(4541) Message: <?xml version="1.0"
> encoding="UTF-8"?>
> <Response><Errors><Error><Code>UnsupportedOperation</Code><Message>The instance
> 'i-6481ee04' does not have an 'ebs' root device type and cannot be
> stopped.</Message></Error></Errors><RequestID>85fe2245-7db1-4364-846f-de4170fa6030</RequestID></Response>
> 2011-09-27 18:07:44,859 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder
> pid(4541) Message: Exception caught in ImageFactory
> 2011-09-27 18:07:44,889 DEBUG imgfac.builders.BaseBuilder.Fedora_ec2_Builder
> pid(4541) Message: Traceback (most recent call last):
>   File
> "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_ec2_Builder.py", line
> 425, in push_image
>     credentials)
>   File
> "/usr/lib/python2.7/site-packages/imgfac/builders/Fedora_ec2_Builder.py", line
> 664, in push_image_snapshot_ec2
>     instance.stop()
>   File "/usr/lib/python2.7/site-packages/boto/ec2/instance.py", line 248, in
> stop
>     rs = self.connection.stop_instances([self.id])
>   File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 655, in
> stop_instances
>     [('item', Instance)], verb='POST')
>   File "/usr/lib/python2.7/site-packages/boto/connection.py", line 680, in
> get_list
>     raise self.ResponseError(response.status, response.reason, body)
> EC2ResponseError: EC2ResponseError: 400 Bad Request
> <?xml version="1.0" encoding="UTF-8"?>
> <Response><Errors><Error><Code>UnsupportedOperation</Code><Message>The instance
> 'i-6481ee04' does not have an 'ebs' root device type and cannot be
> stopped.</Message></Error></Errors><RequestID>85fe2245-7db1-4364-846f-de4170fa6030</RequestID></Response>
> 
> 2011-09-27 18:07:44,889 DEBUG imgfac.BuildJob.BuildAdaptor pid(4541) Message:
> Raising event with agent handler (<ImageFactoryAgent(Thread-1, initial)>),
> changed status from PUSHING to FAILED

Yes, this is just for pushing Fedora guest images.  The Fedora_ec2_Builder.py is laid down by image factory.

Comment 4 wes hayutin 2011-09-28 16:37:19 UTC
making sure all the bugs are at the right version for future queries

Comment 8 wes hayutin 2011-10-11 14:25:19 UTC
verified in 0.4.0 build

Comment 9 wes hayutin 2011-10-11 14:29:03 UTC
taking off tracker

Comment 11 errata-xmlrpc 2012-05-15 20:12:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0588.html