Disk Offering
Overview
A disk offering is a specification of a volume, which defines the size of a volume and how the volume will be created.
Disk offerings can be used to create both root volumes and data volumes.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| diskSize | The disk size. Unit: byte. For more information, see Disk Size. | 0.6 | ||
| state | The state. For more information, see State. |
|
0.6 | |
| type | The reserved field. |
|
0.6 | |
| allocatorStrategy | The allocator strategy. For more information, see Allocator Strategy. |
|
0.6 | |
| sortKey | 0.6 | |||
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 |
Sample
{
"inventories": [
{
"allocatorStrategy": "DefaultPrimaryStorageAllocationStrategy",
"createDate": "Oct 30, 2017 3:09:45 PM",
"description": "",
"diskSize": 10737418240,
"lastOpDate": "Oct 30, 2017 3:09:45 PM",
"name": "10G",
"sortKey": 0,
"state": "Enabled",
"type": "DefaultDiskOfferingType",
"uuid": "6c2385bb60f84c269504ca6ea71fe2d1"
}
],
"success": true
}
Disk Size
DiskSize defines the virtual size of a volume. Virtual size is the size that a volume claims for. In other word, the virtual size is the maximum size that a volume can occupy in storage system after it is fully filled.
State
- Enabled:
Indicates that volumes can be created from this disk offering.
- Disabled:
Indicates that volumes cannot be created from this disk offering.
Allocator Strategy
1. The state is Enabled. 2. The status is Connected. 3. The available capacity (availableCapacity) is greater than the disk size (diskSize) of the disk offering. 4. The primary storage is attached to the cluster that runs the VM instance to which the volume will be attached.
Operations
CreateDiskOffering
CreateDiskOffering name=test diskSize=100Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The disk offering name. | 0.6 | ||
| description | The detailed description of the disk offering. | Yes | 0.6 | |
| diskSize | The volume size. | 0.6 | ||
| allocatorStrategy | The allocator strategy. | Yes |
|
0.6 |
| sortKey | The sort key. | Yes | 0.6 | |
| type | The type. | Yes | 0.6 | |
| resourceUuid | The resource UUID. If specified, the image will use the specified value as UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| timeout | Yes |
Note:
- When you create a disk offering in ZStack Cloud,
you can customize the disk offering parameters by adding the
diskOfferingUserConfig option to SystemTags.
- Format of the diskOfferingUserConfig option:
diskOfferingUserConfig::xxx. Here, xxx must be a JSON string.For example, to specify multiple primary storage for a disk offering, you can use diskOfferingUserConfig::{ "allocate": { "primaryStorages":[ { "type":"Enter a primary storage type", "uuid":"Enter a primary storage UUID" }, { "type":"Enter a primary storage type", "uuid":"Enter a primary storage UUID" }, { "type":"Enter a primary storage type", "uuid":"Enter a primary storage UUID" } ] } }
- Format of the diskOfferingUserConfig option:
DeleteDiskOffering
DeleteDiskOffering uuid=84c05965795140439e86592d2fa1c965Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The disk offering UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| timeout | Yes |
QueryDiskOffering
QueryDiskOffering diskSize>=10000000QueryDiskOffering volume.name=data1Primitive Fields of Query
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| volume | Volume Inventory | The volumes that are created from this disk offering. | 0.6 |
ChangeDiskOfferingState
ChangeDiskOfferingState uuid=c9dd395cb5f04f4ba9eb1e62b886fe62 stateEvent=enableParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The disk offering UUID. | 0.6 | ||
| stateEvent | The state event. |
|
0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| timeout | Yes |
UpdateDiskOffering
UpdateDiskOffering uuid=c9dd395cb5f04f4ba9eb1e62b886fe62 name=testParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The disk offering UUID. | 0.6 | ||
| name | The disk offering name. | Yes | 0.6 | |
| description | The detailed description of the disk offering. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is DiskOfferingVO. | Yes | 0.6 | |
| timeout | Yes |
Tags
CreateUserTag tag=smallDisk resourceType=DiskOfferingVO \
resourceUuid=d6c49e73927d40abbfcf13852dc18367System Tags
Dedicated Primary Storage
When you create a volume from disk offering, you can use a system tag to specify the primary storage on which the volume will be created.
| Tag | Description | Example | Starting Version |
|---|---|---|---|
| primaryStorage::allocator::uuid::{uuid} | If this tag exists, the volume created from the disk offering will be allocated on the primary storage with the specified UUID. If the specified primary storage does not exist, or if the specified primary storage does not have sufficient capacity, an allocation failure will be reported. | primaryStorage::allocator::uuid::b8398e8b7ff24527a3b81dc4bc64d974 | 0.6 |
| primaryStorage::allocator::userTag::{tag}::required | If this tag exists, the volume created from the disk offering will be allocated on the primary storage with the specified user tag. If the primary storage with specified user tag does not exist, or if the specified primary storage does not have sufficient capacity, an allocation failure will be reported. | primaryStorage::allocator::userTag::SSD::required | 0.6 |
| primaryStorage::allocator::userTag::{tag} | If this tag exists, the volume created from the disk offering will be allocated on the primary storage with the specified user tag. If the primary storage with specified user tag does not exist, or if the specified primary storage does not have sufficient capacity, ZStack Cloud will choose a random primary storage to allocate the volume. | primaryStorage::allocator::userTag::SSD | 0.6 |
primaryStorage::allocator::uuid::{uuid} > primaryStorage::allocator::userTag::{tag}::required > \
primaryStorage::allocator::userTag::{tag}