+ raise NFLCMException("Failed to Operate %s(%s)", RES_VM, res["res_id"])
+
+
+def heal_vim_res(vdus, vnfd_info, do_notify, data, vim_cache, res_cache):
+ try:
+ vimid = data["vimid"]
+ tenant = data["tenant"]
+ actionType = data["action"]
+ if actionType == HEAL_ACTION_TYPE.START:
+ create_vm(vim_cache, res_cache, vnfd_info, vdus[0], do_notify, RES_VM)
+ elif actionType == HEAL_ACTION_TYPE.RESTART:
+ vm_info = api.get_vm(vimid, tenant, vdus[0].resourceid)
+ action_vm(ACTION_TYPE.REBOOT, vm_info, vimid, tenant)
+ except VimException as e:
+ logger.error("Failed to Heal %s(%s)", RES_VM, vdus[0]["vdu_id"])
+ logger.error("%s:%s", e.http_code, e.message)
+ raise NFLCMException("Failed to Heal %s(%s)", RES_VM, vdus[0]["vdu_id"])
+
+
+def create_vim_res(data, do_notify, vim_cache={}, res_cache={}):