VMware 5.8 User Manual Page 13

  • Download
  • Add to my manuals
  • Print
  • Page
    / 14
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 12
Creating a .bat file
- 10 -
5. Right-click the file you just created and click Rename.
6. Rename the file with a .bat file extension.
7. When prompted with a file extension rename warning, click Yes.
Creating a .bat file
Delete this text and replace it with your own content.
Setting up the SRM server
Before you being setting up and configuring the SRMserver we recommend you consult VMware's
documentation related to installing, configuring, and best practices for SRM. See
http://www.vmware.com/support/pubs/srm_pubs.html.
In order to run Post Power On scripts, you must first install VMrun (VIXAPI) on the SRMserver. This API
enables the SRM server to log in to the virtual machines and run the scripts.
To set up the SRMserver
1. On the SRMserver, create a folder and .cmd file that will run the .bat file on guest virtual machines.For
example, C:\Scripts\Client1.cmd.
2. In Notepad, edit the .cmd file to include the following contents:
"C:\Program Files (x86)\VMware\VMware VIX\vmrun" -T esx -h https://10.18.126.137/sdk -u root
-p ca$hc0w -gu Pfyre -gp Welcome1 RunProgramInGuest "[ha-
datacenter/NetAppPrairiefyreAsynch] Client1/Client1.vmx" "C:\\Test\\Test.bat" where the
contents are formatted as <path to the VMrun API install> –T esx –h https://<IP Address of the ESX
Server>/sdk u <username of the ESX> -p <password of the ESX> -gu <guest OS username> -gp
<guest OS password> RunProgramInGuest [<DataCenter Name>] <Path to VM’s .vmx file> <Path
to bat file on the VM local drive with double \\>”.
3. Log in to vSphere Client.
Your host, clusters, and guest virtual machines will display in the left pane.
4. Click Inventory=>Solutions and Applications=>Site Recovery.
5. Right-click the virtual machine on which you will run the script and click Configure.
The Edit Virtual Machine Properties window opens.
6. Click Next until you reach the Edit Post Power On Steps for this VM dialog.
7. Click Add Message.
8. Type "C:\windows\system32\cmd.exe /C "C:\Scripts\Client1.cmd" and click OK.
9. Click Finish.
Once this is complete, you can view your Post Power On script on the Recovery Steps tab. We also
recommend you run aSRMtest to ensure the Post Power On scripts function as desired.
NOTE: Optionally, if you want to change the IPaddress of the Windows guest virtual machines in the
scripts, you must add a Post Power On script to run a windows netsh command or add the following
line to the beginning of the .bat file that calls the PowerShell script on guest virtual machines:
test.bat contains:- netsh interface ip set address name="Local Area Connection" static
192.168.0.100 255.255.255.0 192.168.0.1 1,
where 192.168.0.100 255.255.255.0 192.168.0.1 1 is the IPv4 Address, Subnet Mask, and Default
Gateway.
Page view 12
1 2 ... 8 9 10 11 12 13 14

Comments to this Manuals

No comments