CreateVmInstance
Creates a VM instance. For
example,
CreateVmInstance name=vm imageUuid=d720ff0c60ee48d3a2e6263dd3e12c33 \
instanceOfferingUuid=76789b62aeb542a5b4b8b8488fbaced2 \
l3NetworkUuids=37d3c4a1e2f14a1c8316a23531e62988
#Specify multiple NICs and the default L3 network.
CreateVmInstance name=test imageUuid=ee14c7c8cc46309d821c51bbae3adb70 \
instanceOfferingUuid=1cf417bfd0e94175aea92131f1000011 \
l3NetworkUuids='ac5c7e736f1b499bbd0c12763b30051d,e315b2cb6151454bbab362a6e92909e7' \
defaultL3NetworkUuid=ac5c7e736f1b499bbd0c12763b30051d
#Specify multiple NICs, the default L3 network, the static IP address, the console VNC mode, and the VNC password, and set the high availability level to NeverStop.
CreateVmInstance name=test imageUuid=ee14c7c8cc46309d821c51bbae3adb70 \
instanceOfferingUuid=1cf417bfd0e94175aea92131f1000011 \
l3NetworkUuids='ac5c7e736f1b499bbd0c12763b30051d,e315b2cb6151454bbab362a6e92909e7' \
defaultL3NetworkUuid="ac5c7e736f1b499bbd0c12763b30051d" \
systemTags="consolePassword::123456","ha::NeverStop","vmConsoleMode::vnc","staticIp::ac5c7e736f1b499bbd0c12763b30051d::172.24.0.5"
Parameters
Name | Description | Optional | Valid Value | Starting Version |
---|---|---|---|---|
name | The resource name. For more information, see Resource Property. | 0.6 | ||
resourceUuid | The resource UUID. For more information, see Resource Property. | Yes | 0.6 | |
description | The resource description. For more information, see Resource Property. | Yes | 0.6 | |
instanceOfferingUuid | The instance offering UUID, which specifies the CPU, memory, and other parameters of a VM instance. | 0.6 | ||
imageUuid | The image UUID, which specifies the image from which the root volume of the VM instance is created. | 0.6 | ||
l3NetworkUuids | The L3 network UUID list. You can specify one or more L3 networks. Then the VM instance will create a NIC on each network. | 0.6 | ||
type | The VM instance type. This parameter is a reserved field for internal use. |
|
0.6 | |
rootDiskOfferingUuid | The disk offering UUID of the root volume. If the image type specified in imageUuid is ISO, you must specify rootDiskOfferingUuid to determine the size of the root volume to be created. If the image type is not ISO, this parameter is optional. | Yes | 0.6 | |
dataDiskSizes | List of custom volume sizes. You can specify one or more volume sizes (repeatable) to create one or more data volumes for the VM instances. | Yes | 4.4.24 | |
dataDiskOfferingUuids | The disk offering UUID list. You can specify one or more disk offering UUIDs to create one or more data volumes for the VM instance. (The UUIDs can be repeated.) | Yes | 0.6 | |
zoneUuid | The zone UUID. If specified, the VM instance will be created in the specified zone. This parameter can be overridden by clusterUuid and hostUuid. | Yes | 0.6 | |
clusterUuid | The cluster UUID. If specified, the VM instance will be created in the specified cluster. This parameter can be overridden by hostUuid. | Yes | 0.6 | |
hostUuid | The host UUID. If specified, the VM instance will be created on the specified host. | Yes | 0.6 | |
defaultL3NetworkUuid | The UUID of the default L3 network. If l3NetworkUuids contains the UUIDs of multiple L3 networks, this parameter is required to specify the default L3 network. If l3NetworkUuids has only one L3 network UUID, this parameter is optional. | Yes | 0.6 | |
primaryStorageUuidForRootVolume | The primary storage UUID. If specified, the root volume of the VM instance will be created on the specified primary storage. | Yes | 1.8 | |
strategy | The VM instance creation strategy. You can choose to start the VM instance immediately after creation or not to start it after creation. | Yes | 0.6 | |
tagUuids | The tag UUID list. | Yes | 3.4.0 | |
userTags | The user tags. For more information, see CreateUserTag. The resource type is VmInstanceVO. | Yes | 0.6 | |
systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VmInstanceVO. | Yes | 0.6 | |
dataVolumeSystemTagsOnIndex | The required system label mapping requited for data volume index. | Yes | 4.4.24 | |
timeout | Yes |

- When you create a VM instance in ZStack Cloud, you can specify an affinity group by
adding the affinityGroup option to SystemTags.
- Format of the affinityGroup option:
affinityGroupUuid::UUID
- Example:
affinityGroupUuid::5fd71606d5af451d981413f35367a8d6
- Format of the affinityGroup option:
- When you create a VM instance in ZStack Cloud,
you can specify a PCI device by adding the PCI option to
SystemTags.
- Format of the PCI option:
pciDevice::UUID
- Example:
pciDevice::634b48a7bca139d9944a0f95b0c2dddf
- Format of the PCI option:
- When you create a VM instance in ZStack Cloud, you can bind a CPU by adding the
vmCpuPinning option to SystemTags.
- Format of the vmCpuPinning option:
vmCpuPinning::binding policy
- Example:
vmCpuPinning::1:3;1-3:4-7,^6
- Only the administrator can update, create, or delete the SystemTag. When you clone a VM instance, you will also clone this SystemTag.
- Format of the vmCpuPinning option:
- When you create a VM instance in ZStack Cloud,
you can use the userdata feature by adding the userdata option to
SystemTags.
- Format of the userdata option:
userdata::base64 encoded script
- Example:
userdata::I2Nsb3VkLWNvbmZpZwp1c2VyczoKIC0gbmFtZTogdGVzdAogICBzaGVsbDogL2Jpbi9iYXNoCiAgIGdyb3VwczogdXNlcnMKICAgc3VkbzogWydBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMJ10KICAgc3NoLWF1dGhvcml6ZWQta2V5czoKICAgICAgIC0gc3NoLXJzYSBBQUFBQjNOemFDMUxYQ0pmanJvRDFsVCByb290QDEwLTAtMC0xOApib290Y21kOgogLSBta2RpciAvdG1wL3RlbXAgCndyaXRlX2ZpbGVzOgogLSBwYXRoOiAvdG1wL1pTdGFja19jb25maWcKICAgY29udGVudDogfAogICAgICAgSGVsbG8sd29ybGQhCiAgIHBlcm1pc3Npb25zOiAnMDc1NScKaG9zdG5hbWU6IFBlcmYtdGVzdApkaXNhYmxlX3Jvb3Q6IGZhbHNlCnNzaF9wd2F1dGg6IHllcwpjaHBhc3N3ZDoKICBsaXN0OiB8CiAgICAgIHJvb3Q6d29yZAogIGV4cGlyZTogRmFsc2UKcnVuY21kOgogLSBlY2hvIGxzIC1sIC8gPi9yb290L2xpc3Quc2g=
- Format of the userdata option:
- When you create a VM instance in ZStack Cloud,
you can specify an SSH key by adding the sshkey option to
SystemTags.
- Format of the sshkey option:
sshkey::public key content
- Example:
sshkey::ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPAGDmLG2yW1fGQsek4PdBL6wiVMHuLrl566ITPAf8A2Oi5BaExoUwdPjA96OaUSrtlsKlrXUMGEJwN1r1TrL9JdUMg7jww3QysGuS3P+bRsBe1TSGHS8LNc9JY9HpoL4ZN/j0zTaZfju9eDzbVsbDrF91x3yDeeGH6IG6gWJn96HPfrlg7REfo04eBdflsTaaFC0lAXoBOrnGVnzRdQfwTNRGmMAyFzCV83HOhVzBJuL5VqtAT8a0lSC4QgZTNROh6zbkTUUYYQu0QS65EaJCTyAhksuidRzyjLX3p3oMileKdJNugRa5IDHhGJXExIK+58Nvaqfj/03yN8IfO7sj root@hpe-77
- Format of the sshkey option:
- When you create a VM instance in ZStack Cloud,
you can specify the high availability (HA) level by adding the ha
option to SystemTags.
- Format of the ha option:
ha::NeverStop
- Example:
ha::NeverStop
- Format of the ha option:
- When you create a VM instance in ZStack Cloud,
you can specify the console mode by adding the vmConsoleMode
option to SystemTags.
- Format of the vmConsoleMode option:
vmConsoleMode::console mode
- Example:
vmConsoleMode::spice or vmConsoleMode::vnc
- Format of the vmConsoleMode option:
- When you create a VM instance in ZStack Cloud,
you can specify the USB redirection by adding the usbRedirect
option to SystemTags.
- Format of the usbRedirect option:
usbRedirect::true
- Example:
usbRedirect::true
- Format of the usbRedirect option:
- When you create a VM instance in ZStack Cloud,
you can specify the console password by adding the
consolePassword option to SystemTags.
- Format of the consolePassword option:
consolePassword::console password
- Example:
consolePassword::123456
- Format of the consolePassword option:
- When you create a VM instance in ZStack Cloud,
you can specify an IP address for the L3 network by adding the
staticIp option to SystemTags. If the network address
type is double stack (IPv4+IPv6), you can add two staticIp
options, which are IPv4 and IPv6, respectively.
- Format of the staticIp option:
staticIp::L3 network UUID::specified IP
- Example:
staticIp::81a21a81cde84c1084c191354053a3b5::172.20.196.0
- Format of the staticIp option:
- When you create a VM instance in ZStack Cloud,
you can specify the MAC address of the corresponding NIC on the L3
network by adding the customMac option to SystemTags.
- Format of the customMac option:
customMac::L3 network UUID::specified MAC address
- Example:
customMac::81a21a81cde84c1084c191354053a3b5::fa:00:37:ee:9f:00
- Format of the customMac option:
- When you create a VM instance in ZStack Cloud,
you can specify the volume provisioning strategy by adding the
volumeProvisioningStrategy option to SystemTags. The
SystemTag is passed by using the rootVolumeSystemTags
parameter.
- Format of the volumeProvisioningStrategy option:
volumeProvisioningStrategy::ThinProvisioning, volumeProvisioningStrategy::ThickProvisioning
- Example:
volumeProvisioningStrategy::ThinProvisioning, volumeProvisioningStrategy::ThickProvisioning
- Format of the volumeProvisioningStrategy option:
- When you create a VM instance in ZStack Cloud,
you can specify the Ceph pool where the root volume is located by adding
the rootPoolName option to SystemTags. The SystemTag is
passed by using the rootPoolName parameter.
- Format of the rootPoolName option:
ceph::rootPoolName::xxx. Here, xxx is the pool name.
- Example:
ceph::rootPoolName::pri-v-r-26e11ca6814d4e1ba504d845f7848db3
- Format of the rootPoolName option:
- When you create a VM instance in ZStack Cloud,
you can specify the mother board type by adding the vmMachineType
option to SystemTags. The SystemTag is passed by using the
vmMachineType parameter.
- Format of the vmMachineType option:
vmMachineType::xx. Here, xx is pc or q35.
- Example:
vmMachineType::pc
- Format of the vmMachineType option:
- When you create a VM instance in ZStack Cloud,
you can specify the CD-ROM list by adding the cdroms option to
SystemTags. The SystemTag is passed by using the
cdroms parameter.
- Format of the cdroms option:
cdroms::${cdrom-1 config}::${cdrom-2 config}::${cdrom-3 config}
. The CD-ROM configuration (cdrom config) has three options: iso uuid (the UUID of the ISO to be attached by the CD-ROM), empty (do not select any ISO), and none (do not configure the CD-ROM). - Examples:
- Create an empty list:
cdrom: cdroms::empty::none::none
- Create three empty lists:
cdrom: cdroms::empty::empty::empty
- Create three lists with ISO attached:
cdrom:cdroms::iso_1_uuid::iso_2_uuid::iso_3_uuid
- Create an empty list:
- Format of the cdroms option:
- When you create a VM instance in ZStack Cloud,
you can choose not to create any CD-ROM by adding the
createWithoutCdRom option to SystemTags. The SystemTag
is passed by using the createWithoutCdRom parameter.
- Format of the createWithoutCdRom option:
createWithoutCdRom::true
- Example:
createWithoutCdRom::true
- Format of the createWithoutCdRom option:
- When you create a VM instance in ZStack Cloud,
you can specify a MDEV device by adding the mdevDevice option to
SystemTags.
- Format of the mdevDevice option:
mdevDevice::MDEV_DEV_UUID
- Example:
mdevDevice::e2af8f869eff49d2a3d6f86cadc27090
- Format of the mdevDevice option:
- When you create a VM instance in ZStack Cloud,
you can specify whether to automatically uninstall the physical PCI
device allocated from the device specifications when the VM instance is
shut down. You can also delete or change the configurations of existing
VM instances. Note that you can add the
autoReleaseSpecReleatedPhysicalPciDevice option to
SystemTags.
- Format of the autoReleaseSpecReleatedPhysicalPciDevice
option:
autoReleaseSpecReleatedPhysicalPciDevice
- Example:
autoReleaseSpecReleatedPhysicalPciDevice
- Format of the autoReleaseSpecReleatedPhysicalPciDevice
option:
- When you create a VM instance in ZStack Cloud,
you can specify whether to automatically uninstall the virtual PCI
device allocated from the device specifications when the VM instance is
shut down. You can also delete or change the configurations of existing
VM instances. Note that you can add the
autoReleaseSpecReleatedVirtualPciDevice option to
SystemTags.
- Format of the autoReleaseSpecReleatedVirtualPciDevice
option:
autoReleaseSpecReleatedVirtualPciDevice
- Example:
autoReleaseSpecReleatedVirtualPciDevice
- Format of the autoReleaseSpecReleatedVirtualPciDevice
option:
- When you create a VM instance in ZStack Cloud,
you can specify the MDEV device specification and the device count
allocated from the specification by adding the mdevDeviceSpec
option to SystemTags.
- Format of the mdevDeviceSpec option:
mdevDeviceSpec::MDEV_SPEC_UUID::MDEV_DEV_NUM
- Example:
mdevDeviceSpec::e2af8f869eff49d2a3d6f86cadc27090::4
- Format of the mdevDeviceSpec option:
- When you create a VM instance in ZStack Cloud,
you can specify the PCI device specification and the device count
allocated from the specification by adding the pciDeviceSpec
option to SystemTags.
- Format of the pciDeviceSpec option:
pciDeviceSpec::PCI_SPEC_UUID::PCI_DEV_NUM
- Example:
pciDeviceSpec::e2af8f869eff49d2a3d6f86cadc27090::4
- Format of the pciDeviceSpec option:
- When you create a VM instance in ZStack Cloud,
you can specify the resource priority by adding the vmPriority
option to SystemTags.
- Format of the vmPriority option:
vmPriority::PRIORITY_LEVEL
. Here, PRIORITY_LEVEL can be Normal or High. - Example:
vmPriority::Normal
- Format of the vmPriority option:
- When you create a VM instance in ZStack Cloud,
the cloud records the version of the GuestTools ISO installed in the VM
instance, compares the ISO version with that of the host, and decides
whether to upgrade the GuestTools ISO. Note that you can add the
GuestTools option to SystemTags.
- Format of the GuestTools option:
GuestTools::TOOLS_VERSION
. Here, the initial value of TOOLS_VERSION is 1.0.0. This value will change as the version of GuestTools is upgraded. - Example:
GuestTools::1.0.0
- Note: When a VM instance is created from an image, if the image has the GuestTools tag, the value of the GuestTools tag will be copied from the image to the new VM instance.
- Format of the GuestTools option:
- When you create a VM instance in ZStack Cloud,
you can set a cross-cluster HA policy by adding the
resourceBindings option to SystemTags.
- Format of the resourceBindings option:
resourceBindings::Cluster:clusterUuid
. Here, clusterUuid is the UUID of the cluster. - Example:
resourceBindings::Cluster:2sdasf231jvznsdak
- Format of the resourceBindings option:
- When you create a VM instance in ZStack Cloud,
you can specify a hostname by adding the hostname option to
SystemTags.
- Format of the hostname option:
hostname::xxxxx
. Here, xxxxx is the hostname. - Example:
hostname::host.zstack.org
- Format of the hostname option:
- When you create a VM instance in ZStack Cloud,
you can enable SR-IOV by adding the enableSRIOV option to
SystemTags.
- Format of the enableSRIOV option:
enableSRIOV::{L3_NETWORK_UUID}
- Example:
enableSRIOV::9e19dafe81c64fed8e34f72e27582339
- Format of the enableSRIOV option:
- When you create a VM instance in ZStack Cloud,
you can use the systemTags parameter to specify whether the VM instance
uses the virtio driver. You can set the value of the
systemTags parameter to driver.
- Format:
driver::virtio
. - Example:
driver::virtio
.
- Format:
- When you create a VM instance in ZStack Cloud,
you can set vNUMA for the VM instance. You can set the value of the
systemTags parameter to vmNumaEnable.
- Format:
vmNumaEnable::boolean
- Example:
vmNumaEnable::true
- Format:
- When you create a VM instance in ZStack Cloud,
you can set EmulatorPin for the VM instance. You can set the value of
the systemTags parameter to vmEmulatorPinning.
- Format:
vmEmulatorPinning::CPU
- Example:
vmEmulatorPinning::1,2,3,4,5,6,7
- Format: