[openstack-dev] [glance] a question regarding the current status of image "community" visibility support
Brian Rosmaita
brian.rosmaita at RACKSPACE.COM
Thu Mar 26 02:40:23 UTC 2015
Su,
The patch you are referring to is a work-in-progress patch. It only partially implements the feature, and as one of the comments in the patch indicates, it's defining an Integer column in the database that might be replaced by an enum. So even if it were a full implementation, it would be dangerous to apply it to your local glance (unless you just wanted to use it in devstack or something).
Since you're interested in the feature, it would be helpful if you'd put a comment on the spec [1] to register your interest. It's been talked about for a long time and could use a groundswell of support to land it in the Liberty release.
cheers,
brian
[1] https://review.openstack.org/#/c/124050/
On 3/25/15, 9:07 PM, "Su Zhang" <westlifezs at gmail.com<mailto:westlifezs at gmail.com>> wrote:
Ian,
Thanks for your response!
I understand the situation that this specification is not accepted as of now.
However, given the fact that someone has already implemented this feature, could you possibly let me know if there is a way for me to apply such feature locally?
Thanks,
Su
On Wed, Mar 25, 2015 at 6:02 PM, Ian Cordasco <ian.cordasco at rackspace.com<mailto:ian.cordasco at rackspace.com>> wrote:
That specification wasn’t accepted for Kilo. This discussion should be
taken to the mailing list anyway (openstack-dev).
On 3/25/15, 19:32, "Su Zhang" <westlifezs at gmail.com<mailto:westlifezs at gmail.com>> wrote:
>
>
>Thanks for your response Fei Long!
>
>
>I switched my environment to glance v2.
>However, I am encountering anther error saying that "community" is not
>one of the valid visibility values.
>Here is the running script in debug mode:
>
>
>su at ubuntu:/opt/stack/glance/glance$ glance --debug image-update
>--visibility community 4adda55e-fa6e-4605-aa42-aa5faabc04b8
>curl -g -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type:
>application/octet-stream' -H 'Accept-Encoding: gzip, deflate, compress'
>-H 'Accept: */*' -H 'X-Auth-Token:
>{SHA1}6ebf15bd27a056d97e4b66d5e6f1a4f27305b7b3'
>http://172.16.152.171:9292/v2/schemas/image
>
>
>HTTP/1.1 200 OK
>date: Thu, 26 Mar 2015 00:21:17 GMT
>content-length: 3867
>content-type: application/json; charset=UTF-8
>x-openstack-request-id: req-req-44ea8ad6-12e9-4a0b-9d93-2127b9f4b4f8
>
>
>{"additionalProperties": {"type": "string"}, "name": "image", "links":
>[{"href": "{self}", "rel": "self"}, {"href": "{file}", "rel":
>"enclosure"}, {"href": "{schema}", "rel": "describedby"}], "properties":
>{"status": {"enum": ["queued", "saving", "active",
> "killed", "deleted", "pending_delete"], "type": "string", "description":
>"Status of the image (READ-ONLY)"}, "tags": {"items": {"type": "string",
>"maxLength": 255}, "type": "array", "description": "List of strings
>related to the image"}, "kernel_id": {"pattern":
>
>"^([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}$", "type": "string", "description": "ID of image stored in
>Glance that should be used as the kernel when booting an AMI-style
>image.", "is_base": false}, "container_format":
> {"enum": [null, "ami", "ari", "aki", "bare", "ovf", "ova"], "type":
>["null", "string"], "description": "Format of the container"}, "min_ram":
>{"type": "integer", "description": "Amount of ram (in MB) required to
>boot image."}, "ramdisk_id": {"pattern":
>"^([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}$",
> "type": "string", "description": "ID of image stored in Glance that
>should be used as the ramdisk when booting an AMI-style image.",
>"is_base": false}, "locations": {"items": {"required": ["url",
>"metadata"], "type": "object", "properties": {"url": {"type":
> "string", "maxLength": 255}, "metadata": {"type": "object"}}}, "type":
>"array", "description": "A set of URLs to access the image file kept in
>external store"}, "visibility": {"enum": ["public", "private"], "type":
>"string", "description": "Scope of image
> accessibility"}, "updated_at": {"type": "string", "description": "Date
>and time of the last image modification (READ-ONLY)"}, "owner": {"type":
>["null", "string"], "description": "Owner of the image", "maxLength":
>255}, "file": {"type": "string", "description":
> "(READ-ONLY)"}, "min_disk": {"type": "integer", "description": "Amount
>of disk space (in GB) required to boot image."}, "virtual_size": {"type":
>["null", "integer"], "description": "Virtual size of image in bytes
>(READ-ONLY)"}, "id": {"pattern":
>"^([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}$",
> "type": "string", "description": "An identifier for the image"}, "size":
>{"type": ["null", "integer"], "description": "Size of image file in bytes
>(READ-ONLY)"}, "instance_uuid": {"type": "string", "description": "ID of
>instance used to create this image.",
> "is_base": false}, "os_distro": {"type": "string", "description":
>"Common name of operating system distribution as specified in
>
>http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-ima
>ges.html
><http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-im
>ages.html>", "is_base": false}, "name": {"type": ["null", "string"],
>"description": "Descriptive name for the image", "maxLength": 255},
>"checksum": {"type": ["null", "string"], "description":
> "md5 hash of image contents. (READ-ONLY)", "maxLength": 32},
>"created_at": {"type": "string", "description": "Date and time of image
>registration (READ-ONLY)"}, "disk_format": {"enum": [null, "ami", "ari",
>"aki", "vhd", "vmdk", "raw", "qcow2", "vdi", "iso"],
> "type": ["null", "string"], "description": "Format of the disk"},
>"os_version": {"type": "string", "description": "Operating system version
>as specified by the distributor", "is_base": false}, "protected":
>{"type": "boolean", "description": "If true, image
> will not be deletable."}, "architecture": {"type": "string",
>"description": "Operating system architecture as specified in
>
>http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-ima
>ges.html
><http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-im
>ages.html>", "is_base": false}, "direct_url": {"type": "string",
>"description": "URL to access the image file kept in external store
>(READ-ONLY)"}, "self": {"type": "string", "description":
> "(READ-ONLY)"}, "schema": {"type": "string", "description":
>"(READ-ONLY)"}}}
>
>
>curl -g -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type:
>application/octet-stream' -H 'Accept-Encoding: gzip, deflate, compress'
>-H 'Accept: */*' -H 'X-Auth-Token:
>{SHA1}6ebf15bd27a056d97e4b66d5e6f1a4f27305b7b3'
>
>http://172.16.152.171:9292/v2/images/4adda55e-fa6e-4605-aa42-aa5faabc04b8
><http://172.16.152.171:9292/v2/images/4adda55e-fa6e-4605-aa42-aa5faabc04b8
>>
>
>
>HTTP/1.1 200 OK
>date: Thu, 26 Mar 2015 00:21:17 GMT
>content-length: 706
>content-type: application/json; charset=UTF-8
>x-openstack-request-id: req-req-7ca17097-37c0-4b47-b070-1ab4e52f463a
>
>
>{"status": "active", "name": "cirros-0.3.2-x86_64-uec", "tags": [],
>"kernel_id": "e979c1b2-d4f1-4dac-a447-4d56005e0d82", "container_format":
>"ami", "created_at": "2015-03-21T01:17:18Z", "ramdisk_id":
>"7ce02482-a74e-4eac-942d-cf489ed2b65b", "disk_format":
> "ami", "updated_at": "2015-03-25T23:44:14Z", "visibility": "private",
>"self": "/v2/images/4adda55e-fa6e-4605-aa42-aa5faabc04b8", "min_disk": 0,
>"protected": false, "id": "4adda55e-fa6e-4605-aa42-aa5faabc04b8", "size":
>25165824, "file": "/v2/images/4adda55e-fa6e-4605-aa42-aa5faabc04b8/file",
> "checksum": "4eada48c2843d2a262c814ddc92ecf2c", "owner":
>"87ab685d55af4882b9af51e3d286ab0b", "virtual_size": null, "min_ram": 0,
>"schema": "/v2/schemas/image"}
>
>
>curl -g -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type:
>application/octet-stream' -H 'Accept-Encoding: gzip, deflate, compress'
>-H 'Accept: */*' -H 'X-Auth-Token:
>{SHA1}6ebf15bd27a056d97e4b66d5e6f1a4f27305b7b3'
>http://172.16.152.171:9292/v2/schemas/image
>
>
>HTTP/1.1 200 OK
>date: Thu, 26 Mar 2015 00:21:17 GMT
>content-length: 3867
>content-type: application/json; charset=UTF-8
>x-openstack-request-id: req-req-3b597321-344a-4114-a90a-133ec2751e56
>
>
>{"additionalProperties": {"type": "string"}, "name": "image", "links":
>[{"href": "{self}", "rel": "self"}, {"href": "{file}", "rel":
>"enclosure"}, {"href": "{schema}", "rel": "describedby"}], "properties":
>{"status": {"enum": ["queued", "saving", "active",
> "killed", "deleted", "pending_delete"], "type": "string", "description":
>"Status of the image (READ-ONLY)"}, "tags": {"items": {"type": "string",
>"maxLength": 255}, "type": "array", "description": "List of strings
>related to the image"}, "kernel_id": {"pattern":
>
>"^([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}$", "type": "string", "description": "ID of image stored in
>Glance that should be used as the kernel when booting an AMI-style
>image.", "is_base": false}, "container_format":
> {"enum": [null, "ami", "ari", "aki", "bare", "ovf", "ova"], "type":
>["null", "string"], "description": "Format of the container"}, "min_ram":
>{"type": "integer", "description": "Amount of ram (in MB) required to
>boot image."}, "ramdisk_id": {"pattern":
>"^([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}$",
> "type": "string", "description": "ID of image stored in Glance that
>should be used as the ramdisk when booting an AMI-style image.",
>"is_base": false}, "locations": {"items": {"required": ["url",
>"metadata"], "type": "object", "properties": {"url": {"type":
> "string", "maxLength": 255}, "metadata": {"type": "object"}}}, "type":
>"array", "description": "A set of URLs to access the image file kept in
>external store"}, "visibility": {"enum": ["public", "private"], "type":
>"string", "description": "Scope of image
> accessibility"}, "updated_at": {"type": "string", "description": "Date
>and time of the last image modification (READ-ONLY)"}, "owner": {"type":
>["null", "string"], "description": "Owner of the image", "maxLength":
>255}, "file": {"type": "string", "description":
> "(READ-ONLY)"}, "min_disk": {"type": "integer", "description": "Amount
>of disk space (in GB) required to boot image."}, "virtual_size": {"type":
>["null", "integer"], "description": "Virtual size of image in bytes
>(READ-ONLY)"}, "id": {"pattern":
>"^([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}$",
> "type": "string", "description": "An identifier for the image"}, "size":
>{"type": ["null", "integer"], "description": "Size of image file in bytes
>(READ-ONLY)"}, "instance_uuid": {"type": "string", "description": "ID of
>instance used to create this image.",
> "is_base": false}, "os_distro": {"type": "string", "description":
>"Common name of operating system distribution as specified in
>
>http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-ima
>ges.html
><http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-im
>ages.html>", "is_base": false}, "name": {"type": ["null", "string"],
>"description": "Descriptive name for the image", "maxLength": 255},
>"checksum": {"type": ["null", "string"], "description":
> "md5 hash of image contents. (READ-ONLY)", "maxLength": 32},
>"created_at": {"type": "string", "description": "Date and time of image
>registration (READ-ONLY)"}, "disk_format": {"enum": [null, "ami", "ari",
>"aki", "vhd", "vmdk", "raw", "qcow2", "vdi", "iso"],
> "type": ["null", "string"], "description": "Format of the disk"},
>"os_version": {"type": "string", "description": "Operating system version
>as specified by the distributor", "is_base": false}, "protected":
>{"type": "boolean", "description": "If true, image
> will not be deletable."}, "architecture": {"type": "string",
>"description": "Operating system architecture as specified in
>
>http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-ima
>ges.html
><http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-im
>ages.html>", "is_base": false}, "direct_url": {"type": "string",
>"description": "URL to access the image file kept in external store
>(READ-ONLY)"}, "self": {"type": "string", "description":
> "(READ-ONLY)"}, "schema": {"type": "string", "description":
>"(READ-ONLY)"}}}
>
>
>Traceback (most recent call last):
> File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py",
>line 644, in main
> args.func(client, args)
> File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py",
>line 108, in do_image_update
> image = gc.images.update(image_id, remove_properties, **fields)
> File
>"/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line
>248, in update
> raise TypeError(utils.exception_to_str(e))
>TypeError: Unable to set 'visibility' to 'community'. Reason: 'community'
>is not one of [u'public', u'private']
>
>
>Failed validating u'enum' in schema[u'properties'][u'visibility']:
> {u'description': u'Scope of image accessibility',
> u'enum': [u'public', u'private'],
> u'type': u'string'}
>
>
>On instance[u'visibility']:
> 'community'
>Unable to set 'visibility' to 'community'. Reason: 'community' is not one
>of [u'public', u'private']
>
>
>Failed validating u'enum' in schema[u'properties'][u'visibility']:
> {u'description': u'Scope of image accessibility',
> u'enum': [u'public', u'private'],
> u'type': u'string'}
>
>
>On instance[u'visibility']:
> 'community'
>su at ubuntu:/opt/stack/glance/glance$
>
>
>
>
>
>The initial code change by the author is at
>
>
>
> modified: db/sqlalchemy/api.py
>new file: db/sqlalchemy/migrate_repo/versions/037_visibility.py
>modified: db/sqlalchemy/models.py
>
>
>
>Could any of you possibly please let me know where else should I make
>some code change to have this error fixed?
>I am new to openstack and any response will be highly appreciated!
>
>
>Su
>
>
>
>
>
>
>On Wed, Mar 25, 2015 at 4:03 PM, Fei Long Wang
><feilong at catalyst.net.nz<mailto:feilong at catalyst.net.nz>> wrote:
>
>visibility is an attribute of glance v2, so please try:
>glance --os-image-api-version 2 image-update --visibility private
>4adda55e-fa6e-4605-aa42-aa5faabc04b8
>
>
>On 26/03/15 11:39, Su Zhang wrote:
>
>
>Hello glance core developers,
>
>
>I recently came across one glance related pending blueprint
>(https://review.openstack.org/#/c/124050/). It raised our interest as we
>also want to implement this community visibility
> for images through glance. However, after cherry picking the code change
>(https://review.openstack.org/#/c/136374/), I was not able to get the
>expected result. Instead, I got the following
> error:
>
>
>
>
>su at ubuntu:/opt/stack/glance/glance/db/sqlalchemy/migrate_repo/versions$
>glance image-update --visibility private
>4adda55e-fa6e-4605-aa42-aa5faabc04b8
>usage: glance [--version] [-d] [-v] [--get-schema] [--timeout TIMEOUT]
>[--no-ssl-compression] [-f] [--os-image-url OS_IMAGE_URL]
>[--os-image-api-version OS_IMAGE_API_VERSION]
>[--profile HMAC_KEY] [-k] [--os-cert OS_CERT]
>[--cert-file OS_CERT] [--os-key OS_KEY] [--key-file OS_KEY]
>[--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
>[--os-username OS_USERNAME] [--os-user-id OS_USER_ID]
>[--os-user-domain-id OS_USER_DOMAIN_ID]
>[--os-user-domain-name OS_USER_DOMAIN_NAME]
>[--os-project-id OS_PROJECT_ID]
>[--os-project-name OS_PROJECT_NAME]
>[--os-project-domain-id OS_PROJECT_DOMAIN_ID]
>[--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
>[--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
>[--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
>[--os-region-name OS_REGION_NAME]
>[--os-auth-token OS_AUTH_TOKEN]
>[--os-service-type OS_SERVICE_TYPE]
>[--os-endpoint-type OS_ENDPOINT_TYPE]
><subcommand> ...
>glance: error: unrecognized arguments: --visibility
>4adda55e-fa6e-4605-aa42-aa5faabc04b8
>
>
>
>
>
>
>
>Could any of you kindly give me some hints regarding how to get the issue
>fixed (if it is fixable)? Or anywhere I can change to code to enable the
>function mentioned in the blueprint?
>
>
>Any response will be highly appreciated!
>
>
>
>
>
>
>
>--
>Su Zhang
>Senior Software Engineer
>Symantec Corp
>
>
>
>
>
>
>
>
>--
>Cheers & Best regards,
>Fei Long Wang (王飞龙)
>--------------------------------------------------------------------------
>Senior Cloud Software Engineer
>Tel: +64-48032246<tel:%2B64-48032246> <tel:%2B64-48032246>
>Email: flwang at catalyst.net.nz<mailto:flwang at catalyst.net.nz>
>Catalyst IT Limited
>Level 6, Catalyst House, 150 Willis Street, Wellington
>--------------------------------------------------------------------------
>
>
>
>
>
>
>
>
>--
>Su Zhang
>
>
>
>
>
--
Su Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150326/9b604f49/attachment.html>
More information about the OpenStack-dev
mailing list