euca-create-image doesn't work

Bug #923546 reported by Tomoe Sugihara
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned

Bug Description

When I run euca-create-image, I get an error. Here's the log when I run euca-create-image i-00000001 -n created-image:

----------------------------
2012-01-30 09:30:09,586 DEBUG nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] action: CreateImage from (pid=17424) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:30:09,586 DEBUG nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] arg: Name val: created-image from (pid=17424) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:30:09,586 DEBUG nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] arg: InstanceId val: i-00000001 from (pid=17424) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:30:09,624 ERROR nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] Unexpected error raised: wrapped() takes at least 3 arguments (2 given)
(nova.api): TRACE: Traceback (most recent call last):
(nova.api): TRACE: File "/opt/stack/nova/nova/api/ec2/__init__.py", line 460, in __call__
(nova.api): TRACE: result = api_request.invoke(context)
(nova.api): TRACE: File "/opt/stack/nova/nova/api/ec2/apirequest.py", line 90, in invoke
(nova.api): TRACE: result = method(context, **args)
(nova.api): TRACE: File "/opt/stack/nova/nova/api/ec2/cloud.py", line 1536, in create_image
(nova.api): TRACE: self.compute_api.stop(context, instance_id=instance_id)
(nova.api): TRACE: TypeError: wrapped() takes at least 3 arguments (2 given)
(nova.api): TRACE:
2012-01-30 09:30:09,625 ERROR nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] Environment: {"HTTP_AUTHORIZATION": "Basic None", "SCRIPT_NAME": "/services/Cloud", "REQUEST_METHOD": "POST", "PATH_INFO": "/", "SERVER_PROTOCOL": "HTTP/1.0", "HTTP_X_IDENTITY_STATUS": "Confirmed", "HTTP_USER_AGENT": "Boto/2.0 (linux2)", "SERVER_NAME": "192.168.1.138", "REMOTE_ADDR": "192.168.1.138", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "CONTENT_TYPE": "application/x-www-form-urlencoded; charset=UTF-8", "HTTP_HOST": "192.168.1.138:8773", "GATEWAY_INTERFACE": "CGI/1.1", "HTTP_ACCEPT_ENCODING": "identity"}
2012-01-30 09:30:09,625 ERROR nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] UnknownError: An unknown error has occurred. Please try your request again.
2012-01-30 09:30:09,626 INFO nova.api [req-9a280f7c-cd2f-4aa9-8c70-595dccbe3b40 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] 0.146677s 192.168.1.138 POST /services/Cloud/ CloudController:CreateImage 400 [Boto/2.0 (linux2)] application/x-www-form-urlencoded text/xml
---------------------------

Tags: ec2
Revision history for this message
Tomoe Sugihara (tomoe) wrote :
Download full text (6.4 KiB)

I tried the following patch to fix the obvious bugs, but it still doesn't work.
Seems like this feature is not working, or am I missing something?

The patch:
-------------------------------

midokura@midokura-iMac:/opt/stack/nova$ git diff
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 5a3b952..7a18595 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -1533,7 +1533,7 @@ class CloudController(object):

             if vm_state in (vm_states.ACTIVE, vm_states.SHUTOFF):
                 restart_instance = True
- self.compute_api.stop(context, instance_id=instance_id)
+ self.compute_api.stop(context, instance)

             # wait instance for really stopped
             start_time = time.time()
@@ -1549,7 +1549,15 @@ class CloudController(object):
                     raise exception.ApiError(
                         _('Couldn\'t stop instance with in %d sec') % timeout)

- src_image = self._get_image(context, instance['image_ref'])
+ image_uuid = instance['image_ref']
+ image_id = self._get_image_id(context, image_uuid)
+ ec2_image_id = ec2utils.image_ec2_id(image_id)
+
+ print ' image_ref ----------> ', instance['image_ref']
+ print ' ec2_image_id -------> ', ec2_image_id
+
+ src_image = self._get_image(context, ec2_image_id)
+ print' src_image ', src_image
         properties = src_image['properties']
         if instance['root_device_name']:
             properties['root_device_name'] = instance['root_device_name']
---------------------

Another Error:
---------------------
2012-01-30 09:53:55,982 DEBUG keystone.middleware.auth_token [-] Sending request to next app in WSGI pipeline from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:55,983 DEBUG nova.api [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] action: CreateImage from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:55,983 DEBUG nova.api [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] arg: Name val: created-image from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:55,983 DEBUG nova.api [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] arg: InstanceId val: i-00000001 from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:56,020 DEBUG nova.compute.api [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] Going to try to stop 5e32efbc-77ad-4108-a237-e5cf9f5a0ae7 from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:56,101 DEBUG nova.rpc [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] Making asynchronous cast on compute.midokura-iMac... from (pid=23018) debug /opt/stack/nova/nova/log.py:175
2012-01-30 09:53:56,101 DEBUG nova.rpc [req-ad27ede4-b92b-4ca4-8c6e-5349fee5cd0f 5e653de2fb5d4b508012406df77ec445 03c6ffa2bee74bca9bec99e82d872673] Pool creating new conn...

Read more...

Revision history for this message
Tomoe Sugihara (tomoe) wrote :

Has anyone looked into this yet?

Revision history for this message
Chuck Short (zulcss) wrote :

Is this on diablo or essex?

Changed in nova:
status: New → Incomplete
Revision history for this message
Tomoe Sugihara (tomoe) wrote :

This is on Essex. Not sure about Diablo.

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: Incomplete → Confirmed
tags: added: ec2
Revision history for this message
Chuck Short (zulcss) wrote :

Im not able to reproduce this anymore, please re-open if you can on folsom or grizzly.

Changed in nova:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers