After testing to a certain scale, you will inevitably use virtual machines. For VMware ESX, list several common commands:
1. List the storage paths of VMS on ESX Server (only list running VMS)
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpasswordList
2. Start a VM.
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpasswordStart"[Datastore1] vmname/vmname. vmx"
3. Stop a VM.
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpasswordStop"[Datastore1] vmname/vmname. vmx"
4. list all snapshots on a VM
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpasswordListsnapshots"[Datastore1] Vmname/vmname. vmx"
5. revert to the specified snapshot on the specified VM
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpasswordReverttosnapshot"[Datastore1] Vmname/vmname. vmx"Snapshotname
Note: This command is invalid for ESX 3.5, Ref: http://www.vmware.com/support/developer/vix-api/VIX-1.6.2-ReleaseNotes.html
6. execute a program on the VM.
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpassword-GuVmusername-GPVmpasswordRunprograminguest"[Datastore1] Vmname/vmname. vmx"-Interactive" C:/Windows/system32/cmd.exe"
7. Execute a bat on the VM.
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpassword-GuVmusername-GPVmpasswordRunscriptinguest"[Datastore1] Vmname/vmname. vmx"Cmd.exe/k/" C: // program files // Microsoft Visual Studio // VC // vcvarsall. BAT/"x86"
Note: Set the interpreter of BAT ""
8. copy file from guest to host
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpassword-GuVmusername-GPVmpasswordCopyfilefromguesttohost"[Datastore1] Vmname/vmname. vmx"" C:/temp/test. xml "" // 192.168.0.1/shared/test. xml"
9. copy file from host to guest
Vmrun-t esx-H https ://Serverip/SDK-uServerusername-PServerpassword-GuVmusername-GPVmpasswordCopyfilefromhosttoguest"[Datastore1] Vmname/vmname. vmx"" // 192.168.0.1/shared/test. xml "" C:/temp/test. xml"
Other Commands include:
Listprocessinguest, killprocessinguest, stop (power off VM), reset (reboot VM ),