remove id field from CDM
There are 3 related fields(id, uuid and hostname) in ComputeNode[1]. according to [2], after nova api 2.53, the id of the hypervisor as a UUID. and service.host is equal to hypervisor name for compute node. so we can remove id and only keep uuid then set uuid to node.id [1]:https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/collector/nova.py#L306 [2]:https://developer.openstack.org/api-ref/compute/?expanded=list-hypervisors-details-detail#list-hypervisors-details Change-Id: Ie1d1ad56808270d936ec25186061f7f12cc49fdc Closes-Bug: #1835192 Depends-on: I752fbfa560313e28e87d83e46431c283b4db4f23 Depends-on: I0975500f359de92b6d6fdea2e01614cf0ba73f05
This commit is contained in:
@@ -349,9 +349,9 @@ class NovaModelBuilder(base.BaseModelBuilder):
|
||||
|
||||
# build up the compute node.
|
||||
node_attributes = {
|
||||
"id": node.id,
|
||||
"uuid": node.service["host"],
|
||||
"hostname": node.hypervisor_hostname,
|
||||
# The id of the hypervisor as a UUID from version 2.53.
|
||||
"uuid": node.id,
|
||||
"hostname": node.service["host"],
|
||||
"memory": memory_mb,
|
||||
"memory_ratio": memory_ratio,
|
||||
"memory_mb_reserved": memory_mb_reserved,
|
||||
@@ -379,7 +379,7 @@ class NovaModelBuilder(base.BaseModelBuilder):
|
||||
LOG.info("no instances on compute_node: {0}".format(node))
|
||||
return
|
||||
host = node.service["host"]
|
||||
compute_node = self.model.get_node_by_uuid(host)
|
||||
compute_node = self.model.get_node_by_uuid(node.id)
|
||||
filters = {'host': host}
|
||||
limit = len(instances) if len(instances) <= 1000 else -1
|
||||
# Get all servers on this compute host.
|
||||
|
||||
Reference in New Issue
Block a user