Add SAN Storage

POST/zstack/v1/primary-storage/sharedblockgroup

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "diskUuids": [
      "1b5682b663b937a59adb9e318cab6b05"
    ],
    "name": "shared-block-group-1",
    "type": "SharedBlock",
    "zoneUuid": "eee8b39ad50b300c8935e554a967691b"
  },
  "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 POST -d '{"params":{"diskUuids":["1b5682b663b937a59adb9e318cab6b05"],"name":"shared-block-group-1","type":"SharedBlock","zoneUuid":"eee8b39ad50b300c8935e554a967691b"}}' http://localhost:8080/zstack/v1/primary-storage/sharedblockgroup

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
diskUuidsListbody (included in the params structure)Disk unique identifier (e.g. UUID, WWN, WWID) 2.3.2
nameStringbody (included in the params structure)Resource name 2.3.2
description (Optional)Stringbody (included in the params structure)Detailed description of the resource 2.3.2
type (Optional)Stringbody (included in the params structure)Data storage type, which is SharedBlock 2.3.2
urlStringbody (included in the params structure)Unused 2.3.2
zoneUuidStringbody (included in the params structure)Data Center UUID 2.3.2
resourceUuid (Optional)Stringbody (included in the params structure)  2.3.2
systemTags (Optional)Listbody  2.3.2
userTags (Optional)Listbody  2.3.2
  • ZSvirt When adding SAN storage, you can specify the default disk provisioning method by adding primaryStorageVolumeProvisioningStrategy option to SystemTags.
  • Option format: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning
  • Example: primaryStorageVolumeProvisioningStrategy::ThinProvisioning, primaryStorageVolumeProvisioningStrategy::ThickProvisioning

API Response

Response Example

{
  "inventory": {
    "name": "PS1",
    "url": "/Cloud_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "c6e9684e8bb93a9192c946dcd0564b39"
    ]
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.3.2
inventoryPrimaryStorageInventoryFor details, see inventory2.3.2

error

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

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource2.3.2
zoneUuidStringData Center UUID2.3.2
nameStringResource name2.3.2
urlString 2.3.2
descriptionStringDetailed description of the resource2.3.2
totalCapacityLong 2.3.2
availableCapacityLong 2.3.2
totalPhysicalCapacityLong 2.3.2
availablePhysicalCapacityLong 2.3.2
systemUsedCapacityLong 2.3.2
typeString 2.3.2
stateString 2.3.2
statusString 2.3.2
mountPathString 2.3.2
createDateTimestampCreate date2.3.2
lastOpDateTimestampLast update date2.3.2
attachedClusterUuidsList 2.3.2

SDK Examples

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()