Scenario 7: Cloning an Instance

There are many reasons to clone a service instance. This scenario assumes that you clone an instance to protect against loss of service.

Prerequisites

  • The identity domain used by the service instance you are cloning (source) and the service instance that you create as the clone (target) should use an identical set of users and role assignments.

    • If the source and target reside in the same data center, they should share an identity domain.

    • If the source and target do not share a data center, you must manually create the set of users and role assignments of the source in the identity domain of the target.

  • The machine from which EPM Automate is run must have sufficient free space to store the downloaded application snapshot.

Example 2-25 EPM Automate

For details on this procedure, see Clone an Environment.

EPM Automate Utility displays a code in the console to indicate the status of the operation. See Working with EPM Automate.

Example 2-26 Java

public void integrationScenarioCloneServiceInstancePartOne() throws Exception {
	// Part 1 : Change serverUrl, username, password, apiVersion variables values to match those of source environment
	// Download file from source instance. 
	downloadFile("Artifact Snapshot"); 
}

public void integrationScenarioCloneServiceInstancePartTwo() throws Exception {	
	// Part 2 : Change serverUrl, username, password, apiVersion to match those of target environment.
	// Clone the service instance. 
	recreateService("PBCS");
	deleteFile("Artifact Snapshot");
	uploadFile("Artifact Snapshot.zip");
	importSnapshot("Artifact Snapshot");
}

Common Functions: See Common Helper Functions for Java.

Dependent APIs: See Java Sample — UploadFile.java and Java Sample — DownloadFile.java in Upload and Download Files, JavaSample — DeleteFile.java in View and Delete Files, Sample — RunRecreateOnAService.java in Run Recreate on a Service, and Java Sample — LcmImport. java in LCM Import.

Example 2-27 cURL

funcIntegrationScenarioCloneServiceInstancePartOne() {
	# Part 1 : Change SERVER_URL, USERNAME, PASSWORD, API_VERSION variables values to match those of source environment
	# Download file from source instance. 
	funcDownloadFile "Artifact Snapshot" 
}

funcIntegrationScenarioCloneServiceInstancePartTwo() {
	# Part 2 : Change SERVER_URL, USERNAME, PASSWORD, API_VERSION to match those of target environment.
	# Clone the service instance. 
	funcRecreateService "PBCS"
	funcDeleteFile "Artifact Snapshot"
 	funcUploadFile "Artifact Snapshot.zip"
	funcImportSnapshot "Artifact Snapshot"
}

Example 2-28 Groovy

def integrationScenarioCloneServiceInstancePartOne() {
	// Part 1 : Change serverUrl, username, password, apiVersion variables values to match those of source environment
	// Download file from source instance. 
	downloadFile("Artifact Snapshot"); 
}

def integrationScenarioCloneServiceInstancePartTwo() {	
	// Part 2 : Change serverUrl, username, password, apiVersion to match those of target environment.
	// Clone the service instance. 
	recreateService("PBCS");
	deleteFile("Artifact Snapshot");
	uploadFile("Artifact Snapshot.zip");
	importSnapshot("Artifact Snapshot");
}