← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1399778] Re: Failing to create image using glance endpoint version 2

 

** Project changed: glance => python-glanceclient

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1399778

Title:
  Failing to create image using glance endpoint version 2

Status in Python client library for Glance:
  Confirmed

Bug description:
  Not able to create an image utilizing the glance service REST api version 2
  I've tried a few different approaches

  #1 Using the python-glance client

  Running:
  glance --debug --os-image-api-version 2  image-create --locations "https://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-i386-disk1.img";

  Exception:
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/glanceclient/v2/images.py", line 154, in create
      setattr(image, key, value)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/warlock/model.py", line 75, in __setattr__
      self.__setitem__(key, value)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/warlock/model.py", line 50, in __setitem__
      raise exceptions.InvalidOperation(msg)
  warlock.exceptions.InvalidOperation: Unable to set 'locations' to '['{', 'url:', 'https://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-i386-disk1.img,', 'metadata:', '{}', '}']'. Reason: '{' is not of type 'object'

  Failed validating 'type' in schema['properties']['locations']['items']:
      {'properties': {'metadata': {'type': 'object'},
                      'url': {'maxLength': 255, 'type': 'string'}},
       'required': ['url', 'metadata'],
       'type': 'object'}

  
  #2 Adding a location to an existing image using python-glance client

  Running:
  glance --debug --os-image-api-version 2  location-add bf9e453a-8aef-4806-9afe-9546694f814b --url "https://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-i386-disk1.img";

  Exception:
  The administrator has disabled API access to image locations

  
  #3 Sending curl requests directly to glance's version 2 endpoints

  Running:
  Node.js app using request lib

  "requestOptions": {
      "url": "http://controller01.qa.cloud:9292/v2/images";,
      "json": true,
      "headers": {
        "X-Auth-Project-Id": "2136a657f30c4f65895dd95164f4dda6",
        "X-Auth-Token": "ba36f4becfa04740bd524a37404ae29f"
      },
      "timeout": 10000,
      "strictSSL": false,
      "body": {
        "name": "cdos-template6001",
        "container_format": "ovf",
        "disk_format": "raw",
        "min_ram": 1,
        "min_disk": 10,
        "locations": [
          {
            "url": "https://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-i386-disk1.img";,
            "metadata": {}
          }
        ]
      }

  request.post(requestOptions, callback);

  Exception: 
  403 Forbidden\n\nAttribute 'locations' is reserved.\n\n 


  Can anybody confirm if the glance version 2 image-create REST endpoint even works?
  If it does how to consume the API, any docs?

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-glanceclient/+bug/1399778/+subscriptions


References