User cannot set arbitary IDs for images

Bug #1577821 reported by Asad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

The glance command line enables user to supply ID for the image
while creating it using the`glance image-create` command.

However, the backend imposes that the ID of an image be a UUID.

There is no meaning of letting user supply ID as parameter, if the ID
needs to be a UUID.
User should be able to set custom ID for images as per need.

Also, the regular expression for the image ID is hard coded in the
backend. It will be nice if it is configurable in `schema-image.json`

Asad (sid-asad-siddiqui)
description: updated
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Can you provide an example of a command which currently fails which you would like to see working?

Revision history for this message
Asad (sid-asad-siddiqui) wrote :

Below is the command:

glance image-create --name "cirros-0.3.4-x86_64-2" --file ~/images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress --property os-name=cirros-2 --property os_version=0.3.4 --property os_arch=x86_64 --property disk_size=32MB --property os_edition=server --id=cirros-034-x86-64-server

It fails with the following error:

Unable to set 'id' to 'cirros-034-x86-64-server'. Reason: u'cirros-034-x86-64-server' does not match u'^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'

Failed validating u'pattern' in schema[u'properties'][u'id']:
    {u'description': u'An identifier for the image',
     u'pattern': u'^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$',
     u'type': u'string'}

On instance[u'id']:
    u'cirros-034-x86-64-server'

Note: It might be noted that the desired feature of being able to specify custom ID is available in nova flavors.
ID is a base properties for flavors also, but still users can specify custom values.

Revision history for this message
Asad (sid-asad-siddiqui) wrote :

It may also be noted that updating regular expression in glance API (api/v2/images.py to be specific)
does not solve the problem completely. Although, this change allows user to create image with custom ID,
the nova API does not allow the user to boot a server with this image. It fails with the error message:

    Invalid imageRef provided.

Apparently, nova API also validates image ID using the same regular expression.

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@Asad:

It seems that this is a feature request. Feature requests for nova are
done with blueprints [1] and with specs [2]. I'll recommend to read [3]
if not yet done. To focus here on bugs which are a failures/errors/faults
I close this one as "Opinion". The effort to implement the requested
feature is then driven only by the blueprint (and spec).

If there are any questions left, feel free to contact me (markus_z)
in the IRC channel #openstack-nova

[1] https://blueprints.launchpad.net/nova/
[2] https://github.com/openstack/nova-specs
[3] https://wiki.openstack.org/wiki/Blueprints

Changed in nova:
status: New → Opinion
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.