)]}'
{"watcher/common/nova_helper.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_453a0bcc","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":49},"updated":"2019-05-14 20:02:13.000000000","message":"This can be problematic in a multi-cell environment where you have compute_nodes records in multiple cells with the same integer id primary key.\n\nActually it looks like this is no longer true anyway since nova_client.api_version defaults to 2.56.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        return self.nova.hypervisors.list()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def get_compute_node_by_id(self, node_id):"},{"line_number":52,"context_line":"        \"\"\"Get compute node by ID (*not* UUID)\"\"\""},{"line_number":53,"context_line":"        # We need to pass an object with an \u0027id\u0027 attribute to make it work"},{"line_number":54,"context_line":"        return self.nova.hypervisors.get(utils.Struct(id\u003dnode_id))"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_015c02eb","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":49},"in_reply_to":"dfbec78f_453a0bcc","updated":"2019-05-15 05:56:39.000000000","message":"Yes, this needs to be updated.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"}],"watcher/decision_engine/model/collector/nova.py":[{"author":{"_account_id":5575,"name":"Jose Castro Leon","email":"jose.castro.leon@cern.ch","username":"jose-castro-leon"},"change_message_id":"42ac0826fbad87f03a9ba6b6853bcbb1f8eab92b","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        This includes components which represent actual infrastructure"},{"line_number":246,"context_line":"        hardware."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        compute_nodes \u003d []"},{"line_number":249,"context_line":"        host_aggregates \u003d self.model_scope.get(\"host_aggregates\")"},{"line_number":250,"context_line":"        availability_zones \u003d self.model_scope.get(\"availability_zones\")"},{"line_number":251,"context_line":"        if host_aggregates:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5fc1f717_892188b7","line":248,"updated":"2019-03-07 09:52:47.000000000","message":"Could we change this to a set? I am a bit afraid that the nodes could be mapped to both and doing unnecessary duplicated queries.\n\nOr we can do a trick like \u0027list(set(compute_nodes)\u0027 to remove duplicates","commit_id":"0234d5fb1879968a5d87e7f93fb13f9168993f67"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"ce2d1a91e7263fbfd85f49347a7ddaaa88cac7ff","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        This includes components which represent actual infrastructure"},{"line_number":246,"context_line":"        hardware."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        compute_nodes \u003d []"},{"line_number":249,"context_line":"        host_aggregates \u003d self.model_scope.get(\"host_aggregates\")"},{"line_number":250,"context_line":"        availability_zones \u003d self.model_scope.get(\"availability_zones\")"},{"line_number":251,"context_line":"        if host_aggregates:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5fc1f717_bf633fb1","line":248,"in_reply_to":"5fc1f717_892188b7","updated":"2019-03-08 06:31:49.000000000","message":"Done","commit_id":"0234d5fb1879968a5d87e7f93fb13f9168993f67"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        LOG.debug(\"Building latest Nova cluster data model\")"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        if self._audit_scope_handler is None:"},{"line_number":181,"context_line":"            LOG.debug(\"No audit, Don\u0027t Build compute data model\")"},{"line_number":182,"context_line":"            return"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        builder \u003d ModelBuilder(self.osc)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_a2641d23","line":181,"updated":"2019-05-14 20:02:13.000000000","message":"We hit this on startup of the decision-engine so we don\u0027t build the compute CDM, but according to the spec if there is no audit scope shouldn\u0027t we build the model?\n\nhttps://review.opendev.org/#/c/641606/2/specs/stein/approved/scope-for-watcher-datamodel.rst@72\n\nDoes this mean that the compute CDM is built fresh every time an audit is run?","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        LOG.debug(\"Building latest Nova cluster data model\")"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        if self._audit_scope_handler is None:"},{"line_number":181,"context_line":"            LOG.debug(\"No audit, Don\u0027t Build compute data model\")"},{"line_number":182,"context_line":"            return"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        builder \u003d ModelBuilder(self.osc)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_41d99a54","line":181,"in_reply_to":"dfbec78f_a2641d23","updated":"2019-05-15 05:56:39.000000000","message":"When creating audit, _audit_scope_handler will be set. This means we don\u0027t build data model if no audit.In builder.execute, whether to rebuild CDM depends on the scope of an audit.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        hardware."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        compute_nodes \u003d set()"},{"line_number":249,"context_line":"        host_aggregates \u003d self.model_scope.get(\"host_aggregates\")"},{"line_number":250,"context_line":"        availability_zones \u003d self.model_scope.get(\"availability_zones\")"},{"line_number":251,"context_line":"        if host_aggregates:"},{"line_number":252,"context_line":"            self._collect_aggregates(host_aggregates, compute_nodes)"},{"line_number":253,"context_line":"        if availability_zones:"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_e256952a","line":250,"range":{"start_line":249,"start_character":8,"end_line":250,"end_character":71},"updated":"2019-05-14 20:02:13.000000000","message":"These aren\u0027t documented outside of the spec, i.e. nothing in the API reference or docs for scoped compute model audits. The description of the \u0027scope\u0027 parameter in the create audit template API:\n\nhttps://developer.openstack.org/api-ref/resource-optimization/?expanded\u003dcreate-audit-template-detail#create-audit-template\n\njust says \"Audit Scope.\". Maybe the API reference should include an example like from the spec:\n\nhttps://review.opendev.org/#/c/641606/2/specs/stein/approved/scope-for-watcher-datamodel.rst@59","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        hardware."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        compute_nodes \u003d set()"},{"line_number":249,"context_line":"        host_aggregates \u003d self.model_scope.get(\"host_aggregates\")"},{"line_number":250,"context_line":"        availability_zones \u003d self.model_scope.get(\"availability_zones\")"},{"line_number":251,"context_line":"        if host_aggregates:"},{"line_number":252,"context_line":"            self._collect_aggregates(host_aggregates, compute_nodes)"},{"line_number":253,"context_line":"        if availability_zones:"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_619dbe64","line":250,"range":{"start_line":249,"start_character":8,"end_line":250,"end_character":71},"in_reply_to":"dfbec78f_e256952a","updated":"2019-05-15 05:56:39.000000000","message":"We have a example in Watcher CLI command \u0027watcher help create audittemplate\u0027.\nIt\u0027s better if we add a example to the api-ref. thanks","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        if availability_zones:"},{"line_number":254,"context_line":"            self._collect_zones(availability_zones, compute_nodes)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        if not compute_nodes:"},{"line_number":257,"context_line":"            all_nodes \u003d self.nova_helper.get_compute_node_list()"},{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_02296999","line":256,"updated":"2019-05-14 20:02:13.000000000","message":"Won\u0027t this always be true because nothing is populating compute_nodes above?","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"695061b8350474727b92197144bb132fe2deed24","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        if availability_zones:"},{"line_number":254,"context_line":"            self._collect_zones(availability_zones, compute_nodes)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        if not compute_nodes:"},{"line_number":257,"context_line":"            all_nodes \u003d self.nova_helper.get_compute_node_list()"},{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_853d63de","line":256,"in_reply_to":"dfbec78f_02296999","updated":"2019-05-14 20:32:27.000000000","message":"Oh nevermind I see it\u0027s passed by reference to _collect_aggregates and _collect_zones.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            self._collect_zones(availability_zones, compute_nodes)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        if not compute_nodes:"},{"line_number":257,"context_line":"            all_nodes \u003d self.nova_helper.get_compute_node_list()"},{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"},{"line_number":260,"context_line":"        LOG.debug(\"compute nodes: %s\", compute_nodes)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_a21bbd7e","line":257,"range":{"start_line":257,"start_character":41,"end_line":257,"end_character":62},"updated":"2019-05-14 20:02:13.000000000","message":"By default this is returning the detailed hypervisor list:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003d#list-hypervisors-details\n\nBut all you\u0027re using it for is to get the hypervisor_hostname, you could just get hypervisors without details for that, right? It would make the call to nova faster (or it should).\n\nAlso note that starting in microversion 2.33 nova started accepting a limit on this API for paging, but inadvertently changed the behavior to return up to [api]/max_limit results by default:\n\nhttps://docs.openstack.org/nova/latest/configuration/config.html#api.max_limit\n\nWhich is 1000 but in a large cloud (like CERN or a public cloud) could be far less than how many nodes are actually in the deployment (not sure if that will affect audits scoped to an aggregate or not, it could technically mean you could pull compute nodes from the API which aren\u0027t in the scoped aggregate though).","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            self._collect_zones(availability_zones, compute_nodes)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        if not compute_nodes:"},{"line_number":257,"context_line":"            all_nodes \u003d self.nova_helper.get_compute_node_list()"},{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"},{"line_number":260,"context_line":"        LOG.debug(\"compute nodes: %s\", compute_nodes)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_24791493","line":257,"range":{"start_line":257,"start_character":41,"end_line":257,"end_character":62},"in_reply_to":"dfbec78f_a21bbd7e","updated":"2019-05-15 05:56:39.000000000","message":"Yes, here don\u0027t need detailed hypervisor list. thanks\nIn a large cloud, user should set audit scope to get related nodes.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"},{"line_number":260,"context_line":"        LOG.debug(\"compute nodes: %s\", compute_nodes)"},{"line_number":261,"context_line":"        for node_name in compute_nodes:"},{"line_number":262,"context_line":"            cnode \u003d self.nova_helper.get_compute_node_by_name(node_name,"},{"line_number":263,"context_line":"                                                              servers\u003dTrue)"},{"line_number":264,"context_line":"            if cnode:"},{"line_number":265,"context_line":"                self.add_compute_node(cnode[0])"},{"line_number":266,"context_line":"                self.add_instance_node(cnode[0])"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_220fcd37","line":263,"range":{"start_line":261,"start_character":8,"end_line":263,"end_character":75},"updated":"2019-05-14 20:02:13.000000000","message":"And this code is iterating over every hypervisor (which we already got the details for all of them) and getting details per hypervisor but with servers, right?\n\nNote that with the 2.53 microversion in nova, you can get all of this in a single API call:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003dlist-hypervisors-detail#list-hypervisors\n\nSo: GET /os-hypervisors?with_servers\u003dTrue\n\nIt looks like the problem is python-novaclient\u0027s hypervisors API binding doesn\u0027t support the servers kwarg on the list() method:\n\nhttps://github.com/openstack/python-novaclient/blob/62bf8809c660ed0675f301c235b1d434caeaf580/novaclient/v2/hypervisors.py#L62\n\nWe can definitely add that though to optimize this.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"695061b8350474727b92197144bb132fe2deed24","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"},{"line_number":260,"context_line":"        LOG.debug(\"compute nodes: %s\", compute_nodes)"},{"line_number":261,"context_line":"        for node_name in compute_nodes:"},{"line_number":262,"context_line":"            cnode \u003d self.nova_helper.get_compute_node_by_name(node_name,"},{"line_number":263,"context_line":"                                                              servers\u003dTrue)"},{"line_number":264,"context_line":"            if cnode:"},{"line_number":265,"context_line":"                self.add_compute_node(cnode[0])"},{"line_number":266,"context_line":"                self.add_instance_node(cnode[0])"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_a0009502","line":263,"range":{"start_line":261,"start_character":8,"end_line":263,"end_character":75},"in_reply_to":"dfbec78f_220fcd37","updated":"2019-05-14 20:32:27.000000000","message":"OK so in a scoped audit, we only have the nodenames (not the detailed list like I mentioned) so I guess in this case we have to get the details per node. We could still optimize the unscoped case.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            compute_nodes \u003d set("},{"line_number":259,"context_line":"                [node.hypervisor_hostname for node in all_nodes])"},{"line_number":260,"context_line":"        LOG.debug(\"compute nodes: %s\", compute_nodes)"},{"line_number":261,"context_line":"        for node_name in compute_nodes:"},{"line_number":262,"context_line":"            cnode \u003d self.nova_helper.get_compute_node_by_name(node_name,"},{"line_number":263,"context_line":"                                                              servers\u003dTrue)"},{"line_number":264,"context_line":"            if cnode:"},{"line_number":265,"context_line":"                self.add_compute_node(cnode[0])"},{"line_number":266,"context_line":"                self.add_instance_node(cnode[0])"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_0472d0ad","line":263,"range":{"start_line":261,"start_character":8,"end_line":263,"end_character":75},"in_reply_to":"dfbec78f_a0009502","updated":"2019-05-15 05:56:39.000000000","message":"Yes","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def add_compute_node(self, node):"},{"line_number":269,"context_line":"        # Build and add base node."},{"line_number":270,"context_line":"        node_info \u003d self.nova_helper.get_compute_node_by_id(node.id)"},{"line_number":271,"context_line":"        LOG.debug(\"node info: %s\", node_info)"},{"line_number":272,"context_line":"        compute_node \u003d self.build_compute_node(node_info)"},{"line_number":273,"context_line":"        self.model.add_node(compute_node)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_05173347","line":270,"range":{"start_line":270,"start_character":8,"end_line":270,"end_character":68},"updated":"2019-05-14 20:02:13.000000000","message":"Hmm, I\u0027m not sure this will work in a multi-cell nova deployment unless you are getting the hypervisor record with microversion \u003e\u003d 2.53 because the id before that is an integer and could be duplicated across multiple cells. With 2.53 the id is a UUID which would be unique across multiple cells.\n\nAlso, this seems inefficient if you already have the compute node with details above (from all_nodes \u003d self.nova_helper.get_compute_node_list()).\n\n(later)\n\nActually I see that Idd6ebc94f81ad5d65256c80885f2addc1aaeaae1 changed the default nova_client.api_version to 2.56 so this would work as long as that isn\u0027t configured below 2.53.\n\nI wonder how well the code handles older versions of the compute API or if we can start requiring at least 2.53 (2.53 was the max in pike, 2.56 was in queens):\n\nhttps://docs.openstack.org/nova/latest/reference/api-microversion-history.html\n\nSeems we could say watcher requires at least queens-level nova and drop compat code for anything older than that, with a release note and maybe an upgrade checker?","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"695061b8350474727b92197144bb132fe2deed24","unresolved":false,"context_lines":[{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def add_compute_node(self, node):"},{"line_number":269,"context_line":"        # Build and add base node."},{"line_number":270,"context_line":"        node_info \u003d self.nova_helper.get_compute_node_by_id(node.id)"},{"line_number":271,"context_line":"        LOG.debug(\"node info: %s\", node_info)"},{"line_number":272,"context_line":"        compute_node \u003d self.build_compute_node(node_info)"},{"line_number":273,"context_line":"        self.model.add_node(compute_node)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_203d85c3","line":270,"range":{"start_line":270,"start_character":8,"end_line":270,"end_character":68},"in_reply_to":"dfbec78f_05173347","updated":"2019-05-14 20:32:27.000000000","message":"\u003e Also, this seems inefficient if you already have the compute node with details above (from all_nodes \u003d self.nova_helper.get_compute_node_list()).\n\nOK this is only inefficient in the unscoped audit case. In the scoped audit case we:\n\n1. get the node names\n2. get the node details per node name (with servers)\n3. and then get the node details by id\n\nAnyway, I think we could still merge 2 and 3 into a single call:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003dlist-hypervisors-details-detail#list-hypervisors-details\n\nGET /os-hypervisors/detail?hypervisor_hostname_pattern\u003dnode_name\u0026with_servers\u003dtrue","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def add_compute_node(self, node):"},{"line_number":269,"context_line":"        # Build and add base node."},{"line_number":270,"context_line":"        node_info \u003d self.nova_helper.get_compute_node_by_id(node.id)"},{"line_number":271,"context_line":"        LOG.debug(\"node info: %s\", node_info)"},{"line_number":272,"context_line":"        compute_node \u003d self.build_compute_node(node_info)"},{"line_number":273,"context_line":"        self.model.add_node(compute_node)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_64b70c3c","line":270,"range":{"start_line":270,"start_character":8,"end_line":270,"end_character":68},"in_reply_to":"dfbec78f_203d85c3","updated":"2019-05-15 05:56:39.000000000","message":"Watcher uses nova client, and no function in nova client can get 2\u00263 in one call.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":356,"context_line":"    #     return {\"layer\": layer, \"category\": category, \"type\": node_type,"},{"line_number":357,"context_line":"    #             \"attributes\": attributes}"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def _add_virtual_layer(self):"},{"line_number":360,"context_line":"        \"\"\"Add the virtual layer to the graph."},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        This layer is the virtual components of the infrastructure,"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_823d59de","line":359,"updated":"2019-05-14 20:02:13.000000000","message":"This method is never used now. So what builds the VM info into the compute CDM?\n\nIs this because of self.add_instance_node(cnode[0]) on L266 now?","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":356,"context_line":"    #     return {\"layer\": layer, \"category\": category, \"type\": node_type,"},{"line_number":357,"context_line":"    #             \"attributes\": attributes}"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def _add_virtual_layer(self):"},{"line_number":360,"context_line":"        \"\"\"Add the virtual layer to the graph."},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        This layer is the virtual components of the infrastructure,"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_2487d464","line":359,"in_reply_to":"dfbec78f_823d59de","updated":"2019-05-15 05:56:39.000000000","message":"Yes~","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4fbf94374fed2f0c1f1ce1ecf2176a255c8a909","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            # no instances on this node"},{"line_number":397,"context_line":"            return"},{"line_number":398,"context_line":"        instance_uuids \u003d [s[\u0027uuid\u0027] for s in instances]"},{"line_number":399,"context_line":"        for uuid in instance_uuids:"},{"line_number":400,"context_line":"            try:"},{"line_number":401,"context_line":"                inst \u003d self.nova_helper.find_instance(uuid)"},{"line_number":402,"context_line":"            except Exception as exc:"},{"line_number":403,"context_line":"                LOG.exception(exc)"},{"line_number":404,"context_line":"                continue"},{"line_number":405,"context_line":"            # Add Node"},{"line_number":406,"context_line":"            instance \u003d self._build_instance_node(inst)"},{"line_number":407,"context_line":"            self.model.add_instance(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_0572d349","line":404,"range":{"start_line":399,"start_character":8,"end_line":404,"end_character":24},"updated":"2019-05-14 20:02:13.000000000","message":"Yikes, this seems inefficient to get the servers details for every server per node each in a separate call. Seems we could do better by just calling GET /servers/detail and filtering on host or node (should be 1:1 for non-baremetal servers, but otherwise for ironic instances those the host:node is 1:M and the instance:node is 1:1).","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"97c8da056a74e129c031d0daa5663d476bb77820","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            # no instances on this node"},{"line_number":397,"context_line":"            return"},{"line_number":398,"context_line":"        instance_uuids \u003d [s[\u0027uuid\u0027] for s in instances]"},{"line_number":399,"context_line":"        for uuid in instance_uuids:"},{"line_number":400,"context_line":"            try:"},{"line_number":401,"context_line":"                inst \u003d self.nova_helper.find_instance(uuid)"},{"line_number":402,"context_line":"            except Exception as exc:"},{"line_number":403,"context_line":"                LOG.exception(exc)"},{"line_number":404,"context_line":"                continue"},{"line_number":405,"context_line":"            # Add Node"},{"line_number":406,"context_line":"            instance \u003d self._build_instance_node(inst)"},{"line_number":407,"context_line":"            self.model.add_instance(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_c4da7876","line":404,"range":{"start_line":399,"start_character":8,"end_line":404,"end_character":24},"in_reply_to":"dfbec78f_0572d349","updated":"2019-05-15 05:56:39.000000000","message":"No function in nova client can get servers and filtering on host.","commit_id":"f337c67bfe2108fa326f556db711b544fcce3690"}]}
