~ # vim-cmd vmsvc/createdummyvm testVM /testVM/testVM.vmx How about doing something? Here is a command that creates new dummy virtual machine. We’ve seen several commands that read information from the command. SettingDisplayTopologyModesSupported = true, SettingScreenResolutionSupported = false,
Remember the property called capability defined with VirtualMachine managed object? They refer to the same thing and hold the same values. The following command shows the capability of the virtual machine. There is no task for the moment the command was issued, therefore an empty array was returned. The following command list the taks related to the virtual machine. Network = 'vim.Network:HaNetwork-VM Network', The following example shows the network a virtual machine (whose vmID is 8) connects to: ~ # vim-cmd vmsvc/get.networks 8 You need to open URL to an ESXi for the vim-cmd command here. If you see something like “vm-9”, you are most likely get this from a vCenter MOB. Vmid Name File Guest OS Version AnnotationĨ testVM testVM/testVM.vmx ubuntu64Guest vmx-09 You can therefore optionally find them out with the Managed Object Browser. This ID is in fact the same as the value of ManagedObjectReference. What is it? You can find out with getallvms command – just watch out the first column. When it’s associated with a virtual machine, it’s the virtual machine ID (VMID). Some of these commands need additional arguments to carry out its duty. ~ # vim-cmd vmsvcĪs you can see, these subcommands are mostly mapped to the managed object type VirtualMachine in vSphere API. Virtual Machine Management CommandsĪgain, to find out what specific commands avaiable in each category, you just type the subcommand such as vmsvc here. Without further due, let’s drive down each categories. Please note that the internal is not really related to internal APIs of the ESXi. Think you can guess out what they are for at high level. With these 7 types, you can remove the svc ( solo is exception) and get the types as: hbr, host, internal, proxy, solo, vim, and vm. Hbrsvc/ internalsvc/ solo/ vmsvc/ hostsvc/ proxysvc/ vimsvc/ helpĪs you can see, there are 7 sub-command categories with the help ignored (help is important but it does not represent a type of itself).
To find out, you can simply type vim-cmd at a SSH shell as follows: ~ # vim-cmd Lrwxrwxrwx 1 root root 11 /bin/vim-cmd -> /sbin/hostd On ESXi, the vim-cmd is at /bin/vim-cmd, which is actually a symbolic link to a host executable as shown in the following. With this context in mind, you can guess out what you can do with the vim-cmd in general.
The vim-cmd is indeed associated with the vSphere API – it’s built on top of the hostd which implements the APIs. If you are familiar with vSphere API, you already know VIM is the original name for vSphere management ( Virtual Infrastructure Management). There are a few command line options in VMware ESXi, among which is the vim-cmd. Although GUIs are more likely (not always) to be more intuitive and easier to get started with, sooner or later administrators will use command lines more for better productivity. To totally unlock this section you need to Log-inĬommand lines are very important for system administrors when it comes to automation.