VMware Cloud Community
stjwh2
Contributor
Contributor

I can't run Custom Script on the SRM server.

hello.

Commands issued by the SRM server are not being executed.

When I do a recovery test, I don't get any errors at the command stage.

<ref : pic1.jpg>

But in fact, no action due to the script is happening.

Is it possible for me to run a user script on the SRM server?


The user script is as follows

<ref:pic2.jpg>


I used ssh-keygen to allow me to execute commands on a remote linux server without login,
When I ran the script manually, I found that it worked as expected.

However, it doesn't work in the Test Recovery phase.

SRM is replaced by photon based on application, and I wanted to run a custom powershell, but my idea is not possible?

0 Kudos
2 Replies
vFouad
Leadership
Leadership

IIRC the scripts are not run as the admin user so the automation may not have permission to see/read/run the script in it's current location.

The script is run as the SRM user so make sure that has the correct permissions... see doc link below

https://docs.vmware.com/en/Site-Recovery-Manager/8.7/com.vmware.srm.admin.doc/GUID-4F084B4F-DE9C-4A7...

Thanks,

vFouad

0 Kudos
Jamesburns01
Contributor
Contributor

 

There could be several reasons why you might be facing issues running a custom script on the SRM (Storage Resource Management) server. Here are some common factors to consider:

  1. Permissions: Ensure that you have the necessary permissions to execute scripts on the SRM server. Check the user's privileges and make sure they have the appropriate access rights to run scripts.

  2. Script Location: Verify that the script is in the correct directory or location on the SRM server. If the script is not in the expected path, it might not be found or executed properly.

  3. Script Syntax Errors: Review your custom script for any syntax errors or typos. Even a small mistake can prevent the script from running successfully. Double-check the code for accuracy.

  4. Missing Dependencies: If your script relies on external libraries or dependencies, ensure that they are installed on the SRM server. Lack of required libraries can lead to script execution failures.

  5. Script Execution Policy: Some systems have execution policies that restrict running scripts from certain sources. Check if the SRM server's execution policy is allowing the script to be executed.

  6. Logging and Error Messages: Check the logs and error messages generated during the script execution attempt. They can provide valuable insights into the specific issue you're facing.

  7. Interpreters: Ensure that the appropriate interpreters or runtimes are available on the SRM server for the script's programming language. For example, if it's a Python script, Python should be installed.

  8. Firewall and Security Settings: Check if there are any firewall rules or security settings that might be blocking the script's execution. Make sure the necessary ports and permissions are open.

  9. Resource Constraints: Verify if the SRM server has enough resources (CPU, memory, disk space) to run the script. Resource limitations can cause script failures.

  10. Script File Permissions: Ensure that the script file has the proper permissions set to be executed by the user attempting to run it.

Regards

Routers network team

0 Kudos