Merge "removed extra argument from extractByKey method"
[so.git] / adapters / mso-openstack-adapters / src / main / java / org / onap / so / adapters / vnf / MsoVnfPluginAdapterImpl.java
index 704d54c..2b49290 100644 (file)
@@ -72,9 +72,9 @@ import org.onap.so.db.catalog.beans.VnfResource;
 import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository;
 import org.onap.so.db.catalog.utils.MavenLikeVersioning;
 import org.onap.so.entity.MsoRequest;
+import org.onap.so.logger.ErrorCode;
 import org.onap.so.logger.MessageEnum;
 
-import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.VnfRollback;
 import org.onap.so.openstack.beans.VnfStatus;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
@@ -153,6 +153,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      */
     @Override
     public void createVnf (String cloudSiteId,
+                           String cloudOwner,
                            String tenantId,
                            String vnfType,
                            String vnfVersion,
@@ -181,6 +182,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      */
     @Override
     public void updateVnf (String cloudSiteId,
+                           String cloudOwner,
                            String tenantId,
                            String vnfType,
                            String vnfVersion,
@@ -216,6 +218,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      */
     @Override
     public void queryVnf (String cloudSiteId,
+                          String cloudOwner,
                           String tenantId,
                           String vnfNameOrId,
                           MsoRequest msoRequest,
@@ -225,17 +228,16 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                           Holder <Map <String, String>> outputs)
         throws VnfException
     {
-        MsoLogger.setLogContext (msoRequest);
-        logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
 
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
         long subStartTime = System.currentTimeMillis ();
 
        VduInstance vduInstance = null;
-       CloudInfo cloudInfo = new CloudInfo(cloudSiteId, tenantId, null);
+       CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
 
-        VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+        VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
 
        try {
                vduInstance = vduPlugin.queryVdu (cloudInfo, vnfNameOrId);
@@ -244,9 +246,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
           // Failed to query the VDU due to a plugin exception.
           // Convert to a generic VnfException
           e.addContext("QueryVNF");
-          String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
-          logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudSiteId,
-              tenantId, "VDU", "QueryVNF", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
+          String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
+          logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudOwner, cloudSiteId,
+              tenantId, "VDU", "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
           logger.debug(error);
           throw new VnfException(e);
       }
@@ -278,10 +280,10 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      */
     @Override
     public void deleteVnf (String cloudSiteId,
+                           String cloudOwner,
                            String tenantId,
                            String vnfName,
                            MsoRequest msoRequest) throws VnfException {
-        MsoLogger.setLogContext (msoRequest);
 
        // This operation is no longer supported at the VNF level.  The adapter is only called to deploy modules.
        logger.debug("DeleteVNF command attempted but not supported");
@@ -302,8 +304,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         long startTime = System.currentTimeMillis ();
        // rollback may be null (e.g. if stack already existed when Create was called)
         if (rollback == null) {
-            logger.info("{} {} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf",
-                MsoLogger.getServiceName());
+            logger.info("{} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf");
             return;
         }
 
@@ -314,19 +315,18 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
 
         // Get the elements of the VnfRollback object for easier access
         String cloudSiteId = rollback.getCloudSiteId ();
+        String cloudOwner = rollback.getCloudOwner();
         String tenantId = rollback.getTenantId ();
-        CloudInfo cloudInfo = new CloudInfo (cloudSiteId, tenantId, null);
+        CloudInfo cloudInfo = new CloudInfo (cloudSiteId, cloudOwner, tenantId, null);
 
         String vfModuleId = rollback.getVfModuleStackId ();
 
-        MsoLogger.setLogContext (rollback.getMsoRequest());
-
-        logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
 
        VduInstance vduInstance = null;
 
         // Use the VduPlugin to delete the VF Module.
-        VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+        VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
 
         long subStartTime = System.currentTimeMillis ();
         try {
@@ -339,9 +339,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
             // Failed to rollback the VF Module due to a plugin exception.
             // Convert to a generic VnfException
             ve.addContext ("RollbackVFModule");
-            String error = "Rollback VF Module: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + ve;
-            logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
-                tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError.getValue(), "Exception - DeleteVdu", ve);
+            String error = "Rollback VF Module: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + ve;
+            logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
+                tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(), "Exception - DeleteVdu", ve);
             logger.debug(error);
             throw new VnfException (ve);
         }
@@ -570,6 +570,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      * is successfully created but the orchestration fails on a subsequent step.
      *
      * @param cloudSiteId CLLI code of the cloud site in which to create the VNF
+     * @param cloudOwner cloud owner of the cloud site in which to create the VNF
      * @param tenantId Openstack tenant identifier
      * @param vfModuleType VF Module type key, should match a VNF definition in catalog DB.
      *        Deprecated - should use modelCustomizationUuid
@@ -595,6 +596,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      */
     @Override
     public void createVfModule(String cloudSiteId,
+            String cloudOwner,
             String tenantId,
             String vfModuleType,
             String vnfVersion,
@@ -618,14 +620,12 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
 
-       MsoLogger.setLogContext (msoRequest);
-
         // Require a model customization ID.  Every VF Module definition must have one.
         if (modelCustomizationUuid == null  ||  modelCustomizationUuid.isEmpty()) {
             logger.debug("Missing required input: modelCustomizationUuid");
             String error = "Create vfModule error: Missing required input: modelCustomizationUuid";
             logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
-                "VF Module ModelCustomizationUuid", "VDU", MsoLogger.ErrorCode.DataError,
+                "VF Module ModelCustomizationUuid", "VDU", ErrorCode.DataError,
                 "Create VF Module: " + "Missing required input: modelCustomizationUuid");
             logger.debug(error);
             throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -661,6 +661,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         // Build a default rollback object (no actions performed)
         VnfRollback vfRollback = new VnfRollback();
         vfRollback.setCloudSiteId(cloudSiteId);
+        vfRollback.setCloudOwner(cloudOwner);
         vfRollback.setTenantId(tenantId);
         vfRollback.setMsoRequest(msoRequest);
         vfRollback.setRequestType(requestType);
@@ -688,7 +689,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                 logger.debug(error);
                 logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
                     "VF Module ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb",
-                    MsoLogger.ErrorCode.DataError, error);
+                    ErrorCode.DataError, error);
                 throw new VnfException(error, MsoExceptionCategory.USERDATA);
             } else {
                 logger.debug("Found vfModuleCust entry {}", vfModuleCust.toString());
@@ -726,7 +727,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                     + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId
                     + " with AIC_Version:" + cloudSite.getCloudVersion();
             logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
-                MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+                ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
             logger.debug(error);
             throw new VnfException(error, MsoExceptionCategory.USERDATA);
         }
@@ -734,10 +735,10 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
 
 
         VduInstance vduInstance = null;
-        CloudInfo cloudInfo = new CloudInfo (cloudSiteId, tenantId, null);
+        CloudInfo cloudInfo = new CloudInfo (cloudSiteId, cloudOwner, tenantId, null);
 
         // Use the VduPlugin.
-        VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+        VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
 
         // First, look up to see if the VF already exists, unless using multicloud adapter
 
@@ -748,9 +749,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
             }
             catch (VduException me) {
                 // Failed to query the VDU due to a plugin exception.
-                String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
-                    cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                     "Exception - queryVdu", me);
                 logger.debug(error);
                 // Convert to a generic VnfException
@@ -768,12 +769,12 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                 if (failIfExists != null && failIfExists) {
                     // fail - it exists
                     String error =
-                        "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
-                    logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
-                        cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                        "Create VF: Deployment " + vfModuleName + " already exists in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId;
+                    logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+                        cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                         "VF Module " + vfModuleName + " already exists");
                     logger.debug(error);
-                    throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+                    throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
                 } else {
                     // Found existing deployment and client has not requested "failIfExists".
                     // Populate the outputs from the existing deployment.
@@ -789,42 +790,42 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                 // fail - it's in progress - return meaningful error
                 String error =
                     "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
-                        + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
-                    cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                        + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                     "VF Module " + vfModuleName + " already exists");
                 logger.debug(error);
-                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
             } else if (status == VduStateType.FAILED) {
                 // fail - it exists and is in a FAILED state
                 String error =
-                    "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId
+                    "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudOwner + "/" + cloudSiteId
                         + "/" + tenantId + "; requires manual intervention.";
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
-                    cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                     "VF Module " + vfModuleName + " already exists and is in FAILED state");
                 logger.debug(error);
-                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
             } else if (status == VduStateType.UNKNOWN) {
                 // fail - it exists and is in a UNKNOWN state
                 String error =
                     "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
-                        + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
-                    cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                        + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                     "VF Module " + vfModuleName + " already exists and is in " + status.toString() + " state");
                 logger.debug(error);
-                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
             } else {
                 // Unexpected, since all known status values have been tested for
                 String error =
                     "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status
-                        .toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
-                    cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+                        .toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
                     "VF Module " + vfModuleName + " already exists and is in an unknown state");
                 logger.debug(error);
-                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+                throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
             }
         }
 
@@ -842,9 +843,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
             }
             catch (VduException me) {
                 // Failed to query the Volume Group VDU due to a plugin exception.
-                String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
-                logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
-                    cloudSiteId, tenantId, "VDU", "queryVdu(volume)", MsoLogger.ErrorCode.DataError.getValue(),
+                String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+                logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+                    cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu(volume)", ErrorCode.DataError.getValue(),
                     "Exception - queryVdu(volume)", me);
                 logger.debug(error);
                 // Convert to a generic VnfException
@@ -853,10 +854,10 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
             }
 
                if (volumeVdu == null || volumeVdu.getStatus().getState() == VduStateType.NOTFOUND) {
-                   String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR"  ;
-              logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
-                  cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
-                  MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+                   String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"  ;
+              logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+                  cloudOwner, cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
+                  ErrorCode.BusinessProcesssError.getValue(),
                   "Create VFModule: Attached Volume Group " + "DOES NOT EXIST");
               logger.debug(error);
                    throw new VnfException (error, MsoExceptionCategory.USERDATA);
@@ -892,9 +893,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                    }
                    catch (MsoException me) {
                        // Failed to query the Base VF Module due to a Vdu Plugin exception.
-                       String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
-                  logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
-                      cloudSiteId, tenantId, "VDU", "queryVdu(Base)", MsoLogger.ErrorCode.DataError.getValue(),
+                       String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+                  logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+                      cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu(Base)", ErrorCode.DataError.getValue(),
                       "Exception - queryVdu(Base)", me);
                   logger.debug(error);
                   // Convert to a generic VnfException
@@ -904,11 +905,11 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
 
                 if (baseVdu == null || baseVdu.getStatus().getState() == VduStateType.NOTFOUND) {
                     String error =
-                        "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/"
+                        "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/"
                             + tenantId + " USER ERROR";
-                    logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
-                        cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
-                        MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+                    logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+                        cloudOwner, cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
+                        ErrorCode.BusinessProcesssError.getValue(),
                         "Create VFModule: Base Module DOES NOT EXIST");
                     logger.debug(error);
                     throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -941,7 +942,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType="
             + requestType;
         logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", vfModuleType,
-            "VNF", MsoLogger.ErrorCode.DataError.getValue(), error);
+            "VNF", ErrorCode.DataError.getValue(), error);
         logger.debug(error);
         throw new VnfException(error, MsoExceptionCategory.INTERNAL);
     } else {
@@ -951,7 +952,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         if (heatEnvironment == null) {
             String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
             logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID",
-                "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+                "OpenStack", ErrorCode.DataError.getValue(), error);
             throw new VnfException(error, MsoExceptionCategory.INTERNAL);
         } else {
             logger.debug("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
@@ -1089,7 +1090,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                 // Problem - missing one or more required parameters
                 String error = "Create VFModule: Missing Required inputs: " + missingParams;
                 logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "VDU",
-                    MsoLogger.ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs");
+                    ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs");
                 logger.debug(error);
                 throw new VnfException(error, MsoExceptionCategory.USERDATA);
             } else {
@@ -1123,22 +1124,22 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         } catch (VduException me) {
             // Failed to instantiate the VDU.
             me.addContext("CreateVFModule");
-            String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-            logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
-                tenantId, "VDU", MsoLogger.ErrorCode.DataError.getValue(), "MsoException - instantiateVdu", me);
+            String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+            logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
+                tenantId, "VDU", ErrorCode.DataError.getValue(), "MsoException - instantiateVdu", me);
             logger.debug(error);
             // Convert to a generic VnfException
             throw new VnfException(me);
         } catch (NullPointerException npe) {
-            String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
-            logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
-                tenantId, "VDU", MsoLogger.ErrorCode.DataError.getValue(), "NullPointerException - instantiateVdu",
+            String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + npe;
+            logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
+                tenantId, "VDU", ErrorCode.DataError.getValue(), "NullPointerException - instantiateVdu",
                 npe);
             logger.debug(error);
             logger.debug("NULL POINTER EXCEPTION at vduPlugin.instantiateVdu", npe);
             throw new VnfException("NullPointerException during instantiateVdu");
         } catch (Exception e) {
-            String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + e;
+            String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
             logger.debug("Unhandled exception at vduPlugin.instantiateVdu", e);
             logger.debug(error);
             throw new VnfException("Exception during instantiateVdu: " + e.getMessage());
@@ -1160,23 +1161,23 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
 
 
     public void deleteVfModule (String cloudSiteId,
+                           String cloudOwner,
                            String tenantId,
                            String vfModuleId,
                            MsoRequest msoRequest,
                            Holder <Map <String, String>> outputs) throws VnfException
     {
-        MsoLogger.setLogContext (msoRequest);
 
-        logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+        logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
         // Will capture execution time for metrics
         long startTime = System.currentTimeMillis ();
 
         // Capture the output parameters on a delete, so need to query first
        VduInstance vduInstance = null;
-       CloudInfo cloudInfo = new CloudInfo(cloudSiteId, tenantId, null);
+       CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
 
         // Use the VduPlugin.
-        VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+        VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
 
        try {
                vduInstance = vduPlugin.queryVdu (cloudInfo, vfModuleId);
@@ -1185,9 +1186,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
           // Failed to query the VDU due to a plugin exception.
           // Convert to a generic VnfException
           e.addContext("QueryVFModule");
-          String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
-          logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudSiteId,
-              tenantId, "VDU", "QueryVFModule", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
+          String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
+          logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
+              tenantId, "VDU", "QueryVFModule", ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
           logger.debug(error);
           throw new VnfException(e);
       }
@@ -1208,9 +1209,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
         } catch (VduException me) {
             me.addContext ("DeleteVfModule");
             // Convert to a generic VnfException
-            String error = "Delete VF: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-            logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
-                tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError.getValue(),
+            String error = "Delete VF: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+            logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
+                tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(),
                 "Exception - DeleteVdu: " + me.getMessage());
             logger.debug(error);
             throw new VnfException (me);
@@ -1223,6 +1224,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
     // Update VF Module not yet implemented for generic VDU plug-in model.
     @Override
     public void updateVfModule (String cloudSiteId,
+                           String cloudOwner,
                            String tenantId,
                            String vnfType,
                            String vnfVersion,
@@ -1247,7 +1249,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
      * defined for the target cloud.  Should really be looking at the VNF Model (ochestration_mode)
      * but we don't currently have access to that in Query and Delete cases.
      */
-    private VduPlugin getVduPlugin (String cloudSiteId) {
+    private VduPlugin getVduPlugin (String cloudSiteId, String cloudOwner) {
        Optional<CloudSite> cloudSiteOp = cloudConfig.getCloudSite(cloudSiteId);
        if (cloudSiteOp.isPresent()) {
                CloudSite cloudSite = cloudSiteOp.get();