Skip to content

Commit 2eac068

Browse files
committed
Added thinProvisioned flag for data disks
1 parent 56ca5bb commit 2eac068

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

machine/v1beta1/types_vsphereprovider.go

+22
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,30 @@ type VSphereDisk struct {
198198
// +kubebuilder:validation:Maximum=16384
199199
// +required
200200
SizeGiB int32 `json:"sizeGiB"`
201+
// provisioningMode specifies the provisioning type to be used by this vSphere data disk.
202+
// If not set, the setting will be provided by the default storage policy.
203+
// +optional
204+
ProvisioningMode ProvisioningMode `json:"provisioningMode,omitempty"`
201205
}
202206

207+
// provisioningMode represents the various provisioning types available to a VMs disk.
208+
// +kubebuilder:validation:Enum=Thin;Thick;EagerlyZeroed
209+
type ProvisioningMode string
210+
211+
var (
212+
// ThinProvisioningMode creates the disk using thin provisioning. This means a sparse (allocate on demand)
213+
// format with additional space optimizations.
214+
ThinProvisioningMode ProvisioningMode = "Thin"
215+
216+
// ThickProvisioningMode creates the disk with all space allocated.
217+
ThickProvisioningMode ProvisioningMode = "Thick"
218+
219+
// EagerlyZeroedProvisioningMode creates the disk using eager zero provisioning. An eager zeroed thick disk
220+
// has all space allocated and wiped clean of any previous contents on the physical media at
221+
// creation time. Such disks may take longer time during creation compared to other disk formats.
222+
EagerlyZeroedProvisioningMode ProvisioningMode = "EagerlyZeroed"
223+
)
224+
203225
// WorkspaceConfig defines a workspace configuration for the vSphere cloud
204226
// provider.
205227
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 specifies the provisioning type to be used by this vSphere data disk. If not set, the setting 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)