Add Distributed Storage
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"monUrls": [
"root:password@localhost/?monPort=7777"
],
"rootVolumePoolName": "zs-images",
"dataVolumePoolName": "zs-data-volume",
"imageCachePoolName": "zs-image-cache",
"name": "My Ceph Primary Storage",
"zoneUuid": "d42197a462c34a44989bdf38d5aa2424"
},
"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 POST -d '{"params":{"monUrls":["root:password@localhost/?monPort=7777"],"rootVolumePoolName":"zs-images","dataVolumePoolName":"zs-data-volume","imageCachePoolName":"zs-image-cache","name":"My Ceph Primary Storage","zoneUuid":"251a3dffccaf39fc8d190eedcf4395bf"}}' \
http://localhost:8080/zstack/v1/primary-storage/cephParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| monUrls | List | body (nested in params structure) | List of distributed storage mon addresses | 0.6 | |
| rootVolumePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Root Volume | 0.6 | |
| dataVolumePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Data Volume | 0.6 | |
| imageCachePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Image Cache | 0.6 | |
| url | String | body (nested in params structure) | Not used | 0.6 | |
| name | String | body (nested in params structure) | Name of the distributed storage | 0.6 | |
| description (optional) | String | body (nested in params structure) | Detailed description of the distributed storage | 0.6 | |
| type (optional) | String | body (nested in params structure) | Type of distributed storage, which is Ceph | 0.6 | |
| zoneUuid | String | body (nested in params structure) | Data Center UUID | 0.6 | |
| resourceUuid (optional) | String | body (nested in params structure) | Resource UUID. If specified, the distributed storage will use this value as its UUID. | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
- ZSvirt When adding distributed storage, you can identify the type as xsky, sandstone, or open-source by adding the manufacturer option to SystemTags.
- Option format:
ceph::manufacturer::Platform - For example:
ceph::manufacturer::xsky - ZSvirt When adding distributed storage, you can identify the type as xsky and support the SDK for xsky type distributed storage by adding the thirdPartyPlatform option to SystemTags.
- Option format:
ceph::thirdPartyPlatform::TOKEN - For example:
ceph::thirdPartyPlatform::68b329da9893e34099c7d8ad5cb9c940
- Option format:
API Response
Response Example
{
"inventory": {
"name": "Ceph-1",
"url": "not used",
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"2d8583d86bd1472e8ec0e04e26ea273f"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | PrimaryStorageInventory | For details, see inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | 0.6 | |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | 0.6 | |
| availableCapacity | Long | 0.6 | |
| totalPhysicalCapacity | Long | 0.6 | |
| availablePhysicalCapacity | Long | 0.6 | |
| systemUsedCapacity | Long | 0.6 | |
| type | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| mountPath | String | 0.6 | |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | 0.6 |
SDK Examples
Java SDK
AddCephPrimaryStorageAction action = new AddCephPrimaryStorageAction();
action.monUrls = asList("root:password@localhost/?monPort=7777");
action.rootVolumePoolName = "zs-images";
action.dataVolumePoolName = "zs-data-volume";
action.imageCachePoolName = "zs-image-cache";
action.name = "My Ceph Primary Storage";
action.zoneUuid = "88b49879acd34e11afa5bb3ea9164d5a";
action.sessionId = "33a01ee65ac64450940359dc3181f9b1";
AddCephPrimaryStorageAction.Result res = action.call();Python SDK
AddCephPrimaryStorageAction action = AddCephPrimaryStorageAction()
action.monUrls = [root:password@localhost/?monPort=7777]
action.rootVolumePoolName = "zs-images"
action.dataVolumePoolName = "zs-data-volume"
action.imageCachePoolName = "zs-image-cache"
action.name = "My Ceph Primary Storage"
action.zoneUuid = "0f05052514554462b437f9cfa272f57f"
action.sessionId = "cb3d5ecb63634ca093ea223c55e6a30a"
AddCephPrimaryStorageAction.Result res = action.call()