+ elif update_type == "VERTICAL_SCALE":
+ self.logger.debug(
+ "Prepare for VERTICAL_SCALE update operation {}".format(db_nslcmop)
+ )
+ # Get the input parameters given through update request
+ vnf_instance_id = db_nslcmop["operationParams"]["verticalScaleVnf"].get(
+ "vnfInstanceId"
+ )
+
+ vnfd_id = db_nslcmop["operationParams"]["verticalScaleVnf"].get(
+ "vnfdId"
+ )
+ step = "Getting vnfr from database"
+ db_vnfr = self.db.get_one(
+ "vnfrs", {"_id": vnf_instance_id}, fail_on_empty=False
+ )
+ self.logger.debug(step)
+ step = "Getting vnfds from database"
+ self.logger.debug("Start" + step)
+ # Latest VNFD
+ latest_vnfd = self.db.get_one(
+ "vnfds", {"_id": vnfd_id}, fail_on_empty=False
+ )
+ latest_vnfd_revision = latest_vnfd["_admin"].get("revision")
+ # Current VNFD
+ current_vnf_revision = db_vnfr.get("revision", 1)
+ current_vnfd = self.db.get_one(
+ "vnfds_revisions",
+ {"_id": vnfd_id + ":" + str(current_vnf_revision)},
+ fail_on_empty=False,
+ )
+ self.logger.debug("End" + step)
+ # verify flavor changes
+ step = "Checking for flavor change"
+ if find_software_version(current_vnfd) != find_software_version(
+ latest_vnfd
+ ):
+ self.logger.debug("Start" + step)
+ if current_vnfd.get("virtual-compute-desc") == latest_vnfd.get(
+ "virtual-compute-desc"
+ ) and current_vnfd.get("virtual-storage-desc") == latest_vnfd.get(
+ "virtual-storage-desc"
+ ):
+ raise LcmException(
+ "No change in flavor check vnfd {}".format(vnfd_id)
+ )
+ else:
+ raise LcmException(
+ "No change in software_version of vnfd {}".format(vnfd_id)
+ )
+
+ self.logger.debug("End" + step)
+
+ (result, detailed_status) = await self.vertical_scale(
+ nsr_id, nslcmop_id
+ )
+ self.logger.debug(
+ "vertical_scale result: {} detailed_status :{}".format(
+ result, detailed_status
+ )
+ )
+ if result == "FAILED":
+ nslcmop_operation_state = result
+ error_description_nslcmop = detailed_status
+ db_nslcmop_update["detailed-status"] = detailed_status
+ if not nslcmop_operation_state:
+ nslcmop_operation_state = "COMPLETED"
+ self.logger.debug(
+ logging_text
+ + " task Done with result {} {}".format(
+ nslcmop_operation_state, detailed_status
+ )
+ )