vcenter VM: create

Creates a virtual machine.

Request:

HTTP request

POST https://{server}/rest/vcenter/vm

Request Body Structure:

{
    "spec"{
        "boot"{
            "delay"1,
            "efi_legacy_boot"true,
            "enter_setup_mode"true,
            "network_protocol""IPV4",
            "retry"true,
            "retry_delay"1,
            "type""BIOS"
        },
        "boot_devices"[
            {
                "type""CDROM"
            },
            {
                "type""CDROM"
            }
        ],
        "cdroms"[
            {
                "allow_guest_control"true,
                "backing"{
                    "device_access_type""EMULATION",
                    "host_device""string",
                    "iso_file""string",
                    "type""ISO_FILE"
                },
                "ide"{
                    "master"true,
                    "primary"true
                },
                "sata"{
                    "bus"1,
                    "unit"1
                },
                "start_connected"true,
                "type""IDE"
            },
            {
                "allow_guest_control"true,
                "backing"{
                    "device_access_type""EMULATION",
                    "host_device""string",
                    "iso_file""string",
                    "type""ISO_FILE"
                },
                "ide"{
                    "master"true,
                    "primary"true
                },
                "sata"{
                    "bus"1,
                    "unit"1
                },
                "start_connected"true,
                "type""IDE"
            }
        ],
        "cpu"{
            "cores_per_socket"1,
            "count"1,
            "hot_add_enabled"true,
            "hot_remove_enabled"true
        },
        "disks"[
            {
                "backing"{
                    "type""VMDK_FILE",
                    "vmdk_file""string"
                },
                "ide"{
                    "master"true,
                    "primary"true
                },
                "new_vmdk"{
                    "capacity"1,
                    "name""string",
                    "storage_policy"{
                        "policy""obj-103"
                    }
                },
                "sata"{
                    "bus"1,
                    "unit"1
                },
                "scsi"{
                    "bus"1,
                    "unit"1
                },
                "type""IDE"
            },
            {
                "backing"{
                    "type""VMDK_FILE",
                    "vmdk_file""string"
                },
                "ide"{
                    "master"true,
                    "primary"true
                },
                "new_vmdk"{
                    "capacity"1,
                    "name""string",
                    "storage_policy"{
                        "policy""obj-103"
                    }
                },
                "sata"{
                    "bus"1,
                    "unit"1
                },
                "scsi"{
                    "bus"1,
                    "unit"1
                },
                "type""IDE"
            }
        ],
        "floppies"[
            {
                "allow_guest_control"true,
                "backing"{
                    "host_device""string",
                    "image_file""string",
                    "type""IMAGE_FILE"
                },
                "start_connected"true
            },
            {
                "allow_guest_control"true,
                "backing"{
                    "host_device""string",
                    "image_file""string",
                    "type""IMAGE_FILE"
                },
                "start_connected"true
            }
        ],
        "guest_OS""DOS",
        "hardware_version""VMX_03",
        "memory"{
            "hot_add_enabled"true,
            "size_MiB"1
        },
        "name""string",
        "nics"[
            {
                "allow_guest_control"true,
                "backing"{
                    "distributed_port""string",
                    "network""obj-103",
                    "type""STANDARD_PORTGROUP"
                },
                "mac_address""string",
                "mac_type""MANUAL",
                "pci_slot_number"1,
                "start_connected"true,
                "type""E1000",
                "upt_compatibility_enabled"true,
                "wake_on_lan_enabled"true
            },
            {
                "allow_guest_control"true,
                "backing"{
                    "distributed_port""string",
                    "network""obj-103",
                    "type""STANDARD_PORTGROUP"
                },
                "mac_address""string",
                "mac_type""MANUAL",
                "pci_slot_number"1,
                "start_connected"true,
                "type""E1000",
                "upt_compatibility_enabled"true,
                "wake_on_lan_enabled"true
            }
        ],
        "parallel_ports"[
            {
                "allow_guest_control"true,
                "backing"{
                    "file""string",
                    "host_device""string",
                    "type""FILE"
                },
                "start_connected"true
            },
            {
                "allow_guest_control"true,
                "backing"{
                    "file""string",
                    "host_device""string",
                    "type""FILE"
                },
                "start_connected"true
            }
        ],
        "placement"{
            "cluster""obj-103",
            "datastore""obj-103",
            "folder""obj-103",
            "host""obj-103",
            "resource_pool""obj-103"
        },
        "sata_adapters"[
            {
                "bus"1,
                "pci_slot_number"1,
                "type""AHCI"
            },
            {
                "bus"1,
                "pci_slot_number"1,
                "type""AHCI"
            }
        ],
        "scsi_adapters"[
            {
                "bus"1,
                "pci_slot_number"1,
                "sharing""NONE",
                "type""BUSLOGIC"
            },
            {
                "bus"1,
                "pci_slot_number"1,
                "sharing""NONE",
                "type""BUSLOGIC"
            }
        ],
        "serial_ports"[
            {
                "allow_guest_control"true,
                "backing"{
                    "file""string",
                    "host_device""string",
                    "network_location""http://myurl.com",
                    "no_rx_loss"true,
                    "pipe""string",
                    "proxy""http://myurl.com",
                    "type""FILE"
                },
                "start_connected"true,
                "yield_on_poll"true
            },
            {
                "allow_guest_control"true,
                "backing"{
                    "file""string",
                    "host_device""string",
                    "network_location""http://myurl.com",
                    "no_rx_loss"true,
                    "pipe""string",
                    "proxy""http://myurl.com",
                    "type""FILE"
                },
                "start_connected"true,
                "yield_on_poll"true
            }
        ],
        "storage_policy"{
            "policy""obj-103"
        }
    }
}

Request Body Parameters:

Name Type Description
bold = required
spec create_spec Virtual machine specification.
spec.guest_OS string Guest OS.

Defines the valid guest operating system types used for configuring a virtual machine. Value is one of:
DOS: MS-DOS.
WIN_31: Windows 3.1
WIN_95: Windows 95
WIN_98: Windows 98
WIN_ME: Windows Millennium Edition
WIN_NT: Windows NT 4
WIN_2000_PRO: Windows 2000 Professional
WIN_2000_SERV: Windows 2000 Server
WIN_2000_ADV_SERV: Windows 2000 Advanced Server
WIN_XP_HOME: Windows XP Home Edition
WIN_XP_PRO: Windows XP Professional
WIN_XP_PRO_64: Windows XP Professional Edition (64 bit)
WIN_NET_WEB: Windows Server 2003, Web Edition
WIN_NET_STANDARD: Windows Server 2003, Standard Edition
WIN_NET_ENTERPRISE: Windows Server 2003, Enterprise Edition
WIN_NET_DATACENTER: Windows Server 2003, Datacenter Edition
WIN_NET_BUSINESS: Windows Small Business Server 2003
WIN_NET_STANDARD_64: Windows Server 2003, Standard Edition (64 bit)
WIN_NET_ENTERPRISE_64: Windows Server 2003, Enterprise Edition (64 bit)
WIN_LONGHORN: Windows Longhorn (experimental)
WIN_LONGHORN_64: Windows Longhorn (64 bit) (experimental)
WIN_NET_DATACENTER_64: Windows Server 2003, Datacenter Edition (64 bit) (experimental)
WIN_VISTA: Windows Vista
WIN_VISTA_64: Windows Vista (64 bit)
WINDOWS_7: Windows 7
WINDOWS_7_64: Windows 7 (64 bit)
WINDOWS_7_SERVER_64: Windows Server 2008 R2 (64 bit)
WINDOWS_8: Windows 8
WINDOWS_8_64: Windows 8 (64 bit)
WINDOWS_8_SERVER_64: Windows 8 Server (64 bit)
WINDOWS_9: Windows 10
WINDOWS_9_64: Windows 10 (64 bit)
WINDOWS_9_SERVER_64: Windows 10 Server (64 bit)
WINDOWS_HYPERV: Windows Hyper-V
FREEBSD: FreeBSD 10 or earlier
FREEBSD_64: FreeBSD 10 x64 or earlier
FREEBSD_11: FreeBSD 11. This constant was added in vSphere API 6.7
FREEBSD_12: FreeBSD 12 or later. This constant was added in vSphere API 6.7
FREEBSD_11_64: FreeBSD 11 x64. This constant was added in vSphere API 6.7
FREEBSD_12_64: FreeBSD 12 x64 or later. This constant was added in vSphere API 6.7
REDHAT: Red Hat Linux 2.1
RHEL_2: Red Hat Enterprise Linux 2
RHEL_3: Red Hat Enterprise Linux 3
RHEL_3_64: Red Hat Enterprise Linux 3 (64 bit)
RHEL_4: Red Hat Enterprise Linux 4
RHEL_4_64: Red Hat Enterprise Linux 4 (64 bit)
RHEL_5: Red Hat Enterprise Linux 5
RHEL_5_64: Red Hat Enterprise Linux 5 (64 bit) (experimental)
RHEL_6: Red Hat Enterprise Linux 6
RHEL_6_64: Red Hat Enterprise Linux 6 (64 bit)
RHEL_7: Red Hat Enterprise Linux 7
RHEL_7_64: Red Hat Enterprise Linux 7 (64 bit)
RHEL_8_64: Red Hat Enterprise Linux 8 (64 bit). This constant was added in vSphere API 6.7
CENTOS: CentOS 4/5
CENTOS_64: CentOS 4/5 (64-bit)
CENTOS_6: CentOS 6
CENTOS_6_64: CentOS 6 (64-bit)
CENTOS_7: CentOS 7
CENTOS_7_64: CentOS 7 (64-bit)
CENTOS_8_64: CentOS 8 (64-bit). This constant was added in vSphere API 6.7
ORACLE_LINUX: Oracle Linux 4/5
ORACLE_LINUX_64: Oracle Linux 4/5 (64-bit)
ORACLE_LINUX_6: Oracle Linux 6
ORACLE_LINUX_6_64: Oracle Linux 6 (64-bit)
ORACLE_LINUX_7: Oracle Linux 7
ORACLE_LINUX_7_64: Oracle Linux 7 (64-bit)
ORACLE_LINUX_8_64: Oracle Linux 8 (64-bit). This constant was added in vSphere API 6.7
SUSE: Suse Linux
SUSE_64: Suse Linux (64 bit)
SLES: Suse Linux Enterprise Server 9
SLES_64: Suse Linux Enterprise Server 9 (64 bit)
SLES_10: Suse linux Enterprise Server 10
SLES_10_64: Suse Linux Enterprise Server 10 (64 bit) (experimental)
SLES_11: Suse linux Enterprise Server 11
SLES_11_64: Suse Linux Enterprise Server 11 (64 bit)
SLES_12: Suse linux Enterprise Server 12
SLES_12_64: Suse Linux Enterprise Server 12 (64 bit)
SLES_15_64: Suse Linux Enterprise Server 15 (64 bit). This constant was added in vSphere API 6.7
NLD_9: Novell Linux Desktop 9
OES: Open Enterprise Server
SJDS: Sun Java Desktop System
MANDRAKE: Mandrake Linux
MANDRIVA: Mandriva Linux
MANDRIVA_64: Mandriva Linux (64 bit)
TURBO_LINUX: Turbolinux
TURBO_LINUX_64: Turbolinux (64 bit)
UBUNTU: Ubuntu Linux
UBUNTU_64: Ubuntu Linux (64 bit)
DEBIAN_4: Debian GNU/Linux 4
DEBIAN_4_64: Debian GNU/Linux 4 (64 bit)
DEBIAN_5: Debian GNU/Linux 5
DEBIAN_5_64: Debian GNU/Linux 5 (64 bit)
DEBIAN_6: Debian GNU/Linux 6
DEBIAN_6_64: Debian GNU/Linux 6 (64 bit)
DEBIAN_7: Debian GNU/Linux 7
DEBIAN_7_64: Debian GNU/Linux 7 (64 bit)
DEBIAN_8: Debian GNU/Linux 8
DEBIAN_8_64: Debian GNU/Linux 8 (64 bit)
DEBIAN_9: Debian GNU/Linux 9
DEBIAN_9_64: Debian GNU/Linux 9 (64 bit)
DEBIAN_10: Debian GNU/Linux 10
DEBIAN_10_64: Debian GNU/Linux 10 (64 bit)
ASIANUX_3: Asianux Server 3
ASIANUX_3_64: Asianux Server 3 (64 bit)
ASIANUX_4: Asianux Server 4
ASIANUX_4_64: Asianux Server 4 (64 bit)
ASIANUX_5_64: Asianux Server 5 (64 bit)
ASIANUX_7_64: Asianux Server 7 (64 bit)
ASIANUX_8_64: Asianux Server 8 (64 bit). This constant was added in vSphere API 6.7
OPENSUSE: OpenSUSE Linux
OPENSUSE_64: OpenSUSE Linux (64 bit)
FEDORA: Fedora Linux
FEDORA_64: Fedora Linux (64 bit)
COREOS_64: CoreOS Linux (64 bit)
VMWARE_PHOTON_64: VMware Photon (64 bit)
OTHER_24X_LINUX: Linux 2.4x Kernel
OTHER_24X_LINUX_64: Linux 2.4x Kernel (64 bit) (experimental)
OTHER_26X_LINUX: Linux 2.6x Kernel
OTHER_26X_LINUX_64: Linux 2.6x Kernel (64 bit) (experimental)
OTHER_3X_LINUX: Linux 3.x Kernel
OTHER_3X_LINUX_64: Linux 3.x Kernel (64 bit)
OTHER_4X_LINUX: Linux 4.x Kernel. This constant was added in vSphere API 6.7
OTHER_4X_LINUX_64: Linux 4.x Kernel (64 bit). This constant was added in vSphere API 6.7
OTHER_LINUX: Linux 2.2x Kernel
GENERIC_LINUX: Other Linux
OTHER_LINUX_64: Linux (64 bit) (experimental)
SOLARIS_6: Solaris 6
SOLARIS_7: Solaris 7
SOLARIS_8: Solaris 8
SOLARIS_9: Solaris 9
SOLARIS_10: Solaris 10 (32 bit) (experimental)
SOLARIS_10_64: Solaris 10 (64 bit) (experimental)
SOLARIS_11_64: Solaris 11 (64 bit)
OS2: OS/2
ECOMSTATION: eComStation 1.x
ECOMSTATION_2: eComStation 2.0
NETWARE_4: Novell NetWare 4
NETWARE_5: Novell NetWare 5.1
NETWARE_6: Novell NetWare 6.x
OPENSERVER_5: SCO OpenServer 5
OPENSERVER_6: SCO OpenServer 6
UNIXWARE_7: SCO UnixWare 7
DARWIN: Mac OS 10.5
DARWIN_64: Mac OS 10.5 (64 bit)
DARWIN_10: Mac OS 10.6
DARWIN_10_64: Mac OS 10.6 (64 bit)
DARWIN_11: Mac OS 10.7
DARWIN_11_64: Mac OS 10.7 (64 bit)
DARWIN_12_64: Mac OS 10.8 (64 bit)
DARWIN_13_64: Mac OS 10.9 (64 bit)
DARWIN_14_64: Mac OS 10.10 (64 bit)
DARWIN_15_64: Mac OS 10.11 (64 bit)
DARWIN_16_64: Mac OS 10.12 (64 bit)
DARWIN_17_64: Mac OS 10.13 (64 bit). This constant was added in vSphere API 6.7
DARWIN_18_64: Mac OS 10.14 (64 bit). This constant was added in vSphere API 6.7
VMKERNEL: VMware ESX 4
VMKERNEL_5: VMware ESX 5
VMKERNEL_6: VMware ESX 6
VMKERNEL_65: VMware ESX 6.5
OTHER: Other Operating System
OTHER_64: Other Operating System (64 bit) (experimental)

spec.name string Virtual machine name.

Optional. If unset, a default name will be generated by the server.

spec.placement placement_spec Virtual machine placement information.

Optional. This field is currently required. In the future, if this field is unset, the system will attempt to choose suitable resources on which to place the virtual machine.

spec.placement.folder string Virtual machine folder into which the virtual machine should be placed.

Optional. This field is currently required. In the future, if this field 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.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Folder. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Folder.

spec.placement.resource_pool string Resource pool into which the virtual machine should be placed.

Optional. This field is currently required if both host and cluster are unset. In the future, if this field 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.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ResourcePool. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ResourcePool.

spec.placement.host string Host onto which the virtual machine should be placed.

If host and resource_pool are both specified, resource_pool must belong to host.

If host and cluster are both specified, host must be a member of cluster.

Optional. This field may be unset if resource_pool 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.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: HostSystem. When operations return a value of this structure as a result, the field will be an identifier for the resource type: HostSystem.

spec.placement.cluster string Cluster into which the virtual machine should be placed.

If cluster and resource_pool are both specified, resource_pool must belong to cluster.

If cluster and host are both specified, host must be a member of cluster.

Optional. If resource_pool or host is specified, it is recommended that this field be unset.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ClusterComputeResource. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ClusterComputeResource.

spec.placement.datastore string 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.

Optional. This field is currently required. In the future, if this field 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.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Datastore. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Datastore.

spec.hardware_version string Virtual hardware version.

Optional. If unset, defaults to the most recent version supported by the server.

spec.boot create_spec Boot configuration.

Optional. If unset, guest-specific default values will be used.

spec.boot.type string Firmware type to be used by the virtual machine.

Optional. If unset, defaults to value that is recommended for the guest OS and is supported for the virtual hardware version.

spec.boot.efi_legacy_boot boolean Flag indicating whether to use EFI legacy boot mode.

Optional. It is only relevant when type has value EFI. If unset, defaults to value that is recommended for the guest OS and is supported for the virtual hardware version.

spec.boot.network_protocol string Protocol to use when attempting to boot the virtual machine over the network.

Optional. It is only relevant when type has value EFI. If unset, defaults to a system defined default value.

spec.boot.delay long 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.

Optional. If unset, default value is 0.

spec.boot.retry boolean Flag indicating whether the virtual machine should automatically retry the boot process after a failure.

Optional. If unset, default value is false.

spec.boot.retry_delay long Delay in milliseconds before retrying the boot process after a failure; applicable only when vcenter.vm.hardware.boot.info.retry is true.

Optional. If unset, default value is 10000.

spec.boot.enter_setup_mode boolean 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.

Optional. If unset, the value is unchanged.

spec.boot_devices entry_create_spec[] Boot device configuration.

Optional. If unset, a server-specific boot sequence will be used.

spec.boot_devices[].type string Virtual Boot device type.

Defines the valid device types that may be used as bootable devices. Value is one of:
CDROM: Virtual CD-ROM device.
DISK: Virtual disk device.
ETHERNET: Virtual Ethernet adapter.
FLOPPY: Virtual floppy drive.

spec.cpu update_spec CPU configuration.

Optional. If unset, guest-specific default values will be used.

spec.cpu.count long 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 vcenter.vm.hardware.cpu.info.hot_add_enabled is true, and may only be decreased if vcenter.vm.hardware.cpu.info.hot_remove_enabled is true.

Optional. If unset, the value is unchanged.

spec.cpu.cores_per_socket long 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.

Optional. If unset, the value is unchanged.

spec.cpu.hot_add_enabled boolean Flag indicating whether adding CPUs while the virtual machine is running is enabled.

This field may only be modified if the virtual machine is powered off.

Optional. If unset, the value is unchanged.

spec.cpu.hot_remove_enabled boolean Flag indicating whether removing CPUs while the virtual machine is running is enabled.

This field may only be modified if the virtual machine is powered off.

Optional. If unset, the value is unchanged.

spec.memory update_spec Memory configuration.

Optional. If unset, guest-specific default values will be used.

spec.memory.size_MiB long 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 vcenter.vm.hardware.memory.info.hot_add_enabled is true, and the new memory size must satisfy the constraints specified by vcenter.vm.hardware.memory.info.hot_add_increment_size_MiB and vcenter.vm.hardware.memory.info.hot_add_limit_MiB.

Optional. If unset, the value is unchanged.

spec.memory.hot_add_enabled boolean 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 field may only be modified if the virtual machine is not powered on.

Optional. If unset, the value is unchanged.

spec.disks create_spec[] List of disks.

Optional. If unset, a single blank virtual disk of a guest-specific size will be created on the same storage as the virtual machine configuration, and will use a guest-specific host bus adapter type. If the guest-specific size is 0, no virtual disk will be created.

spec.disks[].type string Type of host bus adapter to which the device should be attached.

Optional. If unset, guest-specific default values will be used.

spec.disks[].ide ide_address_spec Address for attaching the device to a virtual IDE adapter.

Optional. It is only relevant when type has value IDE. If unset, the server will choose an available address; if none is available, the request will fail.

spec.disks[].ide.primary boolean Flag specifying whether the device should be attached to the primary or secondary IDE adapter of the virtual machine.

Optional. If unset, the server will choose a adapter with an available connection. If no IDE connections are available, the request will be rejected.

spec.disks[].ide.master boolean Flag specifying whether the device should be the master or slave device on the IDE adapter.

Optional. If unset, the server will choose an available connection type. If no IDE connections are available, the request will be rejected.

spec.disks[].scsi scsi_address_spec Address for attaching the device to a virtual SCSI adapter.

Optional. It is only relevant when type has value SCSI. If unset, the server will choose an available address; if none is available, the request will fail.

spec.disks[].scsi.bus long Bus number of the adapter to which the device should be attached.

spec.disks[].scsi.unit long Unit number of the device.

Optional. 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.

spec.disks[].sata sata_address_spec Address for attaching the device to a virtual SATA adapter.

Optional. It is only relevant when type has value SATA. If unset, the server will choose an available address; if none is available, the request will fail.

spec.disks[].sata.bus long Bus number of the adapter to which the device should be attached.

spec.disks[].sata.unit long Unit number of the device.

Optional. 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.

spec.disks[].backing backing_spec Existing physical resource backing for the virtual disk. Exactly one of backing or new_vmdk must be specified.

Optional. If unset, the virtual disk will not be connected to an existing backing.

spec.disks[].backing.type string Backing type for the virtual disk.

Defines the valid backing types for a virtual disk. Value is one of:
VMDK_FILE: Virtual disk is backed by a VMDK file.

spec.disks[].backing.vmdk_file string Path of the VMDK file backing the virtual disk.

Optional. It is only relevant when type has value VMDK_FILE. This field is optional and it is only relevant when the value of type is VMDK_FILE.

spec.disks[].new_vmdk vmdk_create_spec Specification for creating a new VMDK backing for the virtual disk. Exactly one of backing or new_vmdk must be specified.

Optional. If unset, a new VMDK backing will not be created.

spec.disks[].new_vmdk.name string Base name of the VMDK file. The name should not include the '.vmdk' file extension.

Optional. If unset, a name (derived from the name of the virtual machine) will be chosen by the server.

spec.disks[].new_vmdk.capacity long Capacity of the virtual disk backing in bytes.

Optional. If unset, defaults to a guest-specific capacity.

spec.disks[].new_vmdk.storage_policy storage_policy_spec The storage_policy_spec structure contains information about the storage policy that is to be associated the with VMDK file. This attribute was added in vSphere API 6.7

Optional. If unset the default storage policy of the target datastore (if applicable) is applied. Currently a default storage policy is only supported by object based datastores : VVol & vSAN. For non- object datastores, if unset then no storage policy would be associated with the VMDK file.

spec.disks[].new_vmdk.storage_policy.policy string Identifier of the storage policy which should be associated with the VMDK file. This attribute was added in vSphere API 6.7

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.StoragePolicy. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.StoragePolicy.

spec.nics create_spec[] List of Ethernet adapters.

Optional. If unset, no Ethernet adapters will be created.

spec.nics[].type string Ethernet adapter emulation type.

Optional. If unset, defaults to a guest-specific type.

spec.nics[].upt_compatibility_enabled boolean Flag indicating whether Universal Pass-Through (UPT) compatibility is enabled on this virtual Ethernet adapter.

Optional. It is only relevant when type has value VMXNET3. If unset, defaults to false.

spec.nics[].mac_type string MAC address type.

Optional. If unset, defaults to GENERATED.

spec.nics[].mac_address string MAC address.

Optional. It is only relevant when mac_type has value MANUAL. Workaround for PR1459647.

spec.nics[].pci_slot_number long 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.

Optional. If unset, the server will choose an available address when the virtual machine is powered on.

spec.nics[].wake_on_lan_enabled boolean Flag indicating whether wake-on-LAN is enabled on this virtual Ethernet adapter.

Optional. Defaults to false if unset.

spec.nics[].backing backing_spec Physical resource backing for the virtual Ethernet adapter.

Optional. If unset, the system may try to find an appropriate backing. If one is not found, the request will fail.

spec.nics[].backing.type string Backing type for the virtual Ethernet adapter.

Defines the valid backing types for a virtual Ethernet adapter. Value is one of:
STANDARD_PORTGROUP: vSphere standard portgroup network backing.
HOST_DEVICE: Legacy host device network backing. Imported VMs may have virtual Ethernet adapters with this type of backing, but this type of backing cannot be used to create or to update a virtual Ethernet adapter.
DISTRIBUTED_PORTGROUP: Distributed virtual switch backing.
OPAQUE_NETWORK: Opaque network backing.

spec.nics[].backing.network string Identifier of the network that backs the virtual Ethernet adapter.

Optional. It is only relevant when type has value [STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, OPAQUE_NETWORK]. This field is optional and it is only relevant when the value of type is one of STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, or OPAQUE_NETWORK.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Network. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Network.

spec.nics[].backing.distributed_port string 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 field. 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 field cannot be specified as no free ports exist before use.

Optional. It is only relevant when type has value DISTRIBUTED_PORTGROUP. May be used to specify a port when the network specified on the network field 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.

spec.nics[].start_connected boolean Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on.

Optional. Defaults to false if unset.

spec.nics[].allow_guest_control boolean Flag indicating whether the guest can connect and disconnect the device.

Optional. Defaults to false if unset.

spec.cdroms create_spec[] List of CD-ROMs.

Optional. If unset, no CD-ROM devices will be created.

spec.cdroms[].type string Type of host bus adapter to which the device should be attached.

Optional. If unset, guest-specific default values will be used.

spec.cdroms[].ide ide_address_spec Address for attaching the device to a virtual IDE adapter.

Optional. It is only relevant when type has value IDE. If unset, the server will choose an available address; if none is available, the request will fail.

spec.cdroms[].ide.primary boolean Flag specifying whether the device should be attached to the primary or secondary IDE adapter of the virtual machine.

Optional. If unset, the server will choose a adapter with an available connection. If no IDE connections are available, the request will be rejected.

spec.cdroms[].ide.master boolean Flag specifying whether the device should be the master or slave device on the IDE adapter.

Optional. If unset, the server will choose an available connection type. If no IDE connections are available, the request will be rejected.

spec.cdroms[].sata sata_address_spec Address for attaching the device to a virtual SATA adapter.

Optional. It is only relevant when type has value SATA. If unset, the server will choose an available address; if none is available, the request will fail.

spec.cdroms[].sata.bus long Bus number of the adapter to which the device should be attached.

spec.cdroms[].sata.unit long Unit number of the device.

Optional. 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.

spec.cdroms[].backing backing_spec Physical resource backing for the virtual CD-ROM device.

Optional. If unset, defaults to automatic detection of a suitable host device.

spec.cdroms[].backing.type string Backing type for the virtual CD-ROM device.

Defines the valid backing types for a virtual CD-ROM device. Value is one of:
ISO_FILE: Virtual CD-ROM device is backed by an ISO file.
HOST_DEVICE: Virtual CD-ROM device is backed by a device on the host where the virtual machine is running.
CLIENT_DEVICE: Virtual CD-ROM device is backed by a device on the client that is connected to the virtual machine console.

spec.cdroms[].backing.iso_file string Path of the image file that should be used as the virtual CD-ROM device backing.

Optional. It is only relevant when type has value ISO_FILE. This field is optional and it is only relevant when the value of type is ISO_FILE.

spec.cdroms[].backing.host_device string Name of the device that should be used as the virtual CD-ROM device backing.

Optional. It is only relevant when type has value HOST_DEVICE. If unset, the virtual CD-ROM device will be configured to automatically detect a suitable host device.

spec.cdroms[].backing.device_access_type string Access type for the device backing.

Optional. It is only relevant when type has value [HOST_DEVICE, CLIENT_DEVICE]. If unset, defaults to EMULATION.

spec.cdroms[].start_connected boolean Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on.

Optional. Defaults to false if unset.

spec.cdroms[].allow_guest_control boolean Flag indicating whether the guest can connect and disconnect the device.

Optional. Defaults to false if unset.

spec.floppies create_spec[] List of floppy drives.

Optional. If unset, no floppy drives will be created.

spec.floppies[].backing backing_spec Physical resource backing for the virtual floppy drive.

Optional. If unset, defaults to automatic detection of a suitable host device.

spec.floppies[].backing.type string Backing type for the virtual floppy drive.

Defines the valid backing types for a virtual floppy drive. Value is one of:
IMAGE_FILE: Virtual floppy drive is backed by an image file.
HOST_DEVICE: Virtual floppy drive is backed by a device on the host where the virtual machine is running.
CLIENT_DEVICE: Virtual floppy drive is backed by a device on the client that is connected to the virtual machine console.

spec.floppies[].backing.image_file string Path of the image file that should be used as the virtual floppy drive backing.

Optional. It is only relevant when type has value IMAGE_FILE. This field is optional and it is only relevant when the value of type is IMAGE_FILE.

spec.floppies[].backing.host_device string Name of the device that should be used as the virtual floppy drive backing.

Optional. It is only relevant when type has value HOST_DEVICE. If unset, the virtual floppy drive will be configured to automatically detect a suitable host device.

spec.floppies[].start_connected boolean Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on.

Optional. Defaults to false if unset.

spec.floppies[].allow_guest_control boolean Flag indicating whether the guest can connect and disconnect the device.

Optional. Defaults to false if unset.

spec.parallel_ports create_spec[] List of parallel ports.

Optional. If unset, no parallel ports will be created.

spec.parallel_ports[].backing backing_spec Physical resource backing for the virtual parallel port.

Optional. If unset, defaults to automatic detection of a suitable host device.

spec.parallel_ports[].backing.type string Backing type for the virtual parallel port.

Defines the valid backing types for a virtual parallel port. Value is one of:
FILE: Virtual parallel port is backed by a file.
HOST_DEVICE: Virtual parallel port is backed by a device on the host where the virtual machine is running.

spec.parallel_ports[].backing.file string Path of the file that should be used as the virtual parallel port backing.

Optional. It is only relevant when type has value FILE. This field is optional and it is only relevant when the value of type is FILE.

spec.parallel_ports[].backing.host_device string Name of the device that should be used as the virtual parallel port backing.

Optional. It is only relevant when type has value HOST_DEVICE. If unset, the virtual parallel port will be configured to automatically detect a suitable host device.

spec.parallel_ports[].start_connected boolean Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on.

Optional. Defaults to false if unset.

spec.parallel_ports[].allow_guest_control boolean Flag indicating whether the guest can connect and disconnect the device.

Optional. Defaults to false if unset.

spec.serial_ports create_spec[] List of serial ports.

Optional. If unset, no serial ports will be created.

spec.serial_ports[].yield_on_poll boolean 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.

Optional. If unset, defaults to false.

spec.serial_ports[].backing backing_spec Physical resource backing for the virtual serial port.

Optional. If unset, defaults to automatic detection of a suitable host device.

spec.serial_ports[].backing.type string Backing type for the virtual serial port.

Defines the valid backing types for a virtual serial port. Value is one of:
FILE: Virtual serial port is backed by a file.
HOST_DEVICE: Virtual serial port is backed by a device on the host where the virtual machine is running.
PIPE_SERVER: Virtual serial port is backed by a named pipe server. The virtual machine will accept a connection from a host application or another virtual machine on the same host. This is useful for capturing debugging information sent through the virtual serial port.
PIPE_CLIENT: Virtual serial port is backed by a named pipe client. The virtual machine will connect to the named pipe provided by a host application or another virtual machine on the same host. This is useful for capturing debugging information sent through the virtual serial port.
NETWORK_SERVER: Virtual serial port is backed by a network server. This backing may be used to create a network-accessible serial port on the virtual machine, accepting a connection from a remote system.
NETWORK_CLIENT: Virtual serial port is backed by a network client. This backing may be used to create a network-accessible serial port on the virtual machine, initiating a connection to a remote system.

spec.serial_ports[].backing.file string Path of the file backing the virtual serial port.

Optional. It is only relevant when type has value FILE. This field is optional and it is only relevant when the value of type is FILE.

spec.serial_ports[].backing.host_device string Name of the device backing the virtual serial port.

Optional. It is only relevant when type has value HOST_DEVICE. If unset, the virtual serial port will be configured to automatically detect a suitable host device.

spec.serial_ports[].backing.pipe string Name of the pipe backing the virtual serial port.

Optional. It is only relevant when type has value [PIPE_SERVER, PIPE_CLIENT]. This field is optional and it is only relevant when the value of type is one of PIPE_SERVER or PIPE_CLIENT.

spec.serial_ports[].backing.no_rx_loss boolean 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.

Optional. It is only relevant when type has value [PIPE_SERVER, PIPE_CLIENT]. If unset, defaults to false.

spec.serial_ports[].backing.network_location URI URI specifying the location of the network service backing the virtual serial port.

Optional. It is only relevant when type has value [NETWORK_SERVER, NETWORK_CLIENT]. This field is optional and it is only relevant when the value of type is one of NETWORK_SERVER or NETWORK_CLIENT.

spec.serial_ports[].backing.proxy URI 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.

Optional. It is only relevant when type has value [NETWORK_SERVER, NETWORK_CLIENT]. If unset, no proxy service should be used.

spec.serial_ports[].start_connected boolean Flag indicating whether the virtual device should be connected whenever the virtual machine is powered on.

Optional. Defaults to false if unset.

spec.serial_ports[].allow_guest_control boolean Flag indicating whether the guest can connect and disconnect the device.

Optional. Defaults to false if unset.

spec.sata_adapters create_spec[] List of SATA adapters.

Optional. If unset, any adapters necessary to connect the virtual machine's storage devices will be created; this includes any devices that explicitly specify a SATA host bus adapter, as well as any devices that do not specify a host bus adapter if the guest's preferred adapter type is SATA.

spec.sata_adapters[].type string Adapter type.

Optional. If unset, a guest-specific default value will be used.

spec.sata_adapters[].bus long SATA bus number.

Optional. If unset, the server will choose an available bus number; if none is available, the request will fail.

spec.sata_adapters[].pci_slot_number long Address of the SATA adapter on the PCI bus.

Optional. If unset, the server will choose an available address when the virtual machine is powered on.

spec.scsi_adapters create_spec[] List of SCSI adapters.

Optional. If unset, any adapters necessary to connect the virtual machine's storage devices will be created; this includes any devices that explicitly specify a SCSI host bus adapter, as well as any devices that do not specify a host bus adapter if the guest's preferred adapter type is SCSI. The type of the SCSI adapter will be a guest-specific default type.

spec.scsi_adapters[].type string Adapter type.

Optional. If unset, a guest-specific default value will be used.

spec.scsi_adapters[].bus long SCSI bus number.

Optional. If unset, the server will choose an available bus number; if none is available, the request will fail.

spec.scsi_adapters[].pci_slot_number long 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.

Optional. If unset, the server will choose an available address when the virtual machine is powered on.

spec.scsi_adapters[].sharing string Bus sharing mode.

Optional. If unset, the adapter will default to NONE.

spec.storage_policy storage_policy_spec The storage_policy_spec structure contains information about the storage policy that is to be associated with the virtual machine home (which contains the configuration and log files). This attribute was added in vSphere API 6.7

Optional. If unset the datastore default storage policy (if applicable) is applied. Currently a default storage policy is only supported by object datastores : VVol and vSAN. For non-object datastores, if unset then no storage policy would be associated with the virtual machine home.

spec.storage_policy.policy string Identifier of the storage policy which should be associated with the virtual machine. This attribute was added in vSphere API 6.7

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.StoragePolicy. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.StoragePolicy.

Response:

HTTP Status Code: 200

Representation:

{
    "value""obj-103"
}

Response Type:

Name Type Description
bold = required
value string ID of newly-created virtual machine.

Errors:

HTTP Status Code Type Description
400 already_exists if a virtual machine with the specified name already exists.
500 error if the system reports an error while responding to the request.
400 invalid_argument if any of the specified parameters are invalid.
404 not_found if any of the resources specified in spec could not be found
400 resource_inaccessible if a specified resource (eg. host) is not accessible.
400 resource_in_use if any of the specified storage addresses (eg. IDE, SATA, SCSI) result in a storage address conflict.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
400 unable_to_allocate_resource if any of the resources needed to create the virtual machine could not be allocated.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.
400 unsupported if guest_OS is not supported for the requested virtual hardware version and spec includes unset fields that default to guest-specific values.