Skip to main content
Resource Center/Resource Pool/VM Instance Operations

CreateVmInstance

CreateVmInstance

POST/zstack/v1/vm-instances

Operation ID

CreateVmInstance

Since

0.6

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

application/json

Body Fields

  • params
    ObjectRequired

    Request body parameter object.

    • name
      StringRequired

      The VM instance name.

    • instanceOfferingUuid
      StringRequired

      The instance offering UUID. Specifies the CPU, memory, and other parameters of the VM instance.

    • imageUuid
      StringRequired

      The image UUID. Specifies the image from which the root volume of the VM instance is created.

    • l3NetworkUuids
      ListRequired

      The L3 network UUID list. You can specify one or more L3 networks. Then the VM instance will create a NIC on each network.

    • type
      String

      Optional. The VM instance type. This parameter is a reserved field for internal use.

    • rootDiskOfferingUuid
      String

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

    • dataDiskSizes
      List

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

    • dataDiskOfferingUuids
      List

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

    • zoneUuid
      String

      Optional. The zone UUID. If specified, the VM instance will be created in the specified zone.

    • clusterUuid
      String

      Optional. The cluster UUID. If specified, the VM instance will be created in the specified cluster. This parameter can override zoneUuid.

    • hostUuid
      String

      Optional. The host UUID. If specified, the VM instance will be created on the specified host. This parameter can override zoneUuid and clusterUuid.

    • primaryStorageUuidForRootVolume
      String

      Optional. The primary storage UUID. If specified, the root volume of the VM instance will be created on the specified primary storage.

    • description
      String

      Optional. The detailed description of the VM instance.

    • defaultL3NetworkUuid
      String

      Optional. The UUID of the default L3 network. If multiple L3 networks are specified in l3NetworkUuids, this parameter specifies the L3 network that provides default routing. If not specified, the first network specified in l3NetworkUuids will be used as the default network.

    • resourceUuid
      String

      Optional. The resource UUID. If specified, the VM instance will use the specified value as UUID.

    • tagUuids
      List

      Optional. The tag UUID list.

    • strategy
      String

      Optional. The VM instance creation strategy. Start the VM instance immediately after creation. Do not start the VM instance after creation.

    • dataVolumeSystemTagsOnIndex
      Map

      Optional. The required system label mapping requited for data volume index.

  • systemTags
    List

    Optional. The system tags of the VM instance.

  • userTags
    List

    Optional. The user tags of the VM instance.

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • error
    ErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • code
      StringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • description
      StringRequired

      The brief description of the error.

    • details
      StringRequired

      The details about the error.

    • elaboration
      StringRequired

      The reserved field. Default value: null.

    • opaque
      LinkedHashMapRequired

      The reserved field. Default value: null.

    • cause
      ErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventory
    VmInstanceInventoryRequired

    See inventory.

    • uuid
      StringRequired

      The resource UUID.

    • name
      StringRequired

      The resource name.

    • description
      StringRequired

      The detailed description of the resource.

    • zoneUuid
      StringRequired

      The zone UUID.

    • clusterUuid
      StringRequired

      The cluster UUID.

    • imageUuid
      StringRequired

      The image UUID.

    • hostUuid
      StringRequired

      The host UUID.

    • lastHostUuid
      StringRequired

      The UUID of the host on which the VM instance was running last time.

    • instanceOfferingUuid
      StringRequired

      The instance offering UUID.

    • rootVolumeUuid
      StringRequired

      The root volume UUID.

    • platform
      StringRequired

      The platform on which the VM instance is running.

    • defaultL3NetworkUuid
      StringRequired

      The UUID of the default L3 network.

    • type
      StringRequired

      The VM instance type.

    • hypervisorType
      StringRequired

      The hypervisor type of the VM instance.

    • memorySize
      LongRequired

      The memory size.

    • cpuNum
      IntegerRequired

      The CPU count.

    • cpuSpeed
      LongRequired

      The CPU speed.

    • allocatorStrategy
      StringRequired

      The allocator strategy.

    • createDate
      TimestampRequired

      The creation date.

    • lastOpDate
      TimestampRequired

      The last operation date.

    • state
      StringRequired

      The state of the VM instance.

    • vmNics
      ListRequired

      See vmNics.

      • uuid
        StringRequired

        The resource UUID.

      • vmInstanceUuid
        StringRequired

        The VM instance UUID.

      • l3NetworkUuid
        StringRequired

        The L3 network UUID.

      • ip
        StringRequired

        The IP address.

      • mac
        StringRequired

        The MAC address.

      • netmask
        StringRequired

        The netmask.

      • gateway
        StringRequired

        The gateway.

      • metaData
        StringRequired

        The reserved field for internal use.

      • deviceId
        IntegerRequired

        The device ID. An integer that indicates the order of NICs in the Ethernet device of the guest operating system. For example, 0 usually means eth0, and 1 usually means eth1.

      • createDate
        TimestampRequired

        The creation date.

      • lastOpDate
        TimestampRequired

        The last operation date.

    • allVolumes
      ListRequired

      See allVolumes.

      • uuid
        StringRequired

        The resource UUID.

      • name
        StringRequired

        The resource name.

      • description
        StringRequired

        The detailed description of the resource.

      • primaryStorageUuid
        StringRequired

        The primary storage UUID.

      • vmInstanceUuid
        StringRequired

        The VM instance UUID.

      • diskOfferingUuid
        StringRequired

        The disk offering UUID.

      • rootImageUuid
        StringRequired

        The UUID of the root volume image.

      • installPath
        StringRequired

        The installation path.

      • type
        StringRequired

        The volume type.

      • format
        StringRequired

        The volume format.

      • size
        LongRequired

        The virtual size of the volume.

      • actualSize
        LongRequired

        The actual size of the volume.

      • deviceId
        IntegerRequired

        The device ID.

      • state
        StringRequired

        The state of the volume.

      • status
        StringRequired

        The status of the volume.

      • createDate
        TimestampRequired

        The creation date.

      • lastOpDate
        TimestampRequired

        The last operation date.

      • isShareable
        BooleanRequired

        Whether the volume can be shared.