<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Amit,</div>
<div><br>
</div>
<div>For Glance, all the user-specified image metadata must be String data type.</div>
<div><br>
</div>
<div>You can see this in the image schema [0], where "additionalProperties": {"type": "string"}</div>
<div><br>
</div>
<div>(The only image properties that are *not* strings are those assigned non-string types in the schema.)</div>
<div><br>
</div>
<div>So for your example, you need:</div>
<div>    metadata = {'hw_numa_nodes': '2'}</div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>Hope that helps!</div>
<div><br>
</div>
<div>[0] http://developer.openstack.org/api-ref/image/v2/?expanded=show-image-schema-detail</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div>On 9/28/16, 2:45 AM, "Amit Uniyal" <<a href="mailto:auniyal61@gmail.com">auniyal61@gmail.com</a>> wrote:</div>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr"><span style="font-size:12.8px">Hi,</span>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">I am using python-openstackclient and os_client_config</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">My requirement is, i want to update, my image metadata ....</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">i made two objects, by which i think i may achieve it:</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">nova = os_client_config.make_client('<wbr>compute')</div>
<div style="font-size:12.8px">glance = os_client_config.make_client('<wbr>images')</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">example: metadata = {'hw_numa_nodes': 2,}</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">i tried it many things, but not get succeed,  like:</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">n_im = nova.images.get(<image_id>)</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">nova.images.set_meta(n_im, metadata), or</div>
<div style="font-size:12.8px">n_im.manager.set_meta(n_im, metadata)</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"> ........ and many other also ..</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">please suggest what would be the proper way to do it,</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Thanks</div>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>