Fix _build_instance_node for building Compute CDM
As of Nova API microversion 2.47, response of GET /servers/detail has flavor which contains a subset of the actual flavor information used to create the server instance, represented as a nested dictionary. Since current watcher nova default api version is 2.53(Pike), This patch follows the API response change. Change-Id: Ia575950f0702afa1d093f03ca8ddedd3c410b7de Closes-Bug: #1722462
This commit is contained in:
@@ -227,14 +227,14 @@ class ModelBuilder(object):
|
||||
:param instance: Nova VM object.
|
||||
:return: A instance node for the graph.
|
||||
"""
|
||||
flavor = self.nova_helper.get_flavor(instance.flavor["id"])
|
||||
flavor = instance.flavor
|
||||
instance_attributes = {
|
||||
"uuid": instance.id,
|
||||
"human_id": instance.human_id,
|
||||
"memory": flavor.ram,
|
||||
"disk": flavor.disk,
|
||||
"disk_capacity": flavor.disk,
|
||||
"vcpus": flavor.vcpus,
|
||||
"memory": flavor["ram"],
|
||||
"disk": flavor["disk"],
|
||||
"disk_capacity": flavor["disk"],
|
||||
"vcpus": flavor["vcpus"],
|
||||
"state": getattr(instance, "OS-EXT-STS:vm_state"),
|
||||
"metadata": instance.metadata}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user