Amit,

For Glance, all the user-specified image metadata must be String data type.

You can see this in the image schema [0], where "additionalProperties": 
{"type": "string"}

(The only image properties that are *not* strings are those assigned non-string 
types in the schema.)

So for your example, you need:
    metadata = {'hw_numa_nodes': '2'}

It's a little counterintuitive, but the idea is that Glance has know way of 
knowing what kind of metadata you'll want to put on an image, so Glance stores 
everything as a string.  Since it's your metadata, you'll know what data type 
to convert the string to before you use it in a script.

Hope that helps!

[0] 
http://developer.openstack.org/api-ref/image/v2/?expanded=show-image-schema-detail

On 9/28/16, 2:45 AM, "Amit Uniyal" 
<auniya...@gmail.com<mailto:auniya...@gmail.com>> wrote:

Hi,

I am using python-openstackclient and os_client_config

My requirement is, i want to update, my image metadata ....

i made two objects, by which i think i may achieve it:

nova = os_client_config.make_client('compute')
glance = os_client_config.make_client('images')

example: metadata = {'hw_numa_nodes': 2,}


i tried it many things, but not get succeed,  like:

n_im = nova.images.get(<image_id>)

nova.images.set_meta(n_im, metadata), or
n_im.manager.set_meta(n_im, metadata)


 ........ and many other also ..

please suggest what would be the proper way to do it,

Thanks
_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to