Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

If Users want to make any changes on a Guest VM after recovery they can use the pre-script and post-script as part of runbook execution.

The run-book scripts are custom scripts, customer can develop them based on their requirement.

NOTE: Runbook scripts must reside on the management server (MSA).

 

Steps to execute the scripts:

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

  • Upload the pre-script and post-scripts to this folder(scripts)

  • Give executable options to these scripts (chmod +x)

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

Note: Script execution logs can see on the MSA tasks logs.

 Example:
[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


[root@fs074-msa3 scripts]# chmod +x /var/lib/vme2/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.py

For testing purposes we can execute these sample scripts on MSA:

Collect sample scripts from JetStream Support.

These scripts are developed using python scripting and we need to have an updated python pyvmomi module with version (8.0.0.1.2) in MSA or else the python pyvmomi module needs to be updated manually.
 
Note: script will not run correctly if the python pyvmomi version is lower than (8.0.0.1.2).
 
To check the current python pyvmomi module version run the command( #pip3 show pyvmomi)
 
If it is a lower version, then upgrade the module using the command (#pip3 install -U pyvmomi)
 
After upgrading the module run the help command to view all the required parameters.
 
# python3 post-script.py -help
 
We can manually test the script by executing the below syntax too.
 
Syntax:
Python3 post-script.py -vi VCHOSTNAME -vu VCUSER -vp VCPASSWD -cl CLUSTERNAME -l VMSLIST -vmu VMUSER -vmp VMPASSWD -vmpc VMPROCESS

  • No labels