Feature 10923: Autohealing 56/11956/3
authorsritharan <priyadarshini@tataelxsi.co.in>
Thu, 28 Apr 2022 06:57:30 +0000 (06:57 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 15 Jun 2022 17:38:37 +0000 (19:38 +0200)
Change-Id: Ic726ac70c9ee69b0cf0bc442c878071a7bf9486d
Signed-off-by: sritharan <priyadarshini@tataelxsi.co.in>
osm_mon/collector/infra_collectors/base_osinfra.py

index 6926447..1b5531d 100644 (file)
@@ -81,15 +81,15 @@ class BaseOpenStackInfraCollector(BaseVimInfraCollector):
                 tags = {
                     "vim_account_id": self.vim_account["_id"],
                     "resource_uuid": resource_uuid,
-                    "nsr_id": nsr_id,
+                    "ns_id": nsr_id,
                     "ns_name": ns_name,
                     "vnf_member_index": vnf_member_index,
-                    "vdur_name": vdur.get("name", ""),
+                    "vdu_name": vdur.get("name", ""),
                     "project_id": vnfr_project_id,
                 }
                 try:
                     vm = self.nova.servers.get(resource_uuid)
-                    vm_status = 1 if vm.status == "ACTIVE" else 0
+                    vm_status = (0 if (vm.status == 'ERROR') else 1)
                     vm_status_metric = Metric(tags, "vm_status", vm_status)
                 except Exception as e:
                     log.warning("VM status is not OK: %s" % e)