[openstack-dev] a question regarding the current status of image "community" visibility support

Su Zhang westlifezs at gmail.com
Thu Mar 26 05:13:43 UTC 2015


I figured out that after I cherry picked the code at
https://review.openstack.org/#/c/136374/, I will encounter a 500 error
while using glance api 2.0.
Could anyone possibly let me know how to get this error around?
Here is my log:

2015-03-25 22:04:54.088 WARNING oslo_config.cfg
[req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50
87ab685d55af4882b9af51e3d28

6ab0b] Option "sql_connection" from group "DEFAULT" is deprecated. Use
option "connection" from group "database".

2015-03-25 22:04:54.104 DEBUG oslo_db.sqlalchemy.session
[req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50
87ab685d55af4882b9

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_

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

y:513

2015-03-25 22:04:54.156 INFO eventlet.wsgi.server
[req-d197339f-dd73-4ad4-88b4-3194d0e23570 8e50cb1c63294e528502abcbdeed8b50
87ab685d55af4882b9af51e3d

286ab0b] Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 427,
in handle_one_response

    result = self.application(self.environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__

    response = req.get_response(self.application)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1320, in send

    application, catch_exc_info=False)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1284, in call_application

    app_iter = application(self.environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/osprofiler/web.py", line 99,
in __call__

    return request.get_response(self.application)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1320, in send

    application, catch_exc_info=False)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1284, in call_application

    app_iter = application(self.environ, start_response)

  File
"/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py",
line 634, in __call__

    return self._call_app(env, start_response)

  File
"/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py",
line 554, in _call_app

    return self._app(env, _fake_start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

 File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__

    response = req.get_response(self.application)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1320, in send

    application, catch_exc_info=False)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1284, in call_application

    app_iter = application(self.environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__

    response = req.get_response(self.application)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1320, in send

    application, catch_exc_info=False)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1284, in call_application

    app_iter = application(self.environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

  File "/opt/stack/glance/glance/common/wsgi.py", line 486, in __call__

    response = req.get_response(self.application)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1320, in send

    application, catch_exc_info=False)

  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line
1284, in call_application

    app_iter = application(self.environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/paste/urlmap.py", line 203,
in __call__

    return app(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in
__call__

    return resp(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line
136, in __call__

    response = self.app(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in
__call__

    return resp(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
__call__

    resp = self.call_func(req, *args, **self.kwargs)

  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
call_func

    return self.func(req, *args, **kwargs)

  File "/opt/stack/glance/glance/common/wsgi.py", line 777, in __call__

    request, **action_args)

  File "/opt/stack/glance/glance/common/wsgi.py", line 801, in dispatch

    return method(*args, **kwargs)

  File "/opt/stack/glance/glance/api/v2/images.py", line 126, in show

    return image_repo.get(image_id)

File "/opt/stack/glance/glance/api/authorization.py", line 109, in get

    image = self.image_repo.get(image_id)

  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get

    return self.helper.proxy(self.base.get(item_id))

  File "/opt/stack/glance/glance/api/policy.py", line 115, in get

    image = super(ImageRepoProxy, self).get(image_id)

  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get

    return self.helper.proxy(self.base.get(item_id))

  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get

    return self.helper.proxy(self.base.get(item_id))

  File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get

    return self.helper.proxy(self.base.get(item_id))

  File "/opt/stack/glance/glance/db/__init__.py", line 69, in get

    db_api_image = dict(self.db_api.image_get(self.context, image_id))

  File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 203, in
image_get

    force_show_deleted=force_show_deleted)

  File "/opt/stack/glance/glance/db/sqlalchemy/api.py", line 238, in
_image_get

    image = query.one()

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py",
line 2398, in one

    ret = list(self)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py",
line 2441, in __iter__

    return self._execute_and_instances(context)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py",
line 2456, in _execute_and_instances

    result = conn.execute(querycontext.statement, self._params)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 841, in execute

    return meth(self, multiparams, params)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py",
line 322, in _execute_on_connection

    return connection._execute_clauseelement(self, multiparams, params)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 938, in _execute_clauseelement

    compiled_sql, distilled_params

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1070, in _execute_context

    context)

  File
"/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/compat/handle_error.py",
line 261, in _handle_dbapi_exception

    e, statement, parameters, cursor, context)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1267, in _handle_dbapi_exception

    util.raise_from_cause(newraise, exc_info)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py",
line 199, in raise_from_cause

    reraise(type(exception), exception, tb=exc_tb)

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
line 1063, in _execute_context

    context)

  File
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line
442, in do_execute

    cursor.execute(statement, parameters)

  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in
execute

    self.errorhandler(self, exc, value)

  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36,
in defaulterrorhandler

 raise errorclass, errorvalue

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,
images.id AS images_id, images.name 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,
image_properties_1.id AS image_properties_1_id, image_properties_1.image_id
AS image_properties_1_image_id, image_properties_1.name 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, image_locations_1.id 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 images.id =
image_properties_1.image_id LEFT OUTER JOIN image_locations AS
image_locations_1 ON images.id = image_locations_1.image_id \nWHERE
images.id = %s' ('4adda55e-fa6e-4605-aa42-aa5faabc04b8',)

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



Any response will be highly appreciated,


Su

On Wed, Mar 25, 2015 at 6:02 PM, Ian Cordasco <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> 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> 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>
> >Email: flwang at catalyst.net.nz
> >Catalyst IT Limited
> >Level 6, Catalyst House, 150 Willis Street, Wellington
> >--------------------------------------------------------------------------
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >Su Zhang
> >
> >
> >
> >
> >
>
>


-- 
Su Zhang
Ph.D Candidate
Computing and Information Sciences
Kansas State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150325/b89302ad/attachment.html>


More information about the OpenStack-dev mailing list