Feature 10923: Autohealing
[osm/MON.git] / 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)