AddSharedBlockGroupPrimaryStorage
API Request
URLs
POST zstack/v1/primary-storage/sharedblockgroup
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"diskUuids": [
"1b5682b663b937a59adb9e318cab6b05"
],
"name": "shared-block-group-1",
"type": "SharedBlock",
"zoneUuid": "eee8b39ad50b300c8935e554a967691b"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"diskUuids":["1b5682b663b937a59adb9e318cab6b05"],"name":"shared-block-group-1","type":"SharedBlock","zoneUuid":"eee8b39ad50b300c8935e554a967691b"}}' http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup
Request Parameters
Note:
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
diskUuids | List | body (contained in the params structure) | The unique identifier of the disk. For example, UUID, WWN, and WWID. | 2.3.2 | |
name | String | body (contained in the params structure) | The resource name. | 2.3.2 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 2.3.2 | |
type | String | body (contained in the params structure) | Optional. The primary storage type: SharedBlock. | 2.3.2 | |
url | String | body (contained in the params structure) | The reserved field. | 2.3.2 | |
zoneUuid | String | body (contained in the params structure) | The zone UUID. | 2.3.2 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 2.3.2 | |
systemTags | List | body | Optional. The system tags. | 2.3.2 | |
userTags | List | body | Optional. The user tags. | 2.3.2 |

- When you add a Shared Block primary storage in ZStack, you
can specify the default volume provisioning strategy by adding the
primaryStorageVolumeProvisioningStrategy option to
SystemTags.
- Format of the primaryStorageVolumeProvisioningStrategy
option:
primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning
- Example:
primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning
- Format of the primaryStorageVolumeProvisioningStrategy
option:
API Response
Sample
Response
{
"inventory": {
"name": "PS1",
"url": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"c6e9684e8bb93a9192c946dcd0564b39"
]
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3.2 |
inventory | PrimaryStorageInventory | Seeinventory. | 2.3.2 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.3.2 |
description | String | The brief description of the error. | 2.3.2 |
details | String | The details about the error. | 2.3.2 |
elaboration | String | The reserved field. Default value: null. | 2.3.2 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3.2 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3.2 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 2.3.2 |
zoneUuid | String | The zone UUID. | 2.3.2 |
name | String | The resource name. | 2.3.2 |
url | String | 2.3.2 | |
description | String | The detailed description of the resource. | 2.3.2 |
totalCapacity | Long | 2.3.2 | |
availableCapacity | Long | 2.3.2 | |
totalPhysicalCapacity | Long | 2.3.2 | |
availablePhysicalCapacity | Long | 2.3.2 | |
systemUsedCapacity | Long | 2.3.2 | |
type | String | 2.3.2 | |
state | String | 2.3.2 | |
status | String | 2.3.2 | |
mountPath | String | 2.3.2 | |
createDate | Timestamp | The creation date. | 2.3.2 |
lastOpDate | Timestamp | The last operation date. | 2.3.2 |
attachedClusterUuids | List | 2.3.2 |
SDK Sample
Java
SDK
AddSharedBlockGroupPrimaryStorageAction action = new AddSharedBlockGroupPrimaryStorageAction();
action.diskUuids = asList("1b5682b663b937a59adb9e318cab6b05");
action.name = "shared-block-group-1";
action.type = "SharedBlock";
action.zoneUuid = "eee8b39ad50b300c8935e554a967691b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSharedBlockGroupPrimaryStorageAction.Result res = action.call();
Python
SDK
AddSharedBlockGroupPrimaryStorageAction action = AddSharedBlockGroupPrimaryStorageAction()
action.diskUuids = [1b5682b663b937a59adb9e318cab6b05]
action.name = "shared-block-group-1"
action.type = "SharedBlock"
action.zoneUuid = "eee8b39ad50b300c8935e554a967691b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSharedBlockGroupPrimaryStorageAction.Result res = action.call()