Know what’s coming yet? No? Here are some wonderful VMware VIX things you can do while you think on it.
- Install VMware Tools
- Set IP
- Snapshots
- Reboot VM
These are all on one line. Note, the first two work, the second two at the time of this writing report “Error: Unknown error” (ESX in VIX 1.6.2 is still experimental, but I’ve an SR with these too)
Install VMware Tools
vmrun –T esx –h https://server/sdk –u user –p password –gu guestUser –gp guestPassword “[datastore] /vmfolder/vmname.vmx” installTools
Set IP
vmrun –T esx –h https://server/sdk –u user –p password –gu guestUser –gp guestPassword runProgramInGuest "[datastore] vm/vm.vmx" c:\windows\system32\netsh.exe int ip set address local static 192.168.15.25 255.255.255.0 192.168.15.1 1
Snapshots
vmrun –T esx –h https://server/sdk –u root –p pass snapshot “[datastore] vm/vm.vmx” test
vmrun –T esx –h https://server/sdk –u root –p pass deleteSnapshot “[datastore] vm/vm.vmx” test
Reboot VM
vmrun –T esx –h https://server/sdk –u someuser –p password reset “[datastore] vm/vm.vmx” soft
Let me know in the comments what you’re using VIX for.
