Skip to main content
Resource Center/Resource Pool/VM Instance Operations
PUTVM Instance OperationsSince 0.6SynchronousAuth Required

UpdateVmInstance

UpdateVmInstance

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    The VM instance UUID.

Body Fields

  • updatevminstanceObjectRequired

    updatevminstance request body object.

    • nameString

      Optional. The VM instance name.

    • descriptionString

      Optional. The detailed description of the VM instance.

    • stateString

      Optional. The state of the VM instance. Generally, the state of a VM instance cannot be updated directly. Otherwise, ZStack Cloud might misjudge the state of the VM instance. This parameter can be used only when the actual state of the VM instance is inconsistent with the state recorded by ZStack Cloud, and the synchronization mechanism of ZStack Cloud has expired (which is us usually a bug). The administrator must fully understand the consequences of using this parameter.

    • defaultL3NetworkUuidString

      Optional. The UUID of the default L3 network.

    • platformString

      Optional. The platform type of the VM instance.

    • cpuNumInteger

      Optional. The CPU count of the VM instance. You must stop or enable the VM instance for the setting of this parameter to take effect. The VM instance that is created when NUMA is set to true in global settings can be adjusted.

    • memorySizeLong

      Optional. The memory size of the VM instance. You must stop or enable the VM instance for the setting of this parameter to take effect. The VM instance that is created when NUMA is set to true in global settings can be adjusted.

    • guestOsTypeString

      Optional.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

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

    • codeStringRequired

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

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

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

  • inventoryVmInstanceInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • zoneUuidStringRequired

      The zone UUID.

    • clusterUuidStringRequired

      The cluster UUID.

    • imageUuidStringRequired

      The image UUID.

    • hostUuidStringRequired

      The host UUID.

    • lastHostUuidStringRequired

      最近一次主机UUID。

    • instanceOfferingUuidStringRequired

      The instance offering UUID.

    • rootVolumeUuidStringRequired

      The root volume UUID.

    • platformStringRequired

      平台。

    • defaultL3NetworkUuidStringRequired

      No description provided.

    • typeStringRequired

      类型。

    • hypervisorTypeStringRequired

      No description provided.

    • memorySizeLongRequired

      内存大小。

    • cpuNumIntegerRequired

      No description provided.

    • cpuSpeedLongRequired

      No description provided.

    • allocatorStrategyStringRequired

      No description provided.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

    • stateStringRequired

      当前状态。

    • vmNicsListRequired

      See vmNics.

      • uuidStringRequired

        The resource UUID.

      • vmInstanceUuidStringRequired

        The VM instance UUID.

      • l3NetworkUuidStringRequired

        The L3 network UUID.

      • ipStringRequired

        IP地址

      • macStringRequired

        MAC地址

      • hypervisorTypeStringRequired

        The hypervisor type.

      • netmaskStringRequired

        The netmask.

      • gatewayStringRequired

        The gateway.

      • metaDataStringRequired

        元数据。

      • ipVersionIntegerRequired

        The IP version.

      • deviceIdIntegerRequired

        设备ID

      • createDateTimestampRequired

        The creation date.

      • lastOpDateTimestampRequired

        The last operation date.

      • usedIpsListRequired

        See usedIps.

        • uuidStringRequired

          The resource UUID.

        • ipRangeUuidStringRequired

          The IP range UUID.

        • l3NetworkUuidStringRequired

          The L3 network UUID.

        • ipVersionIntegerRequired

          The IP version.

        • ipStringRequired

          The IP address.

        • netmaskStringRequired

          The netmask.

        • gatewayStringRequired

          The gateway.

        • usedForStringRequired

          已使用用于。

        • ipInLonglongRequired

          No description provided.

        • vmNicUuidStringRequired

          The VM NIC UUID.

        • createDateTimestampRequired

          The creation date.

        • lastOpDateTimestampRequired

          The last operation date.

    • allVolumesListRequired

      See allVolumes.

      • uuidStringRequired

        The resource UUID.

      • nameStringRequired

        The resource name.

      • descriptionStringRequired

        The detailed description of the resource.

      • primaryStorageUuidStringRequired

        The primary storage UUID.

      • vmInstanceUuidStringRequired

        The VM instance UUID.

      • diskOfferingUuidStringRequired

        The disk offering UUID.

      • rootImageUuidStringRequired

        The root volume image UUID.

      • installPathStringRequired

        The installation path of the volume on the primary storage.

      • typeStringRequired

        The volume type.

      • formatStringRequired

        The volume format.

      • sizeLongRequired

        The volume size.

      • actualSizeLongRequired

        The actual size of the volume.

      • deviceIdIntegerRequired

        设备ID。

      • stateStringRequired

        Indicates whether the volume is enabled.

      • statusStringRequired

        Th status of the volume.

      • createDateTimestampRequired

        The creation date.

      • lastOpDateTimestampRequired

        The last operation date.

      • isShareableBooleanRequired

        是否可分享。

Endpoint

PUT/zstack/v1/vm-instances/{uuid}/actions

/zstack/v1/vm-instances/{uuid}/actions

Operation ID

UpdateVmInstance

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/vm-instances/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"updatevminstance":{"name":"<name>","description":"<description>","state":"<state>","defaultL3NetworkUuid":"<defaultL3NetworkUuid>","platform":"<platform>","cpuNum":1,"memorySize":1,"guestOsType":"<guestOsType>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "6710cdffb0653455809b6511a6b3aaa4", "name": "new vm name", "description": "web server VM", "zoneUuid": "aa63c5a3b3c436fa94e5e851f057fe23", "clusterUuid": "48b424d94ed239f1b18e1ce37db24cf8", "imageUuid": "4e1ac550da8d30c7b07162acc39773c1", "hostUuid": "1f3ffea4673e3e4197681ee030d1794b", "lastHostUuid": "d334dadb7cfc34da8f6f7d74dfd04692", "instanceOfferingUuid": "33b38aff5cbe3e24a9266300f7163d20", "rootVolumeUuid": "761df8e1eef933ee8d7f3b7f8551b754", "platform": "Linux", "defaultL3NetworkUuid": "3a3c91f4a28a31beb410d6d1c3dc862c", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8.589934592E9, "cpuNum": 1.0, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "ae19167e24713aeea9c45e6f2d27249d", "vmInstanceUuid": "6710cdffb0653455809b6511a6b3aaa4", "usedIpUuid": "010f4817011b32d3b476faa3f393d765", "l3NetworkUuid": "3a3c91f4a28a31beb410d6d1c3dc862c", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0.0, "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "761df8e1eef933ee8d7f3b7f8551b754", "name": "Root-Volume-For-VM-6710cdffb0653455809b6511a6b3aaa4", "primaryStorageUuid": "da81ed018a9738ff97a16d7b7a43327d", "vmInstanceUuid": "6710cdffb0653455809b6511a6b3aaa4", "diskOfferingUuid": "bd9b406d36c13fc7ad3f995535415898", "rootImageUuid": "4e1ac550da8d30c7b07162acc39773c1", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-761df8e1eef933ee8d7f3b7f8551b754/761df8e1eef933ee8d7f3b7f8551b754.qcow2", "type": "Root", "format": "qcow2", "size": 1.073741824E11, "actualSize": 2.147483648E10, "deviceId": 0.0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }

Change History

This API has no change history records yet.

View all change history