Get Storage Migration Candidate List

GET/zstack/v1/vm-instances/{vmInstanceUuid}/storage-migration-candidates

Get the candidate Data Storage list for VM migration across different storage.

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/2ac3852f503a339f857c9381d881bd91/storage-migration-candidates

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmInstanceUuidStringurlVM Instance UUID 3.1.0
withDataVolumes (Optional)booleanbody(contained in the primaryStorageMigrateVm structure)  3.7.0
migrateStorageOnly(Optional)booleanbody(contained in the primaryStorageMigrateVm structure)Whether to migrate storage only 4.4.0
systemTags (Optional)Listquery  3.1.0
userTags (Optional)Listquery  3.1.0

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "19e075320ee9327182fcb82a8b0a078b",
      "name": "PS-1"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error3.1.0
inventoriesListSee inventories3.1.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10013.1.0
descriptionStringBrief description of the error3.1.0
detailsStringDetailed error information3.1.0
elaborationStringReserved field, defaults to null3.1.0
opaqueLinkedHashMapReserved field, defaults to null3.1.0
causeErrorCodeRoot cause, the source error that caused the current error. If there is no original error, this field is null3.1.0

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.1.0
zoneUuidStringData Center UUID3.1.0
nameStringResource Name3.1.0
urlString 3.1.0
descriptionStringResource Description3.1.0
totalCapacityLong 3.1.0
availableCapacityLong 3.1.0
totalPhysicalCapacityLong 3.1.0
availablePhysicalCapacityLong 3.1.0
systemUsedCapacityLong 3.1.0
typeString 3.1.0
stateString 3.1.0
statusString 3.1.0
mountPathString 3.1.0
createDateTimestampCreate Time3.1.0
lastOpDateTimestampLast Modification Time3.1.0
attachedClusterUuidsList 3.1.0

SDK Examples

Java SDK

GetPrimaryStorageCandidatesForVmMigrationAction action = new GetPrimaryStorageCandidatesForVmMigrationAction();
action.vmInstanceUuid = "2ac3852f503a339f857c9381d881bd91";
action.withDataVolumes = true;
action.migrateStorageOnly = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetPrimaryStorageCandidatesForVmMigrationAction.Result res = action.call();

Python SDK

GetPrimaryStorageCandidatesForVmMigrationAction action = GetPrimaryStorageCandidatesForVmMigrationAction()
action.vmInstanceUuid = "2ac3852f503a339f857c9381d881bd91"
action.withDataVolumes = true
action.migrateStorageOnly = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetPrimaryStorageCandidatesForVmMigrationAction.Result res = action.call()