Document navigation

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.
  • Enabled
  • Disabled
0.6
type The reserved field.
  • zstack
0.6
allocatorStrategy The allocator strategy. For more information, see Allocator Strategy.
  • DefaultHostAllocatorStrategy
  • LastHostPreferredAllocatorStrategy
  • LeastVmPreferredHostAllocatorStrategy
  • MinimumCPUUsageHostAllocatorStrategy
  • MinimumMemoryUsageHostAllocatorStrategy
  • MaxInstancePerHostHostAllocatorStrategy
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

A disk offering has the following two states:
  • Enabled:

    Indicates that volumes can be created from this disk offering.

  • Disabled:

    Indicates that volumes cannot be created from this disk offering.

Allocator Strategy

Allocator strategy defines how ZStack Cloud selects a primary storage when creating a new volume. Currently, the only supported strategy is DefaultPrimaryStorageAllocationStrategy, which finds a primary storage according to the following conditions:
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

Creates a disk offering. For example,
CreateDiskOffering name=test diskSize=100

Parameters

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
  • DefaultHostAllocatorStrategy
  • LastHostPreferredAllocatorStrategy
  • LeastVmPreferredHostAllocatorStrategy
  • MinimumCPUUsageHostAllocatorStrategy
  • MinimumMemoryUsageHostAllocatorStrategy
  • MaxInstancePerHostHostAllocatorStrategy
  • LeastVolumePrimaryStorageAllocationStrategy
  • MaximumAvailableCapacityAllocationStrategy
  • CustomOrderPrimaryStorageAllocationStrategy
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"
                  }
              ]
          }
      
      }

DeleteDiskOffering

Deletes a disk offering. For example,
DeleteDiskOffering uuid=84c05965795140439e86592d2fa1c965

Parameters

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
  • Permissive
  • Enforcing
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

Queries a disk offering. For example,
QueryDiskOffering diskSize>=10000000
QueryDiskOffering volume.name=data1

Primitive Fields of Query

See Instance Offering Inventory.

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

Changes the state of a disk offering. For example,
ChangeDiskOfferingState uuid=c9dd395cb5f04f4ba9eb1e62b886fe62 stateEvent=enable

Parameters

Name Description Optional Valid Value Starting Version
uuid The disk offering UUID. 0.6
stateEvent The state event.
  • enable
  • disable
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

Updates a disk offering. For example,
UpdateDiskOffering uuid=c9dd395cb5f04f4ba9eb1e62b886fe62 name=test

Parameters

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

You can create a user tag on a disk offering by using resourceType=DiskOfferingVO. For example,
CreateUserTag tag=smallDisk resourceType=DiskOfferingVO \
resourceUuid=d6c49e73927d40abbfcf13852dc18367

System 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
If more than one system tag mentioned above exists on a disk offering, the precedent order is as follows:
primaryStorage::allocator::uuid::{uuid} > primaryStorage::allocator::userTag::{tag}::required > \
primaryStorage::allocator::userTag::{tag}
CLI Command Manual | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center