SudhirH
Contributor
Contributor

How to run site specific scripts for a virtual machine?

Jump to solution

I need to run a script which will update the Virtual Machine IP's to a DNS server.  I plan to use the dns_update.cmd.

1. Can I create Recovery Plan steps that are site specific?

2. Does VMware SRM SDK provide API's to determine the Site name?

TIA,

Sudhir

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal

> 1. Can I create Recovery Plan steps that are site specific?

SRM provides environment variables to command step scripts that will enable you to do this. See Environment Variables for Command Steps in the administration guide for more details on the variables.

The key variable is the "VMware_VC_Host" variable. You can use this variable in your script to perform different actions depending on which VC you are recovering to.

> 2. Does VMware SRM SDK provide API's to determine the Site name?

Yes, I am not sure why you would do this? You typically don't call the SRM API from a recovery plan command step. Can you share what you were intending to use these methods for?

Check out the "GetSiteName" and "GetPairedSite" methods documented in https://www.vmware.com/support/developer/srm-api/srm_58_api.pdf

View solution in original post

0 Kudos
3 Replies
NealeC
Hot Shot
Hot Shot

Have you looked at the SRM guides on what you can do or have you tested it?

The IP customisation allows you to specify DNS and DHCP servers in the alternative site.

There is a good guide here:

http://www.vmadmin.co.uk/resources/61-srm/309-srm5ipcustomization

Regards

Chris

-------------- If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Chris Neale VCIX6-NV;vExpert2014-17;VCP6-NV;VCP5-DCV;VCP4;VCA-NV;VCA-DCV;VTSP2015;VTSP5;VTSP4 http://www.chrisneale.org http://www.twitter.com/mrcneale
0 Kudos
admin
Immortal
Immortal

> 1. Can I create Recovery Plan steps that are site specific?

SRM provides environment variables to command step scripts that will enable you to do this. See Environment Variables for Command Steps in the administration guide for more details on the variables.

The key variable is the "VMware_VC_Host" variable. You can use this variable in your script to perform different actions depending on which VC you are recovering to.

> 2. Does VMware SRM SDK provide API's to determine the Site name?

Yes, I am not sure why you would do this? You typically don't call the SRM API from a recovery plan command step. Can you share what you were intending to use these methods for?

Check out the "GetSiteName" and "GetPairedSite" methods documented in https://www.vmware.com/support/developer/srm-api/srm_58_api.pdf

View solution in original post

0 Kudos
SudhirH
Contributor
Contributor

Thanks Ben. This helps.

0 Kudos