|
VMware ESX Server 2.1
Features | Documentation | Knowledge Base | Discussion Forums You can use the vmware-cmd utility to perform various operations on a virtual machine, including registering a virtual machine (on the local server), getting the power state of a virtual machine, setting configuration variables, and so on. Note: The previous vmware-control utility is deprecated. If you are using scripts with the vmwarecontrol utility, update your scripts with the new vmware-cmd utility or they will not work with VMware GSX Server 2.x or ESX Server Click here to change current version number. By default, the vmware-cmd utility is installed in the /usr/bin directory (Linux operating system) or in C:\Program Files\VMware\VMware VmPerl Scripting API (Windows operating system). The vmware-cmd utility takes the following options.
The syntax for this utility on a server is: vmware-cmd -s <options> <server-operation> <arguments> The vmware-cmd utility performs the following operations on a VMware server.
The syntax for this utility on a virtual machine is: vmware-cmd <options> <vm-cfg-path> <vm-operation> <arguments> The vmware-cmd utility performs the following operations on a virtual machine, where <vmcfgpath> represents the complete path to the virtual machine's configuration file. Note: The following table includes some ESX Server-specific methods, and are specifically noted.
The following table describes hard, soft and trysoft power operations.
This section includes examples of using the vmware-cmd utility on a virtual machine. The following examples illustrate retrieving the execution state of a virtual machine.
Change directories to the directory (folder) containing the vmware-cmd utility or include the full path to the utility when typing the following on a command line. Note that you must use double quotes when specifying a path with spaces; for example, In a Linux guest operating system: vmware-cmd /home/vmware/win2000.vmx getstate where /home/vmware/win2000.vmx is the path to the virtual machine's configuration file. In a Windows guest operating system: vmware-cmd C:\home\vmware\win2000.vmx getstate where C:\home\vmware\win2000.vmx is the path to the virtual machine's configuration file. The following examples illustrate performing a power operation. The first example illustrates powering on a virtual machine and the second example illustrates performing a hard reset.
Change directories to the directory (folder) containing the vmware-cmd utility or include the full path to the utility when typing the following on a command line. Note that you must use double quotes when specifying a path with spaces; for example, In a Linux guest operating system: vmware-cmd -v /home/vmware/win2000.vmx start where -v indicates the verbose option, /home/vmware/win2000.vmx is the path to the virtual machine's configuration file and start is the power operation. Since a <powerop_mode> is not specified, the default soft behavior is performed. Similarly, in a Windows guest operating system: vmware-cmd -q C:\home\vmware\win2000.vmx reset hard where -q indicates the quiet option (only the results of the operation are printed), C:\home\vmware\win2000.vmx is the path to the virtual machine's configuration file and reset is the power operation. This example specifies a hard reset so the virtual machine is immediately and unconditionally reset. The following example illustrates setting a configuration variable in a Linux guest operating system. Change directories to the directory (folder) containing the vmware-cmd utility or include the full path to the utility when typing the following on a command line. vmware-cmd foo.vmx setconfig ide1:0.file /tmp/cdimages/foo.iso where foo.vmx is the virtual machine's configuration file, ide1:0.file is the variable and its value is /tmp/cdimages/foo.iso. The following example illustrates connecting a virtual IDE device in a Windows guest operating system.
Change directories to the directory (folder) containing the vmware-cmd utility or include the full path to the utility when typing the following on a command line. Note that you must use double quotes when specifying a path with spaces; for example, vmware-cmd D:\foo.vmx connectdevice ide1:0 where D:\foo.vmx is the virtual machine's configuration file and ide1:0 is the device name.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||