Migrate Volume Across Data Storage

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "primaryStorageMigrateVolume": {
    "dstPrimaryStorageUuid": "aafceb95938e42a6be5475f19a92eec9"
  },
  "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 Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"primaryStorageMigrateVolume":{"dstPrimaryStorageUuid":"ed4370b338da37d8a537bfb738e736f2"}}' \
http://localhost:8080/zstack/v1/primary-storage/volumes/b6e9b22601f7319fadd329d065b0cd1b/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
volumeUuidStringurlVolume UUID 2.2
dstPrimaryStorageUuidStringbody(contained in the primaryStorageMigrateVolume structure)Destination Data Storage UUID 2.2
systemTags (Optional)ListbodySystem Tags 2.2
userTags (Optional)ListbodyUser Tags 2.2

API Response

Response Example

{
  "inventory": {
    "uuid": "5fa2d1c7adcd4963b1f9016075764fcb",
    "name": "test-volume",
    "primaryStorageUuid": "6ebc0be6faaa41f28874daa6076322bd",
    "vmInstanceUuid": "2c528326ddcf43dd9bdd1d80da7a15ef",
    "diskOfferingUuid": "2af3082d23444be9833c32c53ea2b1ed",
    "rootImageUuid": "254bdaf01a33407082d8afe540b76796",
    "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5fa2d1c7adcd4963b1f9016075764fcb/5fa2d1c7adcd4963b1f9016075764fcb.qcow2",
    "type": "Root",
    "format": "qcow2",
    "size": 107374182400.0,
    "actualSize": 21474836480.0,
    "deviceId": 0.0,
    "state": "Enabled",
    "status": "Ready",
    "createDate": "Oct 26, 2017 3:38:58 PM",
    "lastOpDate": "Oct 26, 2017 3:38:58 PM"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error2.2
inventoryVolumeInventorySee inventory2.2

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10012.2
descriptionStringBrief description of the error2.2
detailsStringDetailed error information2.2
elaborationStringReserved field, defaults to null2.2
opaqueLinkedHashMapReserved field, defaults to null2.2
causeErrorCodeRoot cause, the source error that caused the current error. If there is no original error, this field is null2.2

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource2.2
nameStringResource Name2.2
descriptionStringResource Description2.2
primaryStorageUuidStringData Storage UUID2.2
vmInstanceUuidStringVM Instance UUID2.2
diskOfferingUuidStringDisk Offering UUID2.2
rootImageUuidString 2.2
installPathString 2.2
typeString 2.2
formatString 2.2
sizeLong 2.2
actualSizeLong 2.2
deviceIdInteger 2.2
stateString 2.2
statusString 2.2
createDateTimestampCreate Time2.2
lastOpDateTimestampLast Modification Time2.2
isShareableBoolean 2.2

SDK Examples

Java SDK

PrimaryStorageMigrateVolumeAction action = new PrimaryStorageMigrateVolumeAction();
action.volumeUuid = "af5d94f0f24c45f79280fc4661919b2c";
action.dstPrimaryStorageUuid = "e8d756d48e5d48a69f5bec6221ddbc79";
action.sessionId = "c186caf64d0043158b2c5ea9784697ab";
PrimaryStorageMigrateVolumeAction.Result res = action.call();

Python SDK

PrimaryStorageMigrateVolumeAction action = PrimaryStorageMigrateVolumeAction()
action.volumeUuid = "7e170d744c014517b3b38f20111f400d"
action.dstPrimaryStorageUuid = "8c2cc857b81d4d75b404809e57e02deb"
action.sessionId = "ec12693efdf14d72b2a59de9c039870a"
PrimaryStorageMigrateVolumeAction.Result res = action.call()