Skip to content

Commit d34e1a1

Browse files
committed
Updated vsphere multi disk enhancement.
1 parent fc1a0f8 commit d34e1a1

File tree

1 file changed

+59
-12
lines changed

1 file changed

+59
-12
lines changed

Diff for: enhancements/machine-api/vsphere-data-disk.md

+59-12
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ compute:
110110
dataDisks:
111111
- diskSizeGiB: 10
112112
name: "container_images"
113+
provisioningMode: "Thin"
113114
- diskSizeGiB: 20
114115
name: "log files"
116+
provisioningMode: "Thick"
115117
- diskSizeGiB: 30
116118
name: "swap"
119+
provisioningMode: "EagerlyZeroed"
117120
replicas: 0
118121
controlPlane:
119122
architecture: amd64
@@ -131,13 +134,15 @@ controlPlane:
131134
dataDisks:
132135
- diskSizeGiB: 10
133136
name: "etcd"
137+
provisioningMode: "Thick"
134138
- diskSizeGiB: 20
135139
name: "container-images"
140+
provisioningMode: "Thin"
136141
replicas: 3
137142
...
138143
```
139144

140-
In the example above, we have added a new field `dataDisks` that is used to define each of the disks to create for the virtual machine. The `name` field is used to identify the disk. This is used primarily for debug and for identifying the disk definition. The `diskSizeGiB` field specifies how large the disk needs to be.
145+
In the example above, we have added a new field `dataDisks` that is used to define each of the disks to create for the virtual machine. The `name` field is used to identify the disk. This is used primarily for debug and for identifying the disk definition. The `diskSizeGiB` field specifies how large the disk needs to be. The `provisioningMode` field specifies how the disk should be provisioned. This field supports the values of "Thin", "Thick", and "EagerlyZeroed"
141146

142147
#### API
143148

@@ -156,15 +161,48 @@ type VSphereMachineProviderSpec struct {
156161

157162
// VSphereDisk describes additional disks for vSphere.
158163
type VSphereDisk struct {
159-
// name is a name to be used to identify the disk definition. If name is not specified,
160-
// the disk will still be created. The name should be unique so that it can be used to clearly
161-
// identify purpose of the disk, but is not required to be unique.
162-
// +optional
164+
// name is used to identify the disk definition. name is required needs to be unique so that it can be used to
165+
// clearly identify purpose of the disk.
166+
// It must be at most 80 characters in length and must consist only of alphanumeric characters, hyphens and underscores,
167+
// and must start and end with an alphanumeric character.
168+
// +kubebuilder:example=images_1
169+
// +kubebuilder:validation:MaxLength=80
170+
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?$"
171+
// +required
163172
Name string `json:"name,omitempty"`
164-
// sizeGiB is the size of the disk (in GiB).
165-
// +kubebuilder:validation:Required
173+
// sizeGiB is the size of the disk in GiB.
174+
// The maximum supported size 16384 GiB.
175+
// +kubebuilder:validation:Minimum=1
176+
// +kubebuilder:validation:Maximum=16384
177+
// +required
166178
SizeGiB int32 `json:"sizeGiB"`
179+
// provisioningMode is an optional field that specifies the provisioning type to be used by this vSphere data disk.
180+
// Allowed values are "Thin", "Thick", "EagerlyZeroed", and omitted.
181+
// When set to Thin, the disk will be made using thin provisioning allocating the bare minimum space.
182+
// When set to Thick, the full disk size will be allocated when disk is created.
183+
// 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.
184+
// When omitted, no setting will be applied to the data disk and the provisioning mode for the disk will be determined by the storage policy attached to the datastore.
185+
// +optional
186+
ProvisioningMode ProvisioningMode `json:"provisioningMode,omitempty"`
167187
}
188+
189+
// provisioningMode represents the various provisioning types available to a VMs disk.
190+
// +kubebuilder:validation:Enum=Thin;Thick;EagerlyZeroed
191+
type ProvisioningMode string
192+
193+
const (
194+
// ProvisioningModeThin creates the disk using thin provisioning. This means a sparse (allocate on demand)
195+
// format with additional space optimizations.
196+
ProvisioningModeThin ProvisioningMode = "Thin"
197+
198+
// ProvisioningModeThick creates the disk with all space allocated.
199+
ProvisioningModeThick ProvisioningMode = "Thick"
200+
201+
// ProvisioningModeEagerlyZeroed creates the disk using eager zero provisioning. An eager zeroed thick disk
202+
// has all space allocated and wiped clean of any previous contents on the physical media at
203+
// creation time. Such disks may take longer time during creation compared to other disk formats.
204+
ProvisioningModeEagerlyZeroed ProvisioningMode = "EagerlyZeroed"
205+
)
168206
```
169207

170208
Examples of the various CRs using the above type enhancement:
@@ -217,8 +255,10 @@ spec:
217255
dataDisks:
218256
- diskSizeGiB: 10
219257
name: "etcd"
258+
provisioningMode: "Thick"
220259
- diskSizeGiB: 20
221260
name: "container-images"
261+
provisioningMode: "Thin"
222262
diskGiB: 100
223263
kind: VSphereMachineProviderSpec
224264
memoryMiB: 16384
@@ -278,8 +318,10 @@ spec:
278318
dataDisks:
279319
- diskSizeGiB: 10
280320
name: "etcd"
321+
provisioningMode: "Thick"
281322
- diskSizeGiB: 20
282323
name: "container-images"
324+
provisioningMode: "Thin"
283325
diskGiB: 100
284326
kind: VSphereMachineProviderSpec
285327
memoryMiB: 16384
@@ -342,10 +384,13 @@ spec:
342384
dataDisks:
343385
- diskSizeGiB: 10
344386
name: "container_images"
387+
provisioningMode: "Thin"
345388
- diskSizeGiB: 20
346389
name: "log files"
390+
provisioningMode: "Thick"
347391
- diskSizeGiB: 30
348392
name: "swap"
393+
provisioningMode: "EagerlyZeroed"
349394
diskGiB: 60
350395
kind: VSphereMachineProviderSpec
351396
memoryMiB: 8192
@@ -384,11 +429,11 @@ N/A
384429
385430
### Implementation Details/Notes/Constraints
386431
387-
What are some important details that didn't come across above in the
388-
**Proposal**? Go in to as much detail as necessary here. This might be
389-
a good place to talk about core concepts and how they relate. While it is useful
390-
to go into the details of the code changes required, it is not necessary to show
391-
how the code will be rewritten in the enhancement.
432+
Many of the choices made above were based on how CAPV implemented the feature. This was to make sure we keep these APIs in sync with CAPI so that we can migrate our existing infrastructure to CAPI implementation in the future.
433+
434+
The installer is responsible for initially setting up the cluster with the data disks configurations for the control plane nodes. The installer is preconfiguring a machineset for compute nodes as well but can be modified in day 2+. The installer is also leveraging CAPI to install the control plane VMs. We have updated installer to use latest version of CAPV to get access to the upstream changes for this feature. The CPMS definition also has been enhanced to allow the CPMS operator to monitor changes in the disk configs.
435+
436+
The data disk configs are allowing the administrator to configure each data disk individually for provisioning mode. The installer today via the install-config.yaml does allow the administrator to set the provisioning mode used on the template's clone process. This configuration setting will also be used by govmomi / vCenter when creating the VMs data disks if the data disk config has omitted the provisioning mode field.
392437
393438
### Risks and Mitigations
394439
@@ -402,6 +447,8 @@ N/A
402447
403448
> 1. Are there any other disk configuration options that we must add in order for this feature to be GA ready? Is keeping it simple w/ just size enough for GA or just TP?
404449
450+
Update: Added ability to set provisioning mode for each disk has been added to address allowing admins to set each disk specifically for their needs.
451+
405452
## Test Plan
406453
407454
- We will add an automated test to CI to test installing a cluster with data disks assigned to both control plane and compute nodes.

0 commit comments

Comments
 (0)