Migrate Disk on Local Storage

PUT/zstack/v1/primary-storage/local-storage/volumes/{volumeUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "localStorageMigrateVolume": {
    "destHostUuid": "511e02b9b8c9427c9fbbac55b8c7ec62"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Examples

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"localStorageMigrateVolume":{"destHostUuid":"58118467f70733cdb19f39bd07868384"}}' \
http://localhost:8080/zstack/v1/primary-storage/local-storage/volumes/f15736d2850536f3a6ea1d68f7c89b7f/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
volumeUuidStringurlDisk UUID 0.6
destHostUuidStringbody (nested in localStorageMigrateVolume structure)Destination Host UUID 0.6
systemTags (optional)ListbodySystem tags 0.6
userTags (optional)ListbodyUser tags 0.6

API Response

Response Example

{
  "inventory": {
    "resourceUuid": "bad5e950cf014275bf9ba6e4cfe78a97",
    "primaryStorageUuid": "81d893539a6b4ce7b9957c7a5d6c5df8",
    "hostUuid": "9d250b88ae90449db567cfa18a75fecc",
    "size": 24035328.0
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error0.6
inventoryLocalStorageResourceRefInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier for the error, such as SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that triggered the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
resourceUuidString 0.6
primaryStorageUuidStringData Storage UUID0.6
hostUuidStringHost UUID0.6
sizeLong 0.6
resourceTypeString 0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

LocalStorageMigrateVolumeAction action = new LocalStorageMigrateVolumeAction();
action.volumeUuid = "1d4825d4845c4bba81033de367f0a03c";
action.destHostUuid = "e82e6f37aa3b472ab36b32962b2ba44c";
action.sessionId = "74b8b0a565c542e8bc146d7d9c06c764";
LocalStorageMigrateVolumeAction.Result res = action.call();

Python SDK

LocalStorageMigrateVolumeAction action = LocalStorageMigrateVolumeAction()
action.volumeUuid = "85f9e2cb4d2640b3a5fe4ec74ebccd22"
action.destHostUuid = "f841732d6c604d12bf2cbbb458f09bee"
action.sessionId = "535bc181a3aa41a0989ac795f58ba664"
LocalStorageMigrateVolumeAction.Result res = action.call()