<div dir="ltr">Hello, it's another topic about glance v2 adoption in Nova, but it's different from the others. I want to declare that there is a set of commits, that make Nova version agnostic and allow to work with both glance apis. The idea of the solution is to determine the current api version in the beginning and make appropriate requests after. <br>(<a href="https://review.openstack.org/#/c/228578/">https://review.openstack.org/#/c/228578/</a>, <a href="https://review.openstack.org/#/c/238309/">https://review.openstack.org/#/c/238309/</a>, <a href="https://review.openstack.org/#/c/259097/">https://review.openstack.org/#/c/259097/</a>)<br><br>Indeed, it requires some additional (and painful) work, but now all tempest tests pass in Jenkins. <br><br>Note: this thread is not about xenplugin, there is another topic, called 'Xenplugin + Glance_v2 = Hate'<br><br>Here the main issues we faced and how we've solved them:<br><br>1. "changes-since" filter for image-list is not supported in v2 api. Steve Lewis made a great job and implemented a set of filters with comparison operators <a href="https://review.openstack.org/#/c/197388/">https://review.openstack.org/#/c/197388/</a>. Filtering by 'changes-since' is completely similar to 'gte:updated_at'.<br><br>2. Filtering by custom properties must have prefix 'property-'. In v2 it's not required.<br><br>3. V2 states that all custom properties must be image attributes, but Nova assumes that they are included in 'properties' dictionary. It's fixed with glanceclient's method 'is_base_property(prop_name)', that returns False in case of custom property.<br><br>4. is_public=True/False is visibility="public"/"private" respectively.<br><br>5. Deleting custom image properties in Nova is performed with 'purge_props' flag. If it's set to True, then all prop names, that are not included in updated data, will be removed. In case of v2 we have to explicitly specify prop names in the list param 'remove_props'. To implement this behaviour, if 'purge_props' is set, we make additional 'get' request to determine the existing properties and put in 'remove_prop' list only those, that are not in updated_data.<br><br>6. My favourite:<br>There is an ability to activate an empty image by just providing 'size = 0': <a href="https://review.openstack.org/#/c/9715/">https://review.openstack.org/#/c/9715/</a>, in this case image will be a collection of metadata. Glance v2 doesn't support this "feature" and that's why we have to implement a very dirty workaround:<br>    * v2 requires, that disk_format and container-format must be set before the activation. if these params are not provided to 'create' method then we hardcode it to 'qcow2' and 'bare'.<br>    * we call 'upload' method with empty data (data = '') to activate image.<br>Me (and the rest glance team) think that this image activation with zero-size is inconsistent and we won't implement it in v2. So, I'm going to ask if Nova really needs this feature and maybe it's possible to make it work without it.<br><br>In conclusion, I want to congratulate you with this huge progress and say there is a big chance that we can deprecate glance v1 in Mitaka cycle.<br><br>Hooray!<br>And Merry Christmas!<br>    <br>--<br>Best regards,<br>Mikhail Fedosin<br></div>