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