The VM namespace provides commands for managing the lifecycle of a virtual machine.
List of commands:
dcli com vmware vcenter vm create
Description
Creates a virtual machine.
Options
Option Name | Type | Required | Description |
---|---|---|---|
guest‑os |
string | Yes | Guest OS. Valid values are: {DOS, WIN_31, WIN_95, WIN_98, WIN_ME, WIN_NT, WIN_2000_PRO, WIN_2000_SERV, WIN_2000_ADV_SERV, WIN_XP_HOME, WIN_XP_PRO, WIN_XP_PRO_64, WIN_NET_WEB, WIN_NET_STANDARD, WIN_NET_ENTERPRISE, WIN_NET_DATACENTER, WIN_NET_BUSINESS, WIN_NET_STANDARD_64, WIN_NET_ENTERPRISE_64, WIN_LONGHORN, WIN_LONGHORN_64, WIN_NET_DATACENTER_64, WIN_VISTA, WIN_VISTA_64, WINDOWS_7, WINDOWS_7_64, WINDOWS_7_SERVER_64, WINDOWS_8, WINDOWS_8_64, WINDOWS_8_SERVER_64, WINDOWS_9, WINDOWS_9_64, WINDOWS_9_SERVER_64, WINDOWS_HYPERV, FREEBSD, FREEBSD_64, REDHAT, RHEL_2, RHEL_3, RHEL_3_64, RHEL_4, RHEL_4_64, RHEL_5, RHEL_5_64, RHEL_6, RHEL_6_64, RHEL_7, RHEL_7_64, CENTOS, CENTOS_64, CENTOS_6, CENTOS_6_64, CENTOS_7, CENTOS_7_64, ORACLE_LINUX, ORACLE_LINUX_64, ORACLE_LINUX_6, ORACLE_LINUX_6_64, ORACLE_LINUX_7, ORACLE_LINUX_7_64, SUSE, SUSE_64, SLES, SLES_64, SLES_10, SLES_10_64, SLES_11, SLES_11_64, SLES_12, SLES_12_64, NLD_9, OES, SJDS, MANDRAKE, MANDRIVA, MANDRIVA_64, TURBO_LINUX, TURBO_LINUX_64, UBUNTU, UBUNTU_64, DEBIAN_4, DEBIAN_4_64, DEBIAN_5, DEBIAN_5_64, DEBIAN_6, DEBIAN_6_64, DEBIAN_7, DEBIAN_7_64, DEBIAN_8, DEBIAN_8_64, DEBIAN_9, DEBIAN_9_64, DEBIAN_10, DEBIAN_10_64, ASIANUX_3, ASIANUX_3_64, ASIANUX_4, ASIANUX_4_64, ASIANUX_5_64, ASIANUX_7_64, OPENSUSE, OPENSUSE_64, FEDORA, FEDORA_64, COREOS_64, VMWARE_PHOTON_64, OTHER_24X_LINUX, OTHER_24X_LINUX_64, OTHER_26X_LINUX, OTHER_26X_LINUX_64, OTHER_3X_LINUX, OTHER_3X_LINUX_64, OTHER_LINUX, GENERIC_LINUX, OTHER_LINUX_64, SOLARIS_6, SOLARIS_7, SOLARIS_8, SOLARIS_9, SOLARIS_10, SOLARIS_10_64, SOLARIS_11_64, OS2, ECOMSTATION, ECOMSTATION_2, NETWARE_4, NETWARE_5, NETWARE_6, OPENSERVER_5, OPENSERVER_6, UNIXWARE_7, DARWIN, DARWIN_64, DARWIN_10, DARWIN_10_64, DARWIN_11, DARWIN_11_64, DARWIN_12_64, DARWIN_13_64, DARWIN_14_64, DARWIN_15_64, DARWIN_16_64, VMKERNEL, VMKERNEL_5, VMKERNEL_6, VMKERNEL_65, OTHER, OTHER_64} |
name |
string | No | Virtual machine name. If unset, a default name will be generated by the server. |
placement‑folder |
string | No | Virtual machine folder into which the virtual machine should be placed. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Folder. When commands return a value of this class as a output, the option will be an identifier for the resource type: Folder. This option is currently required. In the future, if this option is unset, the system will attempt to choose a suitable folder for the virtual machine; if a folder cannot be chosen, the virtual machine creation operation will fail. |
placement‑resource‑pool |
string | No | Resource pool into which the virtual machine should be placed. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: ResourcePool. When commands return a value of this class as a output, the option will be an identifier for the resource type: ResourcePool. This option is currently required if both host and cluster are unset. In the future, if this option is unset, the system will attempt to choose a suitable resource pool for the virtual machine; if a resource pool cannot be chosen, the virtual machine creation operation will fail. |
placement‑host |
string | No | Host onto which the virtual machine should be placed. If host and resourcePool are both specified, resourcePool must belong to host. If host and cluster are both specified, host must be a member of cluster. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: HostSystem. When commands return a value of this class as a output, the option will be an identifier for the resource type: HostSystem. This option may be unset if resourcePool or cluster is specified. If unset, the system will attempt to choose a suitable host for the virtual machine; if a host cannot be chosen, the virtual machine creation operation will fail. |
placement‑cluster |
string | No | Cluster onto which the virtual machine should be placed. If cluster and resourcePool are both specified, resourcePool must belong to cluster. If cluster and host are both specified, host must be a member of cluster. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: ClusterComputeResource. When commands return a value of this class as a output, the option will be an identifier for the resource type: ClusterComputeResource. If resourcePool or host is specified, it is recommended that this option be unset. |
placement‑datastore |
string | No | Datastore on which the virtual machine's configuration state should be stored. This datastore will also be used for any virtual disks that are created as part of the virtual machine creation operation. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Datastore. When commands return a value of this class as a output, the option will be an identifier for the resource type: Datastore. This option is currently required. In the future, if this option is unset, the system will attempt to choose suitable storage for the virtual machine; if storage cannot be chosen, the virtual machine creation operation will fail. |
hardware‑version |
string | No | Virtual hardware version. If unset, defaults to the most recent version supported by the server. Valid values are: {VMX_03, VMX_04, VMX_06, VMX_07, VMX_08, VMX_09, VMX_10, VMX_11, VMX_12, VMX_13} |
boot‑type |
string | No | Firmware type to be used by the virtual machine. If unset, defaults to value that is recommended for the guest OS and is supported for the virtual hardware version. Valid values are: {BIOS, EFI} |
boot‑efi‑legacy‑boot |
bool | No | Flag indicating whether to use EFI legacy boot mode. If unset, defaults to value that is recommended for the guest OS and is supported for the virtual hardware version. |
boot‑network‑protocol |
string | No | Protocol to use when attempting to boot the virtual machine over the network. If unset, defaults to a system defined default value. Valid values are: {IPV4, IPV6} |
boot‑delay |
int | No | Delay in milliseconds before beginning the firmware boot process when the virtual machine is powered on. This delay may be used to provide a time window for users to connect to the virtual machine console and enter BIOS setup mode. If unset, default value is 0. |
boot‑retry |
bool | No | Flag indicating whether the virtual machine should automatically retry the boot process after a failure. If unset, default value is false. |
boot‑retry‑delay |
int | No | Delay in milliseconds before retrying the boot process after a failure; applicable only when Boot.Info.retry is true. If unset, default value is 10000. |
boot‑enter‑setup‑mode |
bool | No | Flag indicating whether the firmware boot process should automatically enter setup mode the next time the virtual machine boots. Note that this flag will automatically be reset to false once the virtual machine enters setup mode. If unset, the value is unchanged. |
boot‑devices‑type |
string | No | Virtual Boot device type. Valid values are: {CDROM, DISK, ETHERNET, FLOPPY} |
cpu‑count |
int | No | New number of CPU cores. The number of CPU cores in the virtual machine must be a multiple of the number of cores per socket. The supported range of CPU counts is constrained by the configured guest operating system and virtual hardware version of the virtual machine. If the virtual machine is running, the number of CPU cores may only be increased if Cpu.Info.hot-add-enabled is true, and may only be decreased if Cpu.Info.hot-remove-enabled is true. If unset, the value is unchanged. |
cpu‑cores‑per‑socket |
int | No | New number of CPU cores per socket. The number of CPU cores in the virtual machine must be a multiple of the number of cores per socket. If unset, the value is unchanged. |
cpu‑hot‑add‑enabled |
bool | No | Flag indicating whether adding CPUs while the virtual machine is running is enabled. This option may only be modified if the virtual machine is powered off. If unset, the value is unchanged. |
cpu‑hot‑remove‑enabled |
bool | No | Flag indicating whether removing CPUs while the virtual machine is running is enabled. This option may only be modified if the virtual machine is powered off. If unset, the value is unchanged. |
memory‑size‑mib |
int | No | New memory size in mebibytes. The supported range of memory sizes is constrained by the configured guest operating system and virtual hardware version of the virtual machine. If the virtual machine is running, this value may only be changed if Memory.Info.hot-add-enabled is true, and the new memory size must satisfy the constraints specified by Memory.Info.hot-add-increment-size-mib and Memory.Info.hot-add-limit-mib. If unset, the value is unchanged. |
memory‑hot‑add‑enabled |
bool | No | Flag indicating whether adding memory while the virtual machine is running should be enabled. Some guest operating systems may consume more resources or perform less efficiently when they run on hardware that supports adding memory while the machine is running. This option may only be modified if the virtual machine is not powered on. If unset, the value is unchanged. |
disks‑type |
string | No | Type of host bus adapter to which the device should be attached. If unset, guest-specific default values will be used Valid values are: {IDE, SCSI, SATA} |
disks‑ide‑primary |
bool | No | Flag specifying whether the device should be attached to the primary or secondary IDE adapter of the virtual machine. If unset, the server will choose a adapter with an available connection. If no IDE connections are available, the request will be rejected. |
disks‑ide‑master |
bool | No | Flag specifying whether the device should be the master or slave device on the IDE adapter. If unset, the server will choose an available connection type. If no IDE connections are available, the request will be rejected. |
disks‑scsi‑bus |
int | No | Bus number of the adapter to which the device should be attached. |
disks‑scsi‑unit |
int | No | Unit number of the device. If unset, the server will choose an available unit number on the specified adapter. If there are no available connections on the adapter, the request will be rejected. |
disks‑sata‑bus |
int | No | Bus number of the adapter to which the device should be attached. |
disks‑sata‑unit |
int | No | Unit number of the device. If unset, the server will choose an available unit number on the specified adapter. If there are no available connections on the adapter, the request will be rejected. |
disks‑backing‑type |
string | No | Backing type for the virtual disk. Valid values are: {VMDK_FILE} |
disks‑backing‑vmdk‑file |
string | No | Path of the VMDK file backing the virtual disk. This option is optional and it is only relevant when the value of type is VMDK_FILE. |
disks‑new‑vmdk‑name |
string | No | Base name of the VMDK file. The name should not include the '.vmdk' file extension. If unset, a name (derived from the name of the virtual machine) will be chosen by the server. |
disks‑new‑vmdk‑capacity |
int | No | Capacity of the virtual disk backing in bytes. If unset, defaults to a guest-specific capacity. |
nics‑type |
string | No | Ethernet adapter emulation type. If unset, defaults to a guest-specific type. Valid values are: {E1000, E1000E, PCNET32, VMXNET, VMXNET2, VMXNET3} |
nics‑upt‑compatibility‑enabled |
bool | No | Flag indicating whether Universal Pass-Through (UPT) compatibility is enabled on this virtual Ethernet adapter. If unset, defaults to false. |
nics‑mac‑type |
string | No | MAC address type. If unset, defaults to GENERATED. Valid values are: {MANUAL, GENERATED, ASSIGNED} |
nics‑mac‑address |
string | No | MAC address. Workaround for PR1459647 |
nics‑pci‑slot‑number |
int | No | Address of the virtual Ethernet adapter on the PCI bus. If the PCI address is invalid, the server will change when it the VM is started or as the device is hot added. If unset, the server will choose an available address when the virtual machine is powered on. |
nics‑wake‑on‑lan‑enabled |
bool | No | Flag indicating whether wake-on-LAN is enabled on this virtual Ethernet adapter. Defaults to false if unset. |
nics‑backing‑type |
string | No | Backing type for the virtual Ethernet adapter. Valid values are: {STANDARD_PORTGROUP, HOST_DEVICE, DISTRIBUTED_PORTGROUP, OPAQUE_NETWORK} |
nics‑backing‑network |
string | No | Identifier of the network that backs the virtual Ethernet adapter. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Network. When commands return a value of this class as a output, the option will be an identifier for the resource type: Network. This option is optional and it is only relevant when the value of type is one of STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, or OPAQUE_NETWORK. |
nics‑backing‑distributed‑port |
string | No | Key of the distributed virtual port that backs the virtual Ethernet adapter. Depending on the type of the Portgroup, the port may be specified using this field. If the portgroup type is early-binding (also known as static), a port is assigned when the Ethernet adapter is configured to use the port. The port may be either automatically or specifically assigned based on the value of this option. If the portgroup type is ephemeral, the port is created and assigned to a virtual machine when it is powered on and the Ethernet adapter is connected. This option cannot be specified as no free ports exist before use. May be used to specify a port when the network specified on the network option is a static or early binding distributed portgroup. If unset, the port will be automatically assigned to the Ethernet adapter based on the policy embodied by the portgroup type. |
nics‑start‑connected |
bool | No | Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on. Defaults to false if unset. |
nics‑allow‑guest‑control |
bool | No | Flag indicating whether the guest can connect and disconnect the device. Defaults to false if unset. |
cdroms‑type |
string | No | Type of host bus adapter to which the device should be attached. If unset, guest-specific default values will be used Valid values are: {IDE, SATA} |
cdroms‑ide‑primary |
bool | No | Flag specifying whether the device should be attached to the primary or secondary IDE adapter of the virtual machine. If unset, the server will choose a adapter with an available connection. If no IDE connections are available, the request will be rejected. |
cdroms‑ide‑master |
bool | No | Flag specifying whether the device should be the master or slave device on the IDE adapter. If unset, the server will choose an available connection type. If no IDE connections are available, the request will be rejected. |
cdroms‑sata‑bus |
int | No | Bus number of the adapter to which the device should be attached. |
cdroms‑sata‑unit |
int | No | Unit number of the device. If unset, the server will choose an available unit number on the specified adapter. If there are no available connections on the adapter, the request will be rejected. |
cdroms‑backing‑type |
string | No | Backing type for the virtual CD-ROM device. Valid values are: {ISO_FILE, HOST_DEVICE, CLIENT_DEVICE} |
cdroms‑backing‑iso‑file |
string | No | Path of the image file that should be used as the virtual CD-ROM device backing. This option is optional and it is only relevant when the value of type is ISO_FILE. |
cdroms‑backing‑host‑device |
string | No | Name of the device that should be used as the virtual CD-ROM device backing. If unset, the virtual CD-ROM device will be configured to automatically detect a suitable host device. |
cdroms‑backing‑device‑access‑type |
string | No | Access type for the device backing. If unset, defaults to EMULATION. Valid values are: {EMULATION, PASSTHRU, PASSTHRU_EXCLUSIVE} |
cdroms‑start‑connected |
bool | No | Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on. Defaults to false if unset. |
cdroms‑allow‑guest‑control |
bool | No | Flag indicating whether the guest can connect and disconnect the device. Defaults to false if unset. |
floppies‑backing‑type |
string | No | Backing type for the virtual floppy drive. Valid values are: {IMAGE_FILE, HOST_DEVICE, CLIENT_DEVICE} |
floppies‑backing‑image‑file |
string | No | Path of the image file that should be used as the virtual floppy drive backing. This option is optional and it is only relevant when the value of type is IMAGE_FILE. |
floppies‑backing‑host‑device |
string | No | Name of the device that should be used as the virtual floppy drive backing. If unset, the virtual floppy drive will be configured to automatically detect a suitable host device. |
floppies‑start‑connected |
bool | No | Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on. Defaults to false if unset. |
floppies‑allow‑guest‑control |
bool | No | Flag indicating whether the guest can connect and disconnect the device. Defaults to false if unset. |
parallel‑ports‑backing‑type |
string | No | Backing type for the virtual parallel port. Valid values are: {FILE, HOST_DEVICE} |
parallel‑ports‑backing‑file |
string | No | Path of the file that should be used as the virtual parallel port backing. This option is optional and it is only relevant when the value of type is FILE. |
parallel‑ports‑backing‑host‑device |
string | No | Name of the device that should be used as the virtual parallel port backing. If unset, the virtual parallel port will be configured to automatically detect a suitable host device. |
parallel‑ports‑start‑connected |
bool | No | Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on. Defaults to false if unset. |
parallel‑ports‑allow‑guest‑control |
bool | No | Flag indicating whether the guest can connect and disconnect the device. Defaults to false if unset. |
serial‑ports‑yield‑on‑poll |
bool | No | CPU yield behavior. If set to true, the virtual machine will periodically relinquish the processor if its sole task is polling the virtual serial port. The amount of time it takes to regain the processor will depend on the degree of other virtual machine activity on the host. If unset, defaults to false. |
serial‑ports‑backing‑type |
string | No | Backing type for the virtual serial port. Valid values are: {FILE, HOST_DEVICE, PIPE_SERVER, PIPE_CLIENT, NETWORK_SERVER, NETWORK_CLIENT} |
serial‑ports‑backing‑file |
string | No | Path of the file backing the virtual serial port. This option is optional and it is only relevant when the value of type is FILE. |
serial‑ports‑backing‑host‑device |
string | No | Name of the device backing the virtual serial port. If unset, the virtual serial port will be configured to automatically detect a suitable host device. |
serial‑ports‑backing‑pipe |
string | No | Name of the pipe backing the virtual serial port. This option is optional and it is only relevant when the value of type is one of PIPE_SERVER or PIPE_CLIENT. |
serial‑ports‑backing‑no‑rx‑loss |
bool | No | Flag that enables optimized data transfer over the pipe. When the value is true, the host buffers data to prevent data overrun. This allows the virtual machine to read all of the data transferred over the pipe with no data loss. If unset, defaults to false. |
serial‑ports‑backing‑network‑location |
string | No | URI specifying the location of the network service backing the virtual
serial port.
|
serial‑ports‑backing‑proxy |
string | No | Proxy service that provides network access to the network backing. If set, the virtual machine initiates a connection with the proxy service and forwards the traffic to the proxy. If unset, no proxy service should be used. |
serial‑ports‑start‑connected |
bool | No | Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on. Defaults to false if unset. |
serial‑ports‑allow‑guest‑control |
bool | No | Flag indicating whether the guest can connect and disconnect the device. Defaults to false if unset. |
sata‑adapters‑type |
string | No | Adapter type. If unset, a guest-specific default value will be used. Valid values are: {AHCI} |
sata‑adapters‑bus |
int | No | SATA bus number. If unset, the server will choose an available bus number; if none is available, the request will fail. |
sata‑adapters‑pci‑slot‑number |
int | No | Address of the SATA adapter on the PCI bus. If unset, the server will choose an available address when the virtual machine is powered on. |
scsi‑adapters‑type |
string | No | Adapter type. If unset, a guest-specific default value will be used. Valid values are: {BUSLOGIC, LSILOGIC, LSILOGICSAS, PVSCSI} |
scsi‑adapters‑bus |
int | No | SCSI bus number. If unset, the server will choose an available bus number; if none is available, the request will fail. |
scsi‑adapters‑pci‑slot‑number |
int | No | Address of the SCSI adapter on the PCI bus. If the PCI address is invalid, the server will change it when the VM is started or as the device is hot added. If unset, the server will choose an available address when the virtual machine is powered on. |
scsi‑adapters‑sharing |
string | No | Bus sharing mode. If unset, the adapter will default to NONE. Valid values are: {NONE, VIRTUAL, PHYSICAL} |
Example
dcli com vmware vcenter vm create --guest-os test
dcli com vmware vcenter vm get
Description
Returns information about a virtual machine.
Options
Option Name | Type | Required | Description |
---|---|---|---|
vm |
string | Yes | Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. |
Example
dcli com vmware vcenter vm get --vm testId
dcli com vmware vcenter vm delete
Description
Deletes a virtual machine.
Options
Option Name | Type | Required | Description |
---|---|---|---|
vm |
string | Yes | Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. |
Example
dcli com vmware vcenter vm delete --vm testId
dcli com vmware vcenter vm list
Description
Returns information about at most 1000 visible (subject to permission checks) virtual machines in vCenter matching the VM.FilterSpec.
Options
Option Name | Type | Required | Description |
---|---|---|---|
vms |
string | No | Identifiers of virtual machines that can match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: VirtualMachine. When commands return a value of this class as a output, the option will contain identifiers for the resource type: VirtualMachine. If unset or empty, virtual machines with any identifier match the filter. |
names |
string | No | Names that virtual machines must have to match the filter (see VM.Info.name). If unset or empty, virtual machines with any name match the filter. |
folders |
string | No | Folders that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: Folder. When commands return a value of this class as a output, the option will contain identifiers for the resource type: Folder. If unset or empty, virtual machines in any folder match the filter. |
datacenters |
string | No | Datacenters that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: Datacenter. When commands return a value of this class as a output, the option will contain identifiers for the resource type: Datacenter. If unset or empty, virtual machines in any datacenter match the filter. |
hosts |
string | No | Hosts that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: HostSystem. When commands return a value of this class as a output, the option will contain identifiers for the resource type: HostSystem. If unset or empty, virtual machines on any host match the filter. |
clusters |
string | No | Clusters that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: ClusterComputeResource. When commands return a value of this class as a output, the option will contain identifiers for the resource type: ClusterComputeResource. If unset or empty, virtual machines in any cluster match the filter. |
resource‑pools |
string | No | Resource pools that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the option must contain identifiers for the resource type: ResourcePool. When commands return a value of this class as a output, the option will contain identifiers for the resource type: ResourcePool. If unset or empty, virtual machines in any resource pool match the filter. |
power‑states |
string | No | Power states that a virtual machine must be in to match the filter (see Power.Info.state. If unset or empty, virtual machines in any power state match the filter. Valid values are: {POWERED_OFF, POWERED_ON, SUSPENDED} |
Example
dcli com vmware vcenter vm list