diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
index 043d2d3..893df02 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
@@ -29,6 +29,7 @@
 import org.onap.aai.domain.yang.Relationship;
 import org.onap.aai.domain.yang.RelationshipData;
 import org.onap.aai.domain.yang.RelationshipList;
+import org.onap.aai.domain.yang.Tenant;
 import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.AAIVersion;
@@ -92,20 +93,42 @@
      * @return the VNFM to use, or <code>null</code> if no VNFM has been assigned yet
      */
     public EsrVnfm getAssignedVnfm(final GenericVnf vnf) {
+        final Relationship relationship = getRelationship(vnf, "esr-vnfm");
+        final String vnfmId = getRelationshipKey(relationship, "esr-vnfm.vnfm-id");
+        return vnfmId == null ? null : aaiServiceProvider.invokeGetVnfm(vnfmId);
+    }
+
+    /**
+     * Get the tenant assigned for use for the given generic VNF.
+     *
+     * @param vnf the generic VNF
+     * @return the tenant to use, or <code>null</code> if no tenant has been assigned yet
+     */
+    public Tenant getAssignedTenant(final GenericVnf vnf) {
+        final Relationship relationship = getRelationship(vnf, "tenant");
+        final String cloudOwner = getRelationshipKey(relationship, "cloud-region.cloud-owner");
+        final String cloudRegion = getRelationshipKey(relationship, "cloud-region.cloud-region-id");
+        final String tenantId = getRelationshipKey(relationship, "tenant.tenant-id");
+        return cloudOwner == null || cloudRegion == null || tenantId == null ? null
+                : aaiServiceProvider.invokeGetTenant(cloudOwner, cloudRegion, tenantId);
+    }
+
+    private Relationship getRelationship(final GenericVnf vnf, final String relationshipRelatedToValue) {
         for (final Relationship relationship : vnf.getRelationshipList() == null ? Collections.<Relationship>emptyList()
                 : vnf.getRelationshipList().getRelationship()) {
-            if ("esr-vnfm".equals(relationship.getRelatedTo())) {
-                return getRelatedVnfmId(relationship);
+            if (relationship.getRelatedTo().equals(relationshipRelatedToValue)) {
+                return relationship;
             }
         }
         return null;
     }
 
-    private EsrVnfm getRelatedVnfmId(final Relationship relationship) {
-        for (final RelationshipData relationshipData : relationship.getRelationshipData()) {
-            if ("esr-vnfm.vnfm-id".equals(relationshipData.getRelationshipKey())) {
-                logger.debug("VNFM URL from GenericVnf relataionship: " + relationshipData.getRelationshipValue());
-                return aaiServiceProvider.invokeGetVnfm(relationshipData.getRelationshipValue());
+    private String getRelationshipKey(final Relationship relationship, final String relationshipKey) {
+        if (relationship != null) {
+            for (final RelationshipData relationshipData : relationship.getRelationshipData()) {
+                if (relationshipData.getRelationshipKey().equals(relationshipKey)) {
+                    return relationshipData.getRelationshipValue();
+                }
             }
         }
         return null;
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
index b8f0706..d11da0c 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
@@ -24,6 +24,7 @@
 import org.onap.aai.domain.yang.EsrVnfm;
 import org.onap.aai.domain.yang.EsrVnfmList;
 import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Tenant;
 
 /**
  * Provides methods for invoking REST calls to AAI.
@@ -52,7 +53,6 @@
      */
     EsrSystemInfoList invokeGetVnfmEsrSystemInfoList(final String vnfmId);
 
-
     /**
      * Invoke a GET request for the a VNFM.
      *
@@ -69,4 +69,23 @@
      */
     void invokePutGenericVnf(GenericVnf vnf);
 
+    /**
+     * Invoke a GET request for the a tenant.
+     *
+     * @param cloudOwner the cloud owner
+     * @param cloudRegion the cloud region
+     * @param tenantId the ID of the tenant
+     * @return the tenant
+     */
+    Tenant invokeGetTenant(final String cloudOwner, final String cloudRegion, final String tenantId);
+
+    /**
+     * Invoke a GET request for the esr system info list for a cloud region.
+     *
+     * @param cloudOwner the cloud owner
+     * @param cloudRegion the cloud region
+     * @return the esr system info list for the VNFM
+     */
+    EsrSystemInfoList invokeGetCloudRegionEsrSystemInfoList(final String cloudOwner, final String cloudRegion);
+
 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
index 234748e..fa0dcf0 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
@@ -24,6 +24,7 @@
 import org.onap.aai.domain.yang.EsrVnfm;
 import org.onap.aai.domain.yang.EsrVnfmList;
 import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Tenant;
 import org.onap.so.client.aai.AAIObjectType;
 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
 import org.slf4j.Logger;
@@ -87,4 +88,26 @@
                 .update(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()), vnf);
     }
 
+    @Override
+    public Tenant invokeGetTenant(final String cloudOwner, final String cloudRegion, final String tenantId) {
+        return aaiClientProvider.getAaiClient()
+                .get(Tenant.class,
+                        AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId))
+                .orElseGet(() -> {
+                    logger.debug("Tenant not found in AAI");
+                    return null;
+                });
+    }
+
+    @Override
+    public EsrSystemInfoList invokeGetCloudRegionEsrSystemInfoList(final String cloudOwner, final String cloudRegion) {
+        return aaiClientProvider
+                .getAaiClient().get(EsrSystemInfoList.class, AAIUriFactory
+                        .createResourceUri(AAIObjectType.CLOUD_ESR_SYSTEM_INFO_LIST, cloudOwner, cloudRegion))
+                .orElseGet(() -> {
+                    logger.debug("Cloud esr system info list not found in AAI");
+                    return null;
+                });
+    }
+
 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java
new file mode 100644
index 0000000..6f2827c
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java
@@ -0,0 +1,109 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.vim.model;
+
+import java.util.Objects;
+
+public class AccessInfo {
+
+    protected String projectId;
+    protected String projectName;
+    protected String domainName;
+    protected VimCredentials credentials;
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(final String value) {
+        projectId = value;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(final String value) {
+        projectName = value;
+    }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public void setDomainName(final String value) {
+        domainName = value;
+    }
+
+    public VimCredentials getCredentials() {
+        return credentials;
+    }
+
+    public void setCredentials(final VimCredentials value) {
+        credentials = value;
+    }
+
+    @Override
+    public boolean equals(final java.lang.Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        final AccessInfo accessInfo = (AccessInfo) o;
+        return Objects.equals(this.projectId, accessInfo.projectId)
+                && Objects.equals(this.projectName, accessInfo.projectName)
+                && Objects.equals(this.domainName, accessInfo.domainName)
+                && Objects.equals(this.credentials, accessInfo.credentials);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(projectId, projectName, domainName, credentials);
+    }
+
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("class AccessInfo {\n");
+
+        sb.append("    projectId: ").append(toIndentedString(projectId)).append("\n");
+        sb.append("    projectName: ").append(toIndentedString(projectName)).append("\n");
+        sb.append("    domainName: ").append(toIndentedString(domainName)).append("\n");
+        sb.append("    credentials: ").append(toIndentedString(credentials)).append("\n");
+        sb.append("}");
+        return sb.toString();
+    }
+
+    /**
+     * Convert the given object to string with each line indented by 4 spaces (except the first line).
+     */
+    private String toIndentedString(final java.lang.Object o) {
+        if (o == null) {
+            return "null";
+        }
+        return o.toString().replace("\n", "\n    ");
+    }
+
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java
new file mode 100644
index 0000000..c974f2b
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.vim.model;
+
+import java.util.Objects;
+
+public class InterfaceInfo {
+
+    protected String identityEndPoint;
+
+    public String getIdentityEndPoint() {
+        return identityEndPoint;
+    }
+
+    public void setIdentityEndPoint(final String value) {
+        identityEndPoint = value;
+    }
+
+    @Override
+    public boolean equals(final java.lang.Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        final InterfaceInfo interfaceInfo = (InterfaceInfo) o;
+        return Objects.equals(this.identityEndPoint, interfaceInfo.identityEndPoint);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(identityEndPoint);
+    }
+
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("class InterfaceInfo {\n");
+
+        sb.append("    identityEndPoint: ").append(toIndentedString(identityEndPoint)).append("\n");
+        sb.append("}");
+        return sb.toString();
+    }
+
+    /**
+     * Convert the given object to string with each line indented by 4 spaces (except the first line).
+     */
+    private String toIndentedString(final java.lang.Object o) {
+        if (o == null) {
+            return "null";
+        }
+        return o.toString().replace("\n", "\n    ");
+    }
+
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java
new file mode 100644
index 0000000..35971ba
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.vim.model;
+
+import java.util.Objects;
+
+public class VimCredentials {
+
+    protected String username;
+
+    protected String password;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(final String value) {
+        username = value;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(final String password) {
+        this.password = password;
+    }
+
+    @Override
+    public boolean equals(final java.lang.Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        final VimCredentials vimCredentials = (VimCredentials) o;
+        return Objects.equals(this.username, vimCredentials.username)
+                && Objects.equals(this.password, vimCredentials.password);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(username, password);
+    }
+
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("class AccessInfo {\n");
+
+        sb.append("    username: ").append(toIndentedString(username)).append("\n");
+        sb.append("    password: ").append(toIndentedString(password)).append("\n");
+        sb.append("}");
+        return sb.toString();
+    }
+
+    /**
+     * Convert the given object to string with each line indented by 4 spaces (except the first line).
+     */
+    private String toIndentedString(final java.lang.Object o) {
+        if (o == null) {
+            return "null";
+        }
+        return o.toString().replace("\n", "\n    ");
+    }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java
new file mode 100644
index 0000000..3b2b87f
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java
@@ -0,0 +1,152 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
+
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.onap.aai.domain.yang.EsrSystemInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.vim.model.InterfaceInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.vim.model.VimCredentials;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo;
+import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+import org.onap.vnfmadapter.v1.model.Tenant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * Provides helper methods for interactions with VNFM.
+ */
+@Service
+public class VnfmHelper {
+
+    private static final Logger logger = LoggerFactory.getLogger(VnfmHelper.class);
+    private static final String SEPARATOR = "_";
+    private final AaiServiceProvider aaiServiceProvider;
+
+    @Autowired
+    public VnfmHelper(final AaiServiceProvider aaiServiceProvider) {
+        this.aaiServiceProvider = aaiServiceProvider;
+    }
+
+    /**
+     * Create an {@link InstantiateVnfRequest} to send in an instantiation request to a VNFM.
+     *
+     * @param tenant the tenant the request is to be fulfilled on
+     * @param createVnfRequest the request received by the VNFM adapter
+     */
+    public InstantiateVnfRequest createInstantiateRequest(final Tenant tenant,
+            final CreateVnfRequest createVnfRequest) {
+        final InstantiateVnfRequest instantiateVnfRequest = new InstantiateVnfRequest();
+        instantiateVnfRequest.setFlavourId(getFlavourId());
+        instantiateVnfRequest.setVimConnectionInfo(getVimConnectionInfos(tenant));
+        instantiateVnfRequest
+                .setAdditionalParams(getAdditionalParametersAsJsonObject(createVnfRequest.getAdditionalParams()));
+        instantiateVnfRequest.setExtVirtualLinks(getExternalVirtualLinks(createVnfRequest.getExternalVirtualLinks()));
+        createVnfRequest.getExternalVirtualLinks();
+        return instantiateVnfRequest;
+    }
+
+    private String getFlavourId() {
+        // TODO read from csar
+        return "default";
+    }
+
+    private List<VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo> getVimConnectionInfos(final Tenant tenant) {
+        final List<VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo> connectionInfos = new ArrayList<>();
+        connectionInfos.add(getVimConnectionInfo(tenant));
+        return connectionInfos;
+    }
+
+    private VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo getVimConnectionInfo(final Tenant tenant) {
+        final EsrSystemInfo esrSystemInfo =
+                aaiServiceProvider.invokeGetCloudRegionEsrSystemInfoList(tenant.getCloudOwner(), tenant.getRegionName())
+                        .getEsrSystemInfo().iterator().next();
+
+        final VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo vnfInstancesVimConnectionInfo =
+                new VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo();
+        final String vimId = createVimId(tenant.getCloudOwner(), tenant.getRegionName());
+        vnfInstancesVimConnectionInfo.setId(vimId);
+        vnfInstancesVimConnectionInfo.setVimId(vimId);
+        vnfInstancesVimConnectionInfo.setVimType(esrSystemInfo.getType());
+        vnfInstancesVimConnectionInfo.setInterfaceInfo(getInterfaceInfo(esrSystemInfo.getServiceUrl()));
+        vnfInstancesVimConnectionInfo.setAccessInfo(getAccessInfo(esrSystemInfo, tenant.getTenantId()));
+        return vnfInstancesVimConnectionInfo;
+    }
+
+    private InterfaceInfo getInterfaceInfo(final String url) {
+        final InterfaceInfo interfaceInfo = new InterfaceInfo();
+        interfaceInfo.setIdentityEndPoint(url);
+        return interfaceInfo;
+    }
+
+    private AccessInfo getAccessInfo(final EsrSystemInfo esrSystemInfo, final String tenantId) {
+        final AccessInfo accessInfo = new AccessInfo();
+        accessInfo.setProjectId(tenantId);
+        accessInfo.setDomainName(esrSystemInfo.getCloudDomain());
+
+        final VimCredentials vimCredentials = new VimCredentials();
+        vimCredentials.setUsername(esrSystemInfo.getUserName());
+        vimCredentials.setPassword(esrSystemInfo.getPassword());
+        accessInfo.setCredentials(vimCredentials);
+        return accessInfo;
+    }
+
+    private String createVimId(final String cloudOwner, final String cloudRegion) {
+        return cloudOwner + SEPARATOR + cloudRegion;
+    }
+
+    private JsonObject getAdditionalParametersAsJsonObject(final Map<String, String> additionalParameters) {
+        final JsonObject additionalParametersJsonObject = new JsonObject();
+        if (additionalParameters != null) {
+            for (final Map.Entry<String, JsonElement> item : new Gson().toJsonTree(additionalParameters)
+                    .getAsJsonObject().entrySet()) {
+                additionalParametersJsonObject.add(item.getKey(), item.getValue());
+            }
+        } else {
+            logger.warn("No additional parameters were specified for the operation");
+        }
+        return additionalParametersJsonObject;
+    }
+
+    private List<VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks> getExternalVirtualLinks(
+            final List<ExternalVirtualLink> extVirtualLinks) {
+        if (extVirtualLinks != null) {
+            final String extVirtualLinksJsonObject =
+                    new Gson().toJson(extVirtualLinks, new TypeToken<List<ExternalVirtualLink>>() {}.getType());
+            return new Gson().fromJson(extVirtualLinksJsonObject,
+                    new TypeToken<List<VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks>>() {}.getType());
+        }
+        return null;
+    }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java
index f0646f3..aaf7e46 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java
@@ -23,6 +23,7 @@
 import com.google.common.base.Optional;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
 
 /**
  * Provides methods for invoking REST calls to a VNFM.
@@ -38,6 +39,15 @@
     Optional<InlineResponse201> getVnf(final String vnfSelfLink);
 
     /**
+     * Invoke an instantiate request for a VNF.
+     *
+     * @param vnfSelfLink the link to he VNF on the VNFM
+     * @param instantiateVnfRequest the instantiate request
+     * @return the operation ID of the instantiation operation
+     */
+    String instantiateVnf(final String vnfSelfLink, final InstantiateVnfRequest instantiateVnfRequest);
+
+    /**
      * Invoke a get request for a VNFM operation.
      *
      * @param vnfmId the id of the VNFM in AAI
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
index 43d4f1e..4a2c7a9 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
@@ -23,13 +23,20 @@
 import com.google.common.base.Optional;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException;
 import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
 @Service
 public class VnfmServiceProviderImpl implements VnfmServiceProvider {
+    private static final Logger logger = LoggerFactory.getLogger(VnfmServiceProviderImpl.class);
 
     private final HttpRestServiceProvider httpServiceProvider;
     private final VnfmUrlProvider urlProvider;
@@ -47,8 +54,21 @@
     }
 
     @Override
+    public String instantiateVnf(final String vnfSelfLink, final InstantiateVnfRequest instantiateVnfRequest) {
+        logger.debug("Sending instantiate request " + instantiateVnfRequest + " to : " + vnfSelfLink);
+        final ResponseEntity<Void> response = httpServiceProvider.getHttpResponse(vnfSelfLink, Void.class);
+        if (response.getStatusCode() != HttpStatus.ACCEPTED) {
+            throw new VnfmRequestFailureException("Instantiate request to " + vnfSelfLink + " return status code: "
+                    + response.getStatusCode() + ", request: " + instantiateVnfRequest);
+        }
+        final String locationHeader = response.getHeaders().get("Location").iterator().next();
+        return locationHeader.substring(locationHeader.lastIndexOf("/") + 1);
+    }
+
+    @Override
     public Optional<InlineResponse200> getOperation(final String vnfmId, final String operationId) {
         final String url = urlProvider.getOperationUrl(vnfmId, operationId);
         return httpServiceProvider.get(url, InlineResponse200.class);
     }
+
 }
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java
index f5a99b1..f0280d6 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java
@@ -46,10 +46,10 @@
     }
 
     /**
-     * Get the URL for a generic VNF in AAI.
+     * Get the URL for an operation on a VNFM.
      *
-     * @param vnfId The identifier of the VNF
-     * @return the URL of the VNF
+     * @param vnfmId The ID of the VNFM
+     * @return the URL of the operation
      */
     public String getOperationUrl(final String vnfmId, final String operationId) {
         final String url = UriComponentsBuilder.fromUri(getBaseUri(vnfmId)).pathSegment("/vnf_lcm_op_occs/")
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
index 5c944ca..4bedb47 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
@@ -24,14 +24,13 @@
 import java.util.UUID;
 import org.onap.aai.domain.yang.EsrVnfm;
 import org.onap.aai.domain.yang.GenericVnf;
-import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiClientProvider;
 import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper;
+import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHelper;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
 import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager;
-import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
 import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
 import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
 import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
@@ -46,17 +45,19 @@
 @Component
 public class LifecycleManager {
     private static final Logger logger = LoggerFactory.getLogger(LifecycleManager.class);
-    private final AaiClientProvider aaiClientProvider;
+    private final AaiServiceProvider aaiServiceProvider;
     private final VnfmServiceProvider vnfmServiceProvider;
     private final AaiHelper aaiHelper;
+    private final VnfmHelper vnfmHelper;
     private final JobManager jobManager;
 
     @Autowired
-    LifecycleManager(final AaiClientProvider aaiClientProvider, final AaiHelper aaiHelper,
-            final VnfmServiceProvider vnfmServiceProvider, final JobManager jobManager) {
-        this.aaiClientProvider = aaiClientProvider;
+    LifecycleManager(final AaiServiceProvider aaiServiceProvider, final AaiHelper aaiHelper,
+            final VnfmHelper vnfmHelper, final VnfmServiceProvider vnfmServiceProvider, final JobManager jobManager) {
+        this.aaiServiceProvider = aaiServiceProvider;
         this.vnfmServiceProvider = vnfmServiceProvider;
         this.aaiHelper = aaiHelper;
+        this.vnfmHelper = vnfmHelper;
         this.jobManager = jobManager;
     }
 
@@ -77,22 +78,17 @@
             aaiHelper.addRelationshipFromGenericVnfToVnfm(genericVnf, vnfm.getVnfmId());
         }
 
-        // operation ID set to random value for now, will be set correctly once we implement instantiate
-        // call towards the VNFM
-        final String jobId = jobManager.createJob(vnfm.getVnfmId(), UUID.randomUUID().toString(), false);
+        final String vnfIdInVnfm = sendCreateRequestToVnfm(genericVnf);
+        final String operationId = sendInstantiateRequestToVnfm(vnfm, genericVnf, request, vnfIdInAai, vnfIdInVnfm);
+
+        final String jobId = jobManager.createJob(vnfm.getVnfmId(), operationId, false);
         final CreateVnfResponse response = new CreateVnfResponse();
         response.setJobId(jobId);
         return response;
     }
 
     private GenericVnf getGenericVnfFromAai(final String vnfIdInAai) {
-        final GenericVnf genericVnf = aaiClientProvider.getAaiClient()
-                .get(GenericVnf.class,
-                        AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfIdInAai).depth(Depth.ONE))
-                .orElseGet(() -> {
-                    logger.debug("No Generic Vnf matched by id");
-                    return null;
-                });
+        final GenericVnf genericVnf = aaiServiceProvider.invokeGetGenericVnf(vnfIdInAai);
         logger.debug("Retrieved generic VNF from AAI: " + genericVnf);
         return genericVnf;
     }
@@ -112,6 +108,23 @@
         }
     }
 
+    private String sendCreateRequestToVnfm(final GenericVnf genericVnf) {
+        // TODO call create request
+        genericVnf.setSelflink("http://dummy.value/until/create/implememted/vnfId");
+        return "vnfId";
+    }
+
+    private String sendInstantiateRequestToVnfm(final EsrVnfm vnfm, final GenericVnf genericVnf,
+            final CreateVnfRequest createVnfRequest, final String vnfIdInAai, final String vnfIdInVnfm) {
+
+        final InstantiateVnfRequest instantiateVnfRequest =
+                vnfmHelper.createInstantiateRequest(createVnfRequest.getTenant(), createVnfRequest);
+        final String jobId = vnfmServiceProvider.instantiateVnf(genericVnf.getSelflink(), instantiateVnfRequest);
+
+        logger.info("Instantiate VNF request successfully sent to " + genericVnf.getSelflink());
+        return jobId;
+    }
+
     /**
      * Delete a VNF on a VNFM.
      *
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java
new file mode 100644
index 0000000..57a812d
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
+
+/**
+ * Exception indicating a request to a VNFM failed.
+ */
+public class VnfmRequestFailureException extends RuntimeException {
+
+    private static final long serialVersionUID = 6398018034431666933L;
+
+    public VnfmRequestFailureException(final String message) {
+        super(message);
+    }
+
+}
+
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
index 29bab9d..ae2e280 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
@@ -27,6 +27,7 @@
 import static org.mockito.Mockito.verify;
 import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
 import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
 import com.google.gson.Gson;
 import java.net.URI;
@@ -90,6 +91,9 @@
             OffsetDateTime.of(LocalDateTime.of(2019, 1, 1, 12, 0), ZoneOffset.UTC);
     private static final OffsetDateTime JAN_1_2019_1_00 =
             OffsetDateTime.of(LocalDateTime.of(2019, 1, 1, 1, 0), ZoneOffset.UTC);
+    private static final String CLOUD_OWNER = "myTestCloudOwner";
+    private static final String REGION = "myTestRegion";
+    private static final String TENANT_ID = "myTestTenantId";
 
     @LocalServerPort
     private int port;
@@ -112,65 +116,28 @@
 
     @Test
     public void createVnf_ValidRequest_Returns202AndJobId() throws Exception {
-        final Tenant tenant =
-                new Tenant().cloudOwner("myTestCloudOwner").regionName("myTestRegion").tenantId("myTestTenantId");
+        final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
         final CreateVnfRequest createVnfRequest = new CreateVnfRequest().name("myTestName").tenant(tenant);
 
-        final GenericVnf genericVnf = new GenericVnf();
-        genericVnf.setVnfId("myTestVnfId");
-        genericVnf.setNfType("vnfmType2");
+        setUpGenericVnfInMockAai("vnfmType2");
+        setUpVnfmsInMockAai();
+        setUpVimInMockAai();
 
-        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class), MockitoHamcrest
-                .argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId?depth=1")));
+        mockRestServer.expect(requestTo("http://dummy.value/until/create/implememted/vnfId"))
+                .andRespond(withStatus(HttpStatus.ACCEPTED).contentType(MediaType.APPLICATION_JSON)
+                        .location(new URI("http://vnfm2:8080/vnf_lcm_op_occs/123456")));
 
-        final EsrSystemInfo esrSystemInfo1 = new EsrSystemInfo();
-        esrSystemInfo1.setServiceUrl("http://vnfm1:8080");
-        esrSystemInfo1.setType("vnfmType1");
-        esrSystemInfo1.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList1 = new EsrSystemInfoList();
-        esrSystemInfoList1.getEsrSystemInfo().add(esrSystemInfo1);
-
-        final EsrVnfm esrVnfm1 = new EsrVnfm();
-        esrVnfm1.setVnfmId("vnfm1");
-        esrVnfm1.setEsrSystemInfoList(esrSystemInfoList1);
-        esrVnfm1.setResourceVersion("1234");
-
-        final EsrSystemInfo esrSystemInfo2 = new EsrSystemInfo();
-        esrSystemInfo2.setServiceUrl("http://vnfm2:8080");
-        esrSystemInfo2.setType("vnfmType2");
-        esrSystemInfo2.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList2 = new EsrSystemInfoList();
-        esrSystemInfoList2.getEsrSystemInfo().add(esrSystemInfo2);
-
-        final EsrVnfm esrVnfm2 = new EsrVnfm();
-        esrVnfm2.setVnfmId("vnfm2");
-        esrVnfm2.setEsrSystemInfoList(esrSystemInfoList2);
-        esrVnfm2.setResourceVersion("1234");
-
-        final EsrVnfmList esrVnfmList = new EsrVnfmList();
-        esrVnfmList.getEsrVnfm().add(esrVnfm1);
-        esrVnfmList.getEsrVnfm().add(esrVnfm2);
-
-        doReturn(Optional.of(esrVnfmList)).when(aaiResourcesClient).get(eq(EsrVnfmList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/external-system/esr-vnfm-list")));
-
-        doReturn(Optional.of(esrSystemInfoList1)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
-                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm1/esr-system-info-list")));
-        doReturn(Optional.of(esrSystemInfoList2)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
-                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm2/esr-system-info-list")));
 
         final InlineResponse200 firstOperationQueryResponse = createOperationQueryResponse(
                 org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE,
                 org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING);
-        mockRestServer.expect(requestTo(new StringStartsWith("http://vnfm2:8080/vnf_lcm_op_occs")))
+        mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456"))
                 .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON));
 
         final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse(
                 org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE,
                 org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED);
-        mockRestServer.expect(requestTo(new StringStartsWith("http://vnfm2:8080/vnf_lcm_op_occs")))
+        mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456"))
                 .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON));
 
         // Invoke the create request
@@ -214,138 +181,47 @@
 
     @Test(expected = IllegalArgumentException.class)
     public void createVnf_VnfAlreadyExistsOnVnfm_ThrowsIllegalArgumentException() throws Exception {
-        final Tenant tenant =
-                new Tenant().cloudOwner("myTestCloudOwner").regionName("myTestRegion").tenantId("myTestTenantId");
+        final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
         final CreateVnfRequest createVnfRequest = new CreateVnfRequest().name("myTestName").tenant(tenant);
 
         final GenericVnf genericVnf = new GenericVnf();
         genericVnf.setVnfId("myTestVnfId");
-        genericVnf.setNfType("vnfmType");
+        genericVnf.setNfType("vnfmType1");
         genericVnf.setSelflink("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm");
 
-        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class), MockitoHamcrest
-                .argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId?depth=1")));
-
-        final EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
-        esrSystemInfo.setServiceUrl("http://vnfm:8080");
-        esrSystemInfo.setType("vnfmType");
-        esrSystemInfo.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
-        esrSystemInfoList.getEsrSystemInfo().add(esrSystemInfo);
-
-        final EsrVnfm esrVnfm = new EsrVnfm();
-        esrVnfm.setVnfmId("vnfm");
-        esrVnfm.setEsrSystemInfoList(esrSystemInfoList);
-        esrVnfm.setResourceVersion("1234");
-
-        final EsrVnfmList esrVnfmList = new EsrVnfmList();
-        esrVnfmList.getEsrVnfm().add(esrVnfm);
+        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId")));
 
         final InlineResponse201 reponse = new InlineResponse201();
         mockRestServer.expect(requestTo(new URI("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm")))
                 .andRespond(withSuccess(gson.toJson(reponse), MediaType.APPLICATION_JSON));
 
-        doReturn(Optional.of(esrVnfmList)).when(aaiResourcesClient).get(eq(EsrVnfmList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/external-system/esr-vnfm-list")));
-
         controller.vnfCreate("myTestVnfId", createVnfRequest, "asadas", "so", "1213");
     }
 
     @Test(expected = VnfmNotFoundException.class)
     public void createVnf_NoMatchingVnfmFound_ThrowsException() throws Exception {
-        final Tenant tenant =
-                new Tenant().cloudOwner("myTestCloudOwner").regionName("myTestRegion").tenantId("myTestTenantId");
+        final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
         final CreateVnfRequest createVnfRequest = new CreateVnfRequest().name("myTestName").tenant(tenant);
 
-        final GenericVnf genericVnf = new GenericVnf();
-        genericVnf.setVnfId("myTestVnfId");
-        genericVnf.setNfType("anotherType");
-
-        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class), MockitoHamcrest
-                .argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId?depth=1")));
-
-        final EsrSystemInfo esrSystemInfo1 = new EsrSystemInfo();
-        esrSystemInfo1.setServiceUrl("http://vnfm1:8080");
-        esrSystemInfo1.setType("vnfmType1");
-        esrSystemInfo1.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList1 = new EsrSystemInfoList();
-        esrSystemInfoList1.getEsrSystemInfo().add(esrSystemInfo1);
-
-        final EsrVnfm esrVnfm1 = new EsrVnfm();
-        esrVnfm1.setVnfmId("vnfm1");
-        esrVnfm1.setEsrSystemInfoList(esrSystemInfoList1);
-        esrVnfm1.setResourceVersion("1234");
-
-        final EsrSystemInfo esrSystemInfo2 = new EsrSystemInfo();
-        esrSystemInfo2.setServiceUrl("http://vnfm2:8080");
-        esrSystemInfo2.setType("vnfmType2");
-        esrSystemInfo2.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList2 = new EsrSystemInfoList();
-        esrSystemInfoList2.getEsrSystemInfo().add(esrSystemInfo2);
-
-        final EsrVnfm esrVnfm2 = new EsrVnfm();
-        esrVnfm2.setVnfmId("vnfm2");
-        esrVnfm2.setEsrSystemInfoList(esrSystemInfoList2);
-        esrVnfm2.setResourceVersion("1234");
-
-        final EsrVnfmList esrVnfmList = new EsrVnfmList();
-        esrVnfmList.getEsrVnfm().add(esrVnfm1);
-        esrVnfmList.getEsrVnfm().add(esrVnfm2);
-
-        doReturn(Optional.of(esrVnfmList)).when(aaiResourcesClient).get(eq(EsrVnfmList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/external-system/esr-vnfm-list")));
-
-
-        doReturn(Optional.of(esrSystemInfoList1)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
-                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm1/esr-system-info-list")));
-
-        doReturn(Optional.of(esrSystemInfoList2)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
-                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm2/esr-system-info-list")));
+        setUpGenericVnfInMockAai("anotherType");
+        setUpVnfmsInMockAai();
 
         controller.vnfCreate("myTestVnfId", createVnfRequest, "asadas", "so", "1213");
     }
 
     @Test
     public void createVnf_VnfmAlreadyAssociatedWithVnf_Returns202AndJobId() throws Exception {
-        final Tenant tenant =
-                new Tenant().cloudOwner("myTestCloudOwner").regionName("myTestRegion").tenantId("myTestTenantId");
+        final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
         final CreateVnfRequest createVnfRequest = new CreateVnfRequest().name("myTestName").tenant(tenant);
 
-        final GenericVnf genericVnf = new GenericVnf();
-        genericVnf.setVnfId("myTestVnfId");
-        genericVnf.setNfType("vnfmType2");
+        setUpGenericVnfWithVnfmRelationshipInMockAai("vnfmType2", "vnfm1");
+        setUpVnfmsInMockAai();
+        setUpVimInMockAai();
 
-        final Relationship relationshipToVnfm = new Relationship();
-        relationshipToVnfm.setRelatedLink("/aai/v15/external-system/esr-vnfm-list/esr-vnfm/vnfm1");
-        relationshipToVnfm.setRelatedTo("esr-vnfm");
-        final RelationshipData relationshipData = new RelationshipData();
-        relationshipData.setRelationshipKey("esr-vnfm.vnfm-id");
-        relationshipData.setRelationshipValue("vnfm1");
-        relationshipToVnfm.getRelationshipData().add(relationshipData);
-
-        final RelationshipList relationshipList = new RelationshipList();
-        relationshipList.getRelationship().add(relationshipToVnfm);
-        genericVnf.setRelationshipList(relationshipList);
-
-        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class), MockitoHamcrest
-                .argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId?depth=1")));
-
-        final EsrSystemInfo esrSystemInfo1 = new EsrSystemInfo();
-        esrSystemInfo1.setServiceUrl("http://vnfm1:8080");
-        esrSystemInfo1.setType("vnfmType1");
-        esrSystemInfo1.setSystemType("VNFM");
-        final EsrSystemInfoList esrSystemInfoList1 = new EsrSystemInfoList();
-        esrSystemInfoList1.getEsrSystemInfo().add(esrSystemInfo1);
-
-        final EsrVnfm esrVnfm1 = new EsrVnfm();
-        esrVnfm1.setVnfmId("vnfm1");
-        esrVnfm1.setEsrSystemInfoList(esrSystemInfoList1);
-        esrVnfm1.setResourceVersion("1234");
-
-        doReturn(Optional.of(esrVnfm1)).when(aaiResourcesClient).get(eq(EsrVnfm.class),
-                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/external-system/esr-vnfm-list/esr-vnfm/vnfm1")));
+        mockRestServer.expect(requestTo("http://dummy.value/until/create/implememted/vnfId"))
+                .andRespond(withStatus(HttpStatus.ACCEPTED).contentType(MediaType.APPLICATION_JSON)
+                        .location(new URI("http://vnfm2:8080/vnf_lcm_op_occs/123456")));
 
         final ResponseEntity<CreateVnfResponse> response =
                 controller.vnfCreate("myTestVnfId", createVnfRequest, "asadas", "so", "1213");
@@ -356,8 +232,7 @@
     @Test
     public void createVnf_UnauthorizedUser_Returns401() throws Exception {
         final TestRestTemplate restTemplateWrongPassword = new TestRestTemplate("test", "wrongPassword");
-        final Tenant tenant =
-                new Tenant().cloudOwner("myTestCloudOwner").regionName("myTestRegion").tenantId("myTestTenantId");
+        final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
         final CreateVnfRequest createVnfRequest = new CreateVnfRequest().name("myTestName").tenant(tenant);
 
         final RequestEntity<CreateVnfRequest> request =
@@ -435,6 +310,101 @@
         return response;
     }
 
+    private GenericVnf createGenericVnf(final String type) {
+        final GenericVnf genericVnf = new GenericVnf();
+        genericVnf.setVnfId("myTestVnfId");
+        genericVnf.setNfType(type);
+        return genericVnf;
+    }
+
+    private void setUpGenericVnfInMockAai(final String type) {
+        final GenericVnf genericVnf = createGenericVnf(type);
+
+        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId")));
+    }
+
+    private void setUpGenericVnfWithVnfmRelationshipInMockAai(final String type, final String vnfmId) {
+        final GenericVnf genericVnf = createGenericVnf(type);
+
+        final Relationship relationshipToVnfm = new Relationship();
+        relationshipToVnfm.setRelatedLink(
+                "/aai/v15/external-system/esr-vnfm-li//        final InlineResponse201 vnfInstance = new InlineResponse201();\n"
+                        + "//        vnfInstance.setInstantiationState(InstantiationStateEnum.NOT_INSTANTIATED);\n"
+                        + "//        mockRestServer.expect(requestTo(\"http://dummy.value/until/create/implememted/vnfId\"))\n"
+                        + "//                .andRespond(withSuccess(gson.toJson(vnfInstance), MediaType.APPLICATION_JSON));st/esr-vnfm/"
+                        + vnfmId);
+        relationshipToVnfm.setRelatedTo("esr-vnfm");
+        final RelationshipData relationshipData = new RelationshipData();
+        relationshipData.setRelationshipKey("esr-vnfm.vnfm-id");
+        relationshipData.setRelationshipValue(vnfmId);
+        relationshipToVnfm.getRelationshipData().add(relationshipData);
+
+        final RelationshipList relationshipList = new RelationshipList();
+        relationshipList.getRelationship().add(relationshipToVnfm);
+        genericVnf.setRelationshipList(relationshipList);
+
+        doReturn(Optional.of(genericVnf)).when(aaiResourcesClient).get(eq(GenericVnf.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/network/generic-vnfs/generic-vnf/myTestVnfId")));
+    }
+
+    private void setUpVnfmsInMockAai() {
+        final EsrSystemInfo esrSystemInfo1 = new EsrSystemInfo();
+        esrSystemInfo1.setServiceUrl("http://vnfm1:8080");
+        esrSystemInfo1.setType("vnfmType1");
+        esrSystemInfo1.setSystemType("VNFM");
+        final EsrSystemInfoList esrSystemInfoList1 = new EsrSystemInfoList();
+        esrSystemInfoList1.getEsrSystemInfo().add(esrSystemInfo1);
+
+        final EsrVnfm esrVnfm1 = new EsrVnfm();
+        esrVnfm1.setVnfmId("vnfm1");
+        esrVnfm1.setEsrSystemInfoList(esrSystemInfoList1);
+        esrVnfm1.setResourceVersion("1234");
+
+        final EsrSystemInfo esrSystemInfo2 = new EsrSystemInfo();
+        esrSystemInfo2.setServiceUrl("http://vnfm2:8080");
+        esrSystemInfo2.setType("vnfmType2");
+        esrSystemInfo2.setSystemType("VNFM");
+        final EsrSystemInfoList esrSystemInfoList2 = new EsrSystemInfoList();
+        esrSystemInfoList2.getEsrSystemInfo().add(esrSystemInfo2);
+
+        final EsrVnfm esrVnfm2 = new EsrVnfm();
+        esrVnfm2.setVnfmId("vnfm2");
+        esrVnfm2.setEsrSystemInfoList(esrSystemInfoList2);
+        esrVnfm2.setResourceVersion("1234");
+
+        final EsrVnfmList esrVnfmList = new EsrVnfmList();
+        esrVnfmList.getEsrVnfm().add(esrVnfm1);
+        esrVnfmList.getEsrVnfm().add(esrVnfm2);
+
+        doReturn(Optional.of(esrVnfmList)).when(aaiResourcesClient).get(eq(EsrVnfmList.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/external-system/esr-vnfm-list")));
+
+        doReturn(Optional.of(esrSystemInfoList1)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
+                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm1/esr-system-info-list")));
+        doReturn(Optional.of(esrSystemInfoList2)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher(
+                        "/external-system/esr-vnfm-list/esr-vnfm/vnfm2/esr-system-info-list")));
+    }
+
+    private void setUpVimInMockAai() {
+        final EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+        esrSystemInfo.setServiceUrl("http://myVim:8080");
+        esrSystemInfo.setType("openstack");
+        esrSystemInfo.setSystemType("VIM");
+        esrSystemInfo.setCloudDomain("myDomain");
+        esrSystemInfo.setUserName("myUser");
+        esrSystemInfo.setPassword("myPassword");
+
+        final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+        esrSystemInfoList.getEsrSystemInfo().add(esrSystemInfo);
+
+        doReturn(Optional.of(esrSystemInfoList)).when(aaiResourcesClient).get(eq(EsrSystemInfoList.class),
+                MockitoHamcrest.argThat(new AaiResourceUriMatcher("/cloud-infrastructure/cloud-regions/cloud-region/"
+                        + CLOUD_OWNER + "/" + REGION + "/esr-system-info-list")));
+    }
+
     private class AaiResourceUriMatcher extends BaseMatcher<AAIResourceUri> {
 
         final String uriAsString;
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
index f6aa2fd..44b00e4 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
@@ -145,6 +145,7 @@
     public static final AAIObjectType VNFM = new AAIObjectType(AAINamespaceConstants.EXTERNAL_SYSTEM + "/esr-vnfm-list/esr-vnfm/{vnfm-id}", EsrVnfm.class);
     public static final AAIObjectType VNFM_LIST = new AAIObjectType(AAINamespaceConstants.EXTERNAL_SYSTEM, "/esr-vnfm-list", "vnfm-list");
     public static final AAIObjectType VNFM_ESR_SYSTEM_INFO_LIST = new AAIObjectType(AAINamespaceConstants.EXTERNAL_SYSTEM + "/esr-vnfm-list", "/esr-vnfm/{vnfm-id}/esr-system-info-list", "vnfm-esr-system-info-list");
+    public static final AAIObjectType CLOUD_ESR_SYSTEM_INFO_LIST = new AAIObjectType(AAIObjectType.CLOUD_REGION.uriTemplate(), "/esr-system-info-list", "cloud-esr-system-info-list");
 
 
 	private final String uriTemplate;
