<div dir="ltr">I figured out that after I cherry picked the code at <a href="https://review.openstack.org/#/c/136374/" target="_blank" style="font-size:12.8000001907349px">https://review.openstack.org/#/c/136374/</a>, I will encounter a 500 error while using glance api 2.0.<div>Could anyone possibly let me know how to get this error around?</div><div>Here is my log:</div><div><br></div><div>







<p class="">2015-03-25 22:04:54.088 WARNING oslo_config.cfg [req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50 87ab685d55af4882b9af51e3d28</p>
<p class="">6ab0b] Option "sql_connection" from group "DEFAULT" is deprecated. Use option "connection" from group "database".</p>
<p class="">2015-03-25 22:04:54.104 DEBUG oslo_db.sqlalchemy.session [req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50 87ab685d55af4882b9</p>
<p class="">af51e3d286ab0b] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_</p>
<p class="">AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION from (pid=63674) _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/session.p</p>
<p class="">y:513</p>
<p class="">2015-03-25 22:04:54.156 INFO eventlet.wsgi.server [req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50 87ab685d55af4882b9af51e3d</p>
<p class="">286ab0b] Traceback (most recent call last):</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 427, in handle_one_response</p>
<p class="">    result = self.application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class="">  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__</p>
<p class="">    response = req.get_response(self.application)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send</p>
<p class="">    application, catch_exc_info=False)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application</p>
<p class="">    app_iter = application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/osprofiler/web.py", line 99, in __call__</p>
<p class="">    return request.get_response(self.application)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send</p>
<p class="">    application, catch_exc_info=False)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application</p>
<p class="">    app_iter = application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 634, in __call__</p>
<p class="">    return self._call_app(env, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 554, in _call_app</p>
<p class="">    return self._app(env, _fake_start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class=""> File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__</p>
<p class="">    response = req.get_response(self.application)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send</p>
<p class="">    application, catch_exc_info=False)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application</p>
<p class="">    app_iter = application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class="">  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__</p>
<p class="">    response = req.get_response(self.application)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send</p>
<p class="">    application, catch_exc_info=False)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application</p>
<p class="">    app_iter = application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class="">  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__</p>
<p class="">    response = req.get_response(self.application)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send</p>
<p class="">    application, catch_exc_info=False)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application</p>
<p class="">    app_iter = application(self.environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/paste/urlmap.py", line 203, in __call__</p>
<p class="">    return app(environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__</p>
<p class="">    return resp(environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 136, in __call__</p>
<p class="">    response = self.app(environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__</p>
<p class="">    return resp(environ, start_response)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__</p>
<p class="">    resp = self.call_func(req, *args, **self.kwargs)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func</p>
<p class="">    return self.func(req, *args, **kwargs)</p>
<p class="">  File "/opt/stack/glance/glance/common/wsgi.py", line 777, in __call__</p>
<p class="">    request, **action_args)</p>
<p class="">  File "/opt/stack/glance/glance/common/wsgi.py", line 801, in dispatch</p>
<p class="">    return method(*args, **kwargs)</p>
<p class="">  File "/opt/stack/glance/glance/api/v2/images.py", line 126, in show</p>
<p class="">    return image_repo.get(image_id)</p>
<p class="">File "/opt/stack/glance/glance/api/authorization.py", line 109, in get</p>
<p class="">    image = self.image_repo.get(image_id)</p>
<p class="">  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get</p>
<p class="">    return self.helper.proxy(self.base.get(item_id))</p>
<p class="">  File "/opt/stack/glance/glance/api/policy.py", line 115, in get</p>
<p class="">    image = super(ImageRepoProxy, self).get(image_id)</p>
<p class="">  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get</p>
<p class="">    return self.helper.proxy(self.base.get(item_id))</p>
<p class="">  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get</p>
<p class="">    return self.helper.proxy(self.base.get(item_id))</p>
<p class="">  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get</p>
<p class="">    return self.helper.proxy(self.base.get(item_id))</p>
<p class="">  File "/opt/stack/glance/glance/db/__init__.py", line 69, in get</p>
<p class="">    db_api_image = dict(self.db_api.image_get(self.context, image_id))</p>
<p class="">  File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 203, in image_get</p>
<p class="">    force_show_deleted=force_show_deleted)</p>
<p class="">  File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 238, in _image_get</p>
<p class="">    image = query.one()</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2398, in one</p>
<p class="">    ret = list(self)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2441, in __iter__</p>
<p class="">    return self._execute_and_instances(context)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2456, in _execute_and_instances</p>
<p class="">    result = conn.execute(querycontext.statement, self._params)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 841, in execute</p>
<p class="">    return meth(self, multiparams, params)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection</p>
<p class="">    return connection._execute_clauseelement(self, multiparams, params)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 938, in _execute_clauseelement</p>
<p class="">    compiled_sql, distilled_params</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1070, in _execute_context</p>
<p class="">    context)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/compat/handle_error.py", line 261, in _handle_dbapi_exception</p>
<p class="">    e, statement, parameters, cursor, context)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1267, in _handle_dbapi_exception</p>
<p class="">    util.raise_from_cause(newraise, exc_info)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause</p>
<p class="">    reraise(type(exception), exception, tb=exc_tb)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1063, in _execute_context</p>
<p class="">    context)</p>
<p class="">  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 442, in do_execute</p>
<p class="">    cursor.execute(statement, parameters)</p>
<p class="">  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute</p>
<p class="">    self.errorhandler(self, exc, value)</p>
<p class="">  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler</p>
<p class=""> raise errorclass, errorvalue</p>
<p class="">OperationalError: (OperationalError) (1054, "Unknown column 'images.visibility' in 'field list'") 'SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, <a href="http://images.id">images.id</a> AS images_id, <a href="http://images.name">images.name</a> AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.virtual_size AS images_virtual_size, images.status AS images_status, images.visibility AS images_visibility, images.is_public AS images_is_public, images.checksum AS images_checksum, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, <a href="http://image_properties_1.id">image_properties_1.id</a> AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, <a href="http://image_properties_1.name">image_properties_1.name</a> AS image_properties_1_name, image_properties_1.value AS image_properties_1_value, image_locations_1.created_at AS image_locations_1_created_at, image_locations_1.updated_at AS image_locations_1_updated_at, image_locations_1.deleted_at AS image_locations_1_deleted_at, image_locations_1.deleted AS image_locations_1_deleted, <a href="http://image_locations_1.id">image_locations_1.id</a> AS image_locations_1_id, image_locations_1.image_id AS image_locations_1_image_id, image_locations_1.value AS image_locations_1_value, image_locations_1.meta_data AS image_locations_1_meta_data, image_locations_1.status AS image_locations_1_status \nFROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON <a href="http://images.id">images.id</a> = image_properties_1.image_id LEFT OUTER JOIN image_locations AS image_locations_1 ON <a href="http://images.id">images.id</a> = image_locations_1.image_id \nWHERE <a href="http://images.id">images.id</a> = %s' ('4adda55e-fa6e-4605-aa42-aa5faabc04b8',)</p>
<p class="">2015-03-25 22:04:54.163 INFO eventlet.wsgi.server [req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50 87ab685d55af4882b9af51e3d286ab0b] 172.16.152.171 - - [25/Mar/2015 22:04:54] "GET /v2/images/4adda55e-fa6e-4605-aa42-aa5faabc04b8 HTTP/1.1" 500 139 0.078274</p>
<p class=""><br></p><p class=""><br></p><p class="">Any response will be highly appreciated,</p><p class=""><br></p><p class="">Su</p></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">Su Zhang<br>Ph.D Candidate<br>Computing and Information Sciences<br>Kansas State University</div>
</div>