Failing to create image using glance endpoint version 2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Fix Released
|
Medium
|
Feilong Wang | ||
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-
Exception:
Traceback (most recent call last):
File "/Library/
setattr(image, key, value)
File "/Library/
self.
File "/Library/
raise exceptions.
warlock.
Failed validating 'type' in schema[
{'properties': {'metadata': {'type': 'object'},
'required': ['url', 'metadata'],
'type': 'object'}
#2 Adding a location to an existing image using python-glance client
Running:
glance --debug --os-image-
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://
"json": true,
"headers": {
"
"
},
"timeout": 10000,
"strictSSL": false,
"body": {
"name": "cdos-template6
"
"
"min_ram": 1,
"min_disk": 10,
"locations": [
{
"url": "https:/
}
]
}
request.
Exception:
403 Forbidden\
Can anybody confirm if the glance version 2 image-create REST endpoint even works?
If it does how to consume the API, any docs?
Changed in glance: | |
assignee: | nobody → Fei Long Wang (flwang) |
Changed in glance: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
affects: | glance → python-glanceclient |
Changed in python-glanceclient: | |
milestone: | none → 1.0.0 |
status: | Fix Committed → Fix Released |
Sorry for the late response. Let me explain the 3 cases.
#1 the format you're using for locations is invalid. But that's your fault, it's because current code can't parse a string to dict
#2 you need to add a config 'show_multiple_ locations = True' in your glance-api.conf
#3 current, 'locations' is a reserved attribute, see https:/ /github. com/openstack/ glance/ blob/master/ glance/ domain/ __init_ _.py#L56
But FWIW, we need a fix in glance client to disable the locations parameter. Please let me know if you have any questions.