[Bug 977765] [NEW] Image registration (ec2) is broken using deprecated auth

Adam Gandelman 977765 at bugs.launchpad.net
Tue Apr 10 06:55:31 UTC 2012


Public bug reported:

It seems image registration via ec2 no longer functions when using
deprecated auth.   Reproducible using Essex or deploying devstack,
changing it to use deprecated auth (in both nova and glance), creating
project/user/zipfile via nova-manage and running:

ubuntu at ip-10-252-35-183:~$ truncate -s 1M testimg.img
ubuntu at ip-10-252-35-183:~$ cloud-publish-image x86_64 testimg.img testbucket -vv
Tue Apr 10 06:49:01 UTC 2012: using testbucket/testimg.img for --name
[image ] testimg.img => testbucket/testimg.img 
Tue Apr 10 06:49:01 UTC 2012: checking for existing registered image at testbucket/testimg.img.manifest.xml
Tue Apr 10 06:49:02 UTC 2012: bundling image testimg.img
Tue Apr 10 06:49:03 UTC 2012: upload testbucket/testimg.img.manifest.xml
Tue Apr 10 06:49:03 UTC 2012: register testbucket/testimg.img.manifest.xml
Tue Apr 10 06:49:04 UTC 2012: registered at testbucket/testimg.img.manifest.xml as ami-0000000a
Tue Apr 10 06:49:04 UTC 2012: ami-0000000a testbucket/testimg.img.manifest.xml
ami-0000000a	testbucket/testimg.img.manifest.xml
ubuntu at ip-10-252-35-183:~$ euca-describe-images ami-0000000a
ImageNotFound: Image ami-0000000a could not be found.

In nova-api.log, after the intial upload appears to have completed,:

2012-04-10 06:49:04 INFO nova.api.ec2 [req-0ee2216b-15c5-4e2b-b0d3-e605ccf4b505 admin test] 0.175827s 10.252.35.183 POST /services/Cloud/ CloudController:RegisterImage 200 [Boto/2.2.2 (linux2)] application/x-www-form-urlencoded text/xml
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 97, in wait
    readers.get(fileno, noop).cb(fileno)
  File "/opt/stack/nova/nova/image/s3.py", line 290, in delayed_create
    self.service.update(context, image_uuid, metadata)
  File "/opt/stack/nova/nova/image/glance.py", line 300, in update
    self.show(context, image_id)
  File "/opt/stack/nova/nova/image/glance.py", line 244, in show
    raise exception.ImageNotFound(image_id=image_id)
ImageNotFound: Image c4e23453-0473-40e7-b2d6-8f485500b8da could not be found.
Removing descriptor: 7


The exception is coming from nova.image.glance._is_image_available()  It appears the request never embeds the required data in the image properties during upload into glance to satisfy a call to _is_image_available() for the deprecated auth case, specifically user_id/project_id.  The metadata prior to being sent to glance looks like:

{'container_format': 'ami',
 'disk_format': 'ami',
 'is_public': False,
 'name': u'testbucket/testimg.img',
 'properties': {'architecture': 'x86_64',
                'image_location': u'testbucket/testimg.img.manifest.xml',
                'image_state': 'pending'},
 'status': 'queued'}


Adding this information into the metadata for the deprecated_auth case as follows  http://paste.ubuntu.com/922918/ seems to get the job done, though I'm not sure this is expected to happen elsewhere.

** Affects: nova
     Importance: Undecided
         Status: New

** Affects: nova (Ubuntu)
     Importance: High
         Status: New


** Tags: ubuntu-openstack-upgrade

** Also affects: nova (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: nova (Ubuntu)
   Importance: Undecided => High

** Tags added: ubuntu-openstack-upgrade

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nova in Ubuntu.
https://bugs.launchpad.net/bugs/977765

Title:
  Image registration (ec2) is broken using deprecated auth

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/977765/+subscriptions



More information about the Ubuntu-server-bugs mailing list