Skip to content

Commit 66e2cdc

Browse files
committed
Added thinProvisioned flag for data disks
1 parent 56ca5bb commit 66e2cdc

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

machine/v1beta1/types_vsphereprovider.go

+26
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,34 @@ type VSphereDisk struct {
198198
// +kubebuilder:validation:Maximum=16384
199199
// +required
200200
SizeGiB int32 `json:"sizeGiB"`
201+
// provisioningMode is an optional field that specifies the provisioning type to be used by this vSphere data disk.
202+
// Allowed values are "Thin", "Thick", "EagerlyZeroed", and omitted.
203+
// When set to Thin, the disk will be made using thin provisioning allocating the bare minimum space.
204+
// When set to Thick, the full disk size will be allocated when disk is created.
205+
// When set to EagerlyZeroed, the disk will be created using eager zero provisioning. An eager zeroed thick disk has all space allocated and wiped clean of any previous contents on the physical media at creation time. Such disks may take longer time during creation compared to other disk formats.
206+
// When omitted, no setting will be applied to the data disk and the provisioning mode for the disk will be provided by the default storage policy.
207+
// +optional
208+
ProvisioningMode ProvisioningMode `json:"provisioningMode,omitempty"`
201209
}
202210

211+
// provisioningMode represents the various provisioning types available to a VMs disk.
212+
// +kubebuilder:validation:Enum=Thin;Thick;EagerlyZeroed
213+
type ProvisioningMode string
214+
215+
const (
216+
// ProvisioningModeThin creates the disk using thin provisioning. This means a sparse (allocate on demand)
217+
// format with additional space optimizations.
218+
ProvisioningModeThin ProvisioningMode = "Thin"
219+
220+
// ProvisioningModeThick creates the disk with all space allocated.
221+
ProvisioningModeThick ProvisioningMode = "Thick"
222+
223+
// ProvisioningModeEagerlyZeroed creates the disk using eager zero provisioning. An eager zeroed thick disk
224+
// has all space allocated and wiped clean of any previous contents on the physical media at
225+
// creation time. Such disks may take longer time during creation compared to other disk formats.
226+
ProvisioningModeEagerlyZeroed ProvisioningMode = "EagerlyZeroed"
227+
)
228+
203229
// WorkspaceConfig defines a workspace configuration for the vSphere cloud
204230
// provider.
205231
type Workspace struct {

machine/v1beta1/zz_generated.swagger_doc_generated.go

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/generated_openapi/zz_generated.openapi.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

+4
Original file line numberDiff line numberDiff line change
@@ -22524,6 +22524,10 @@
2252422524
"type": "string",
2252522525
"default": ""
2252622526
},
22527+
"provisioningMode": {
22528+
"description": "provisioningMode is an optional field that specifies the provisioning type to be used by this vSphere data disk. Allowed values are \"Thin\", \"Thick\", \"EagerlyZeroed\", and omitted. When set to Thin, the disk will be made using thin provisioning allocating the bare minimum space. When set to Thick, the full disk size will be allocated when disk is created. When set to EagerlyZeroed, the disk will be created using eager zero provisioning. An eager zeroed thick disk has all space allocated and wiped clean of any previous contents on the physical media at creation time. Such disks may take longer time during creation compared to other disk formats. When omitted, no setting will be applied to the data disk and the provisioning mode for the disk will be provided by the default storage policy.",
22529+
"type": "string"
22530+
},
2252722531
"sizeGiB": {
2252822532
"description": "sizeGiB is the size of the disk in GiB. The maximum supported size 16384 GiB.",
2252922533
"type": "integer",

0 commit comments

Comments
 (0)