Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If Users want to make any changes on a Guest VM after recovery they can use the pre-script Changes can be made to Guest VMs after recovery by executing pre-scripts and post-script scripts as part of runbook execution. The runRun-book scripts are custom scripts , customer can develop them written in Python (.py) that can be created and applied by the customer based on their requirementown specific requirements.

Info

NOTE: Runbook scripts must reside on and are executed from the management server (MSA).

 

...

Steps to

...

Execute Runbook Scripts

  • Log in to the MSA and create a scripts folder under vme2 (/var/lib/vme2/).

  • Upload the a pre-script and/or post-script to the scripts to this folder(scripts)Give executable options to these scripts (folder.

  • Make the uploaded scripts executable (Use the chmod +x option)

  • Provide the pre-script and post-script locations with parameters in the runbooks (Refer to the screenshots)

...

  • .

  • In the JetStream DR UI (Create Runbook Group workflow) indicate the locations of the scripts and any parameters necessary to run the scripts.

...

Info

Note: Script execution logs can

...

be reviewed from the MSA tasks logs.

...

 Script Configuration Example

Copy scripts to MSA scripts folder

[root@fs074-msa3 scripts]# ls -lrh
total 12K
-rw-r--r--. 1 root root 5.9K Mar 24 15:36 pre-script.py
-rw-r--r--. 1 root root 4.0K Mar 24 10:16 post-script.py

Make scripts executable

[root@fs074-msa3 scripts]# chmod +x /var/lib/vme2/scripts/*

Verify executable status of scripts

[root@fs074-msa3 scripts]# ls -lrh
total 12K
-rwxr-xr-x. 1 root root 5.9K Mar 24 15:36 pre-script.py
-rwxr-xr-x. 1 root root 4.0K Mar 24 10:16 post-script.pyFor testing purposes we can execute these sample scripts on MSA

...

Test Script

A sample test script is available from JetStream Software for evaluation purposes and can be used per the following guidelines:

  • Collect the sample

...

  • script from the JetStream

...

  • Software support team.

  • The script is written in Python and requires Python pyVmomi SDK module version (8.0.0.1.2)

...

  • to be installed on the MSA or

...

  • manually updated.

    • Note: The script will not run correctly if the

...

    • pyVmomi version is lower than (8.0.0.1.2).

...

      • To check the

...

      • version of pyVmomi currently installed, run the command (#pip3 show pyvmomi).

...

      • If

...

      • the version is incorrect, upgrade the module using the command (#pip3 install -U pyvmomi)

...

      • .

  • After

...

  • placing the script in the correct folder and making it executable, run the help command to view

...

  • its required parameters.

...

# python3 post-script.py -help

...

  • The script can be also be tested manually by executing the

...

  • following syntax:

Python3 post-script.py -vi VCHOSTNAME -vu VCUSER -vp VCPASSWD -cl CLUSTERNAME -l VMSLIST -vmu VMUSER -vmp VMPASSWD -vmpc VMPROCESS