Table of contents
- Disk Offering
A disk offering is a specification of a volume, which defines a volume’s size and how it will be created. Disk offerings can be used to create both root volumes and data volumes.
There is no API to create a root volume; but if you provision a VM with an ISO image, you need to specify a disk offering that defines size and allocator strategy for the VM’s root volume, which is the only way that creates a root volume from a disk offering.
|uuid||see Resource Properties||0.6|
|name||see Resource Properties||0.6|
|description||see Resource Properties||true||0.6|
|diskSize||the size of volume in bytes, see disk size||0.6|
|allocatorStrategy||see allocator strategy||
|createDate||see Resource Properties||0.6|
|lastOpDate||see Resource Properties||0.6|
DiskSize defines a volume’s virtual size. As mentioned in volume, virtual size is the max size a volume can occupy in storage system after it is fully filled. Putting in a straight way, it’s the size you want for the volume.
Disk offerings have two states:
The state that allows volumes to be created from this disk offering
The state that DOESN’T allow volumes to be created from this disk offering
Allocator strategy defines how ZStack selects a primary storage when creating a new volume. Currently the only supported strategy is DefaultPrimaryStorageAllocationStrategy that finds a primary storage satisfying conditions:
1. state is Enabled 2. status is Connected 3. availableCapacity is greater than disk offering's diskSize 4. has been attached to the cluster that runs the VM to which the volume will be attached
A volume created from a disk offering is only instantiated on primary storage when it’s being attached to a VM. See volume status NotInstantiated.
Users can use CreateDiskOffering create a disk offering. For example:
CreateDiskOffering name=small diskSize=1073741824
|name||resource name, see Resource Properties||0.6|
|resourceUuid||resource uuid, see Create Resources||true||0.6|
|description||resource description, see Resource Properties||true||0.6|
|diskSize||disk size in bytes, see size||0.6|
|allocationStrategy||see allocator strategy||true||
|type||reserved filed, leave it alone||true||0.6|
Users can use ChangeDiskOfferingState to change the state of a disk offering. For example:
ChangeDiskOfferingState uuid=178c662bfcdd4145920682c58ebcbed4 stateEvent=enable
Users can use DeleteDiskOffering to delete a disk offering. For example:
Users can use QueryDiskOffering to query disk offerings. For example: