PrimaryStorageMigrateVolume
Data Storage Migrate Disk
API Request
URLs
PUT zstack/v1/primary-storage/volumes/{volumeUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In the preceding example, the
{
"primaryStorageMigrateVolume": {
"dstPrimaryStorageUuid": "ed4370b338da37d8a537bfb738e736f2"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are shown 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
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| volumeUuid | String | url | Disk UUID | 2.2 | |
| dstPrimaryStorageUuid | String | body (included in the primaryStorageMigrateVolume structure) |
Destination Data Storage UUID | 2.2 | |
| systemTags (Optional) | List | body | System tags | 2.2 | |
| userTags (Optional) | List | body | User tags | 2.2 |
API Response
Response Example
{
"inventory": {
"uuid": "93e582fd69593a1fbfbf5b81d795b176",
"name": "test-volume",
"primaryStorageUuid": "65c9477fa7a13170b65b6e9240009717",
"vmInstanceUuid": "ea66572977b234febe41b65a2efb5e00",
"diskOfferingUuid": "5e2d7175f9b1334a806d7217c28fc62e",
"rootImageUuid": "25a4f9644fba3734a984f3b1933f1e29",
"installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-93e582fd69593a1fbfbf5b81d795b176/93e582fd69593a1fbfbf5b81d795b176.qcow2",
"type": "Root",
"format": "qcow2",
"size": 107374182400,
"actualSize": 21474836480,
"deviceId": 0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | Error code. If this field is not null, the operation failed. This field is null when the operation succeeds. For details, see error | 2.2 |
| inventory | VolumeInventory | For details, see inventory | 2.2 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, which globally and uniquely identifies the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Summary description of the error | 0.6 |
| details | String | Details of the error | 0.6 |
| elaboration | String | Reserved field. The default value is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. The default value is null | 0.6 |
| cause | ErrorCode | Root error that caused the current error. This field is null if there is no source error | 0.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, which uniquely identifies the resource | 3.17.13 |
| name | String | Resource name | 3.17.13 |
| description | String | Detailed resource description | 3.17.13 |
| primaryStorageUuid | String | Data Storage UUID | 3.17.13 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.17.13 |
| diskOfferingUuid | String | Disk Offering UUID | 3.17.13 |
| rootImageUuid | String | The root image UUID. | 3.17.13 |
| installPath | String | The installation path. | 3.17.13 |
| type | String | The resource type. | 3.17.13 |
| format | String | The format. | 3.17.13 |
| size | Long | The size. | 3.17.13 |
| actualSize | Long | The actual size. | 3.17.13 |
| deviceId | Integer | The device ID. | 3.17.13 |
| state | String | The resource state. | 3.17.13 |
| status | String | The resource status. | 3.17.13 |
| createDate | Timestamp | Creation time | 3.17.13 |
| lastOpDate | Timestamp | Last modification time | 3.17.13 |
| isShareable | Boolean | Whether the resource is shareable. | 3.17.13 |
| volumeQos | String | The volume QoS. | 3.17.13 |
| lastDetachDate | Timestamp | The last detach date. | 3.17.13 |
| lastVmInstanceUuid | String | The last VM instance UUID. | 3.17.13 |
| encrypted | Boolean | Whether the resource is encrypted. | 5.1.0 |
SDK Examples
Java SDK
PrimaryStorageMigrateVolumeAction action = new PrimaryStorageMigrateVolumeAction();
action.volumeUuid = "b6e9b22601f7319fadd329d065b0cd1b";
action.dstPrimaryStorageUuid = "ed4370b338da37d8a537bfb738e736f2";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PrimaryStorageMigrateVolumeAction.Result res = action.call();
Python SDK
action = PrimaryStorageMigrateVolumeAction()
action.volumeUuid = "b6e9b22601f7319fadd329d065b0cd1b"
action.dstPrimaryStorageUuid = "ed4370b338da37d8a537bfb738e736f2"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
