)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3164e43eb4ba778a2ad7e98512528f0697b46aed","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This adds simple update/delete of allocations to the resource tracker"},{"line_number":10,"context_line":"using existing places that determine our claim and tracking processes."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Related to blueprint generic-resource-pools"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ia250e6b1b65b16b0ecb97f5cf21e161ff511cb2a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa7ab95a_72ad7d83","line":12,"range":{"start_line":12,"start_character":21,"end_line":12,"end_character":43},"updated":"2016-09-01 19:51:08.000000000","message":"technically this should be \"resource-providers-allocations\"","commit_id":"72920c3876808a69890bcfaaad74ac0d92e571b4"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421abe1255967fd516c65882bb17f45cea9ea189","unresolved":false,"context_lines":[{"line_number":862,"context_line":"                                                         instance,"},{"line_number":863,"context_line":"                                                         sign\u003dsign)"},{"line_number":864,"context_line":"            self.scheduler_client.reportclient.update_instance_allocation("},{"line_number":865,"context_line":"                self.compute_node, instance, sign)"},{"line_number":866,"context_line":"            # new instance, update compute node resource usage:"},{"line_number":867,"context_line":"            self._update_usage(self._get_usage_dict(instance), sign\u003dsign)"},{"line_number":868,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7ab95a_52315959","line":865,"range":{"start_line":865,"start_character":45,"end_line":865,"end_character":49},"updated":"2016-09-01 19:53:58.000000000","message":"super nit: the sign stuff kind of sucks to leak into the report client, we could have just had the RT check is_new_instance or is_removed_instance and called the proper \u0027create_allocation\u0027 and \u0027delete_allocation\u0027 methods on the report client. But that\u0027s a thing we could do later.","commit_id":"72920c3876808a69890bcfaaad74ac0d92e571b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a0a7de9a2fdfb7b68d12c50c47e5d68c5cd42d1","unresolved":false,"context_lines":[{"line_number":861,"context_line":"                self.pci_tracker.update_pci_for_instance(context,"},{"line_number":862,"context_line":"                                                         instance,"},{"line_number":863,"context_line":"                                                         sign\u003dsign)"},{"line_number":864,"context_line":"            self.scheduler_client.reportclient.update_instance_allocation("},{"line_number":865,"context_line":"                self.compute_node, instance, sign)"},{"line_number":866,"context_line":"            # new instance, update compute node resource usage:"},{"line_number":867,"context_line":"            self._update_usage(self._get_usage_dict(instance), sign\u003dsign)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_add326d4","line":864,"updated":"2016-09-01 20:28:19.000000000","message":"todo: need a unit test for this","commit_id":"c9af4ebf10106fee24160c3b6c5bc780f3b99b77"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1c87a670122a198caf6ced7304414b3d9e9b1937","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        # NOTE(sdague): using json\u003d instead of data\u003d sets the"},{"line_number":99,"context_line":"        # media type to application/json for us. Placement API is"},{"line_number":100,"context_line":"        # more sensitive to this than other APIs in the OpenStack"},{"line_number":101,"context_line":"        # ecosystem."},{"line_number":102,"context_line":"        return self._client.delete("},{"line_number":103,"context_line":"            url,"},{"line_number":104,"context_line":"            endpoint_filter\u003dself.ks_filter, raise_exc\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_f9efb8ae","line":101,"updated":"2016-09-01 18:46:24.000000000","message":"You\u0027re not using json\u003d here so the comment should go away.","commit_id":"694e3ca2d4b4ee6e309f7bf3878647ea870f67f6"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1c87a670122a198caf6ced7304414b3d9e9b1937","unresolved":false,"context_lines":[{"line_number":304,"context_line":"            self._update_inventory(compute_node)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def _allocations(self, instance):"},{"line_number":307,"context_line":"        # FIXME: Do something smart here with volumes?"},{"line_number":308,"context_line":"        disk \u003d instance.flavor.root_gb + instance.flavor.swap + instance.ephemeral_gb"},{"line_number":309,"context_line":"        return {"},{"line_number":310,"context_line":"            \u0027MEMORY_MB\u0027: instance.flavor.memory_mb,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_59cd0430","line":307,"updated":"2016-09-01 18:46:24.000000000","message":"compute_utils.is_volume_backed_instance(context, instance) and ignore root_gb if True.","commit_id":"694e3ca2d4b4ee6e309f7bf3878647ea870f67f6"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"14e7bb496e119aeac252183eb3fc229de8c51dce","unresolved":false,"context_lines":[{"line_number":304,"context_line":"            self._update_inventory(compute_node)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def _allocations(self, instance):"},{"line_number":307,"context_line":"        # FIXME: Do something smart here with volumes?"},{"line_number":308,"context_line":"        disk \u003d instance.flavor.root_gb + instance.flavor.swap + instance.ephemeral_gb"},{"line_number":309,"context_line":"        return {"},{"line_number":310,"context_line":"            \u0027MEMORY_MB\u0027: instance.flavor.memory_mb,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_197c5cb4","line":307,"in_reply_to":"fa7ab95a_59cd0430","updated":"2016-09-01 18:48:20.000000000","message":"To be clear this can happen at a later time. What\u0027s in this patch matches current behavior.","commit_id":"694e3ca2d4b4ee6e309f7bf3878647ea870f67f6"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"0b2e5605f750a9d098248ad37296eccca923a7c7","unresolved":false,"context_lines":[{"line_number":312,"context_line":"            \u0027DISK_GB\u0027: disk,"},{"line_number":313,"context_line":"        }"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    def _allocate_for_instance(self, compute_node, instance):"},{"line_number":316,"context_line":"        LOG.error(\u0027DAN --- begin\u0027)"},{"line_number":317,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % instance.uuid"},{"line_number":318,"context_line":"        LOG.error(\u0027DAN: My allocation url: %s\u0027 % url)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_199a9c6e","line":315,"updated":"2016-09-01 18:39:12.000000000","message":"@safe_connect","commit_id":"694e3ca2d4b4ee6e309f7bf3878647ea870f67f6"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"0b2e5605f750a9d098248ad37296eccca923a7c7","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        else:"},{"line_number":336,"context_line":"            LOG.info(\u0027Submitted allocation for instance %s\u0027 % instance.uuid)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _delete_allocation_for_instance(self, instance):"},{"line_number":339,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % instance.uuid"},{"line_number":340,"context_line":"        r \u003d self.delete(url)"},{"line_number":341,"context_line":"        if r:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_b996104a","line":338,"updated":"2016-09-01 18:39:12.000000000","message":"@safe_connect","commit_id":"694e3ca2d4b4ee6e309f7bf3878647ea870f67f6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421abe1255967fd516c65882bb17f45cea9ea189","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            endpoint_filter\u003dself.ks_filter, raise_exc\u003dFalse)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, url):"},{"line_number":98,"context_line":"        # NOTE(sdague): using json\u003d instead of data\u003d sets the"},{"line_number":99,"context_line":"        # media type to application/json for us. Placement API is"},{"line_number":100,"context_line":"        # more sensitive to this than other APIs in the OpenStack"},{"line_number":101,"context_line":"        # ecosystem."},{"line_number":102,"context_line":"        return self._client.delete("},{"line_number":103,"context_line":"            url,"},{"line_number":104,"context_line":"            endpoint_filter\u003dself.ks_filter, raise_exc\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7ab95a_b240e5a6","line":101,"range":{"start_line":98,"start_character":8,"end_line":101,"end_character":20},"updated":"2016-09-01 19:53:58.000000000","message":"As noted by Laski in the previous patch set, we can remove this here since we don\u0027t use json or data.","commit_id":"72920c3876808a69890bcfaaad74ac0d92e571b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d52be4fcdd27d422b48d3833d97ce6bed645d447","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        # NOTE(danms): Boot-from-volume instances consume no local disk"},{"line_number":305,"context_line":"        is_bfv \u003d compute_utils.is_volume_backed_instance(instance._context,"},{"line_number":306,"context_line":"                                                         instance)"},{"line_number":307,"context_line":"        disk \u003d ((0 if is_bfv else instance.flavor.root_gb) +"},{"line_number":308,"context_line":"                instance.flavor.swap +"},{"line_number":309,"context_line":"                instance.flavor.ephemeral_gb)"},{"line_number":310,"context_line":"        return {"},{"line_number":311,"context_line":"            \u0027MEMORY_MB\u0027: instance.flavor.memory_mb,"},{"line_number":312,"context_line":"            \u0027VCPU\u0027: instance.flavor.vcpus,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_4d2d3a45","line":309,"range":{"start_line":307,"start_character":8,"end_line":309,"end_character":45},"updated":"2016-09-01 20:19:31.000000000","message":"This seems to contradict the spec where it says:\n\n\"When the compute node utilizes local storage for instance disks OR was booted from volume, the value used should be the sum of the root_gb, ephemeral_gb, and swap field values of the flavor. The resource_provider_uuid should be the compute node’s UUID. Note that for instances that were booted from volume, the root_gb value will be 0.\"\n\nIt sounds like in the spec, regardless of local vs shared storage or BFV, the disk allocation is always the sum of root/swap/ephemeral. That doesn\u0027t really make sense to me though.","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"4ba41c63e3c1d87a94a5ff7876177d75e7e654b4","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        # NOTE(danms): Boot-from-volume instances consume no local disk"},{"line_number":305,"context_line":"        is_bfv \u003d compute_utils.is_volume_backed_instance(instance._context,"},{"line_number":306,"context_line":"                                                         instance)"},{"line_number":307,"context_line":"        disk \u003d ((0 if is_bfv else instance.flavor.root_gb) +"},{"line_number":308,"context_line":"                instance.flavor.swap +"},{"line_number":309,"context_line":"                instance.flavor.ephemeral_gb)"},{"line_number":310,"context_line":"        return {"},{"line_number":311,"context_line":"            \u0027MEMORY_MB\u0027: instance.flavor.memory_mb,"},{"line_number":312,"context_line":"            \u0027VCPU\u0027: instance.flavor.vcpus,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_ed00ce36","line":309,"range":{"start_line":307,"start_character":8,"end_line":309,"end_character":45},"in_reply_to":"fa7ab95a_4d2d3a45","updated":"2016-09-01 20:24:43.000000000","message":"\"Note that for instances that were booted from volume, the root_gb value will be 0.\" That\u0027s what this code is doing. The wording in the spec is a bit odd, it\u0027s not that root_gb will be 0 if bfv but that it should be treated as 0.","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d52be4fcdd27d422b48d3833d97ce6bed645d447","unresolved":false,"context_lines":[{"line_number":327,"context_line":"            ],"},{"line_number":328,"context_line":"        }"},{"line_number":329,"context_line":"        LOG.debug(\u0027Sending allocation for instance %s: %s\u0027 % ("},{"line_number":330,"context_line":"            instance.uuid, allocations))"},{"line_number":331,"context_line":"        r \u003d self.put(url, allocations)"},{"line_number":332,"context_line":"        if not r:"},{"line_number":333,"context_line":"            LOG.warning("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_0df09290","line":330,"range":{"start_line":330,"start_character":12,"end_line":330,"end_character":38},"updated":"2016-09-01 20:19:31.000000000","message":"nit: pass as args","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d52be4fcdd27d422b48d3833d97ce6bed645d447","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                 \u0027code\u0027: r.status_code,"},{"line_number":338,"context_line":"                 \u0027text\u0027: r.text})"},{"line_number":339,"context_line":"        else:"},{"line_number":340,"context_line":"            LOG.info(_LI(\u0027Submitted allocation for instance %s\u0027),"},{"line_number":341,"context_line":"                     instance.uuid)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    @safe_connect"},{"line_number":344,"context_line":"    def _delete_allocation_for_instance(self, instance):"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_cdf94a82","line":341,"range":{"start_line":340,"start_character":12,"end_line":341,"end_character":35},"updated":"2016-09-01 20:19:31.000000000","message":"nit: to get the context highlight coloring in the logs I\u0027d do this instead:\n\nLOG.info(_LI(\u0027Submitted allocation for instance.\u0027), instance\u003dinstance)","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d52be4fcdd27d422b48d3833d97ce6bed645d447","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                     instance.uuid)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    @safe_connect"},{"line_number":344,"context_line":"    def _delete_allocation_for_instance(self, instance):"},{"line_number":345,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % instance.uuid"},{"line_number":346,"context_line":"        r \u003d self.delete(url)"},{"line_number":347,"context_line":"        if r:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_8d1d8264","line":344,"updated":"2016-09-01 20:19:31.000000000","message":"Another thing we don\u0027t have, but could probably patch in later, is if we\u0027re not routinely updating/removing allocations in the update_resource_stats periodic, is the local delete case, described in the spec:\n\nhttp://specs.openstack.org/openstack/nova-specs/specs/newton/approved/resource-providers-allocations.html\n\nBasically if we have to local delete an instance from the API because the compute service is down, the spec relies on the periodic to cleanup allocations for deleted instances.","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d52be4fcdd27d422b48d3833d97ce6bed645d447","unresolved":false,"context_lines":[{"line_number":348,"context_line":"            LOG.info(_LI(\u0027Deleted allocation for instance %s\u0027),"},{"line_number":349,"context_line":"                     instance.uuid)"},{"line_number":350,"context_line":"        else:"},{"line_number":351,"context_line":"            LOG.warning("},{"line_number":352,"context_line":"                _LW(\u0027Unable to delete allocation for instance \u0027"},{"line_number":353,"context_line":"                    \u0027%(uuid)s: (%(code)i %(text)s)\u0027),"},{"line_number":354,"context_line":"                {\u0027uuid\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_52507932","line":351,"updated":"2016-09-01 20:19:31.000000000","message":"If we get a 404 we probably don\u0027t want to log a warning, we could log a debug message or something if we care to know.","commit_id":"3d8c21981b79ae337ac0f93f763035bb982cad3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a0a7de9a2fdfb7b68d12c50c47e5d68c5cd42d1","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        LOG.debug(\u0027Sending allocation for instance %s: %s\u0027 % ("},{"line_number":330,"context_line":"            instance.uuid, allocations))"},{"line_number":331,"context_line":"        r \u003d self.put(url, allocations)"},{"line_number":332,"context_line":"        if not r:"},{"line_number":333,"context_line":"            LOG.warning("},{"line_number":334,"context_line":"                _LW(\u0027Unable to submit allocation for instance \u0027"},{"line_number":335,"context_line":"                    \u0027%(uuid)s (%(code)i %(text)s)\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_2da55646","line":332,"updated":"2016-09-01 20:28:19.000000000","message":"todo: unit test for this case, mock out __nonzero__ and __bool__:\n\nhttp://stackoverflow.com/questions/2233786/overriding-bool-for-custom-class","commit_id":"c9af4ebf10106fee24160c3b6c5bc780f3b99b77"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a0a7de9a2fdfb7b68d12c50c47e5d68c5cd42d1","unresolved":false,"context_lines":[{"line_number":330,"context_line":"            instance.uuid, allocations))"},{"line_number":331,"context_line":"        r \u003d self.put(url, allocations)"},{"line_number":332,"context_line":"        if not r:"},{"line_number":333,"context_line":"            LOG.warning("},{"line_number":334,"context_line":"                _LW(\u0027Unable to submit allocation for instance \u0027"},{"line_number":335,"context_line":"                    \u0027%(uuid)s (%(code)i %(text)s)\u0027),"},{"line_number":336,"context_line":"                {\u0027uuid\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_4d645a21","line":333,"updated":"2016-09-01 20:28:19.000000000","message":"todo: this shouldn\u0027t be a warning for a 404","commit_id":"c9af4ebf10106fee24160c3b6c5bc780f3b99b77"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a0a7de9a2fdfb7b68d12c50c47e5d68c5cd42d1","unresolved":false,"context_lines":[{"line_number":348,"context_line":"            LOG.info(_LI(\u0027Deleted allocation for instance %s\u0027),"},{"line_number":349,"context_line":"                     instance.uuid)"},{"line_number":350,"context_line":"        else:"},{"line_number":351,"context_line":"            LOG.warning("},{"line_number":352,"context_line":"                _LW(\u0027Unable to delete allocation for instance \u0027"},{"line_number":353,"context_line":"                    \u0027%(uuid)s: (%(code)i %(text)s)\u0027),"},{"line_number":354,"context_line":"                {\u0027uuid\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_8d6ae2eb","line":351,"updated":"2016-09-01 20:28:19.000000000","message":"todo: unit test for this","commit_id":"c9af4ebf10106fee24160c3b6c5bc780f3b99b77"}]}
