Puede incluir comandos de EPM Automate en scripts de Groovy del servidor para clonar entornos para la recuperación ante desastres. Esto permite configurar la recuperación ante desastres sin ninguna huella local.
Si las contraseñas contienen caracteres especiales, consulte Manejo de caracteres especiales Asegúrese también de reemplazar estos valores de parámetros para que se ajusten a su entorno:
Table 4-1 Parámetros que cambiar
Parámetro | Descripción |
---|---|
password |
Contraseña del administrador del servicio que está realizando la operación de clonación en el entorno de origen. |
targetpassword |
Contraseña del administrador del servicio que está realizando la operación de clonación en el entorno de destino. |
username |
ID de usuario del administrador del servicio en el entorno de origen. |
targetusername |
ID de usuario del administrador del servicio en el entorno de destino. Este usuario también tiene que tener asignado el rol de administrador de dominio en el entorno de destino. |
email_id |
Dirección de correo electrónico a la que tiene previsto enviar información sobre el proceso de clonación. |
Script para cifrar la contraseña
EpmAutomate automate = getEpmAutomate() //Encrypt the password of a Service Administrator in the source environment EpmAutomateStatus encryptstatus1 = automate.execute('encrypt', 'password','encryptionKey','sourcePassword.epw') if(encryptstatus1.getStatus() != 0) throwVetoException(encryptstatus1.getOutput()) println(encryptstatus1.getOutput()) //Encrypt the password of a Service Administrator in the target environment //This user must also have the Identity Domain Administrator //role in the target environment EpmAutomateStatus encryptstatus2= automate.execute('encrypt', 'targetpassword', 'encryptionKey', 'targetPassword.epw') if(encryptstatus2.getStatus() != 0) throwVetoException(encryptstatus2.getOutput()) println(encryptstatus2.getOutput())
Script para clonar el entorno
Este script usa los archivos de contraseñas cifradas creados con el script anterior.
EpmAutomate automate = getEpmAutomate() //Log into the target environment EpmAutomateStatus loginstatus = automate.execute('login', 'username','targetPassword.epw' , 'targeturl') if(loginstatus.getStatus() != 0) throwVetoException(loginstatus.getOutput()) println(loginstatus.getOutput()) //Recreate the target environment EpmAutomateStatus recreatestatus = automate.execute('recreate' , '-f' ) if(recreatestatus.getStatus() != 0) throwVetoException(recreatestatus.getOutput()) println(recreatestatus.getOutput()) //Copy Artifact Snapshot from the source environment //to the target environment EpmAutomateStatus copystatus = automate.execute('copysnapshotfrominstance', 'Artifact Snapshot', 'sourceusername', 'sourcePassword.epw','source url') if(copystatus.getStatus() != 0) throwVetoException(copystatus.getOutput()) println(copystatus.getOutput()) //import Artifact Snapshot into the target environment EpmAutomateStatus importstatus = automate.execute('importsnapshot', 'Artifact Snapshot') println(importstatus.getOutput()) //Send an email to a designated user with the status of the //snapshot import process EpmAutomateStatus emailstatus = automate.execute('sendmail', 'email_id' ,'Status of DR' , 'BODY='+ importstatus.getOutput()) println(emailstatus.getOutput()) //Sign out of the target environment EpmAutomateStatus logoutstatus = automate.execute('logout') println(logoutstatus.getOutput())