Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Adds minimum hardware version to VirtualMachine CRD #205

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

srm09
Copy link
Contributor

@srm09 srm09 commented Aug 18, 2023

What does this PR do, and why is it needed?

Introduces a new field on the VirtualMachine CRD which allows the user to define the minimum hardware version for the provisioned VM. The behavior of the field is as follows:

  • If the VMClassAsConfig FSS is enabled, this new field will override the hardware version derived from the VMClass's ConfigSpec if that value is lower than the minimum version field. Otherwise, the value from the ConfigSpec is honored.

Which issue(s) is/are addressed by this PR? :
Fixes #151

Are there any special notes for your reviewer:
Testing performed:

  • VM with min hardware version = 14 and VMClass h/w version = 13, resulting VM version = 14
  • VM with min hardware version = 15 and VMClass h/w version = 16, resulting VM version = 16
  • VM with no min hardware version and VMClass h/w version = 17, resulting VM version = 17
  • VM with no min hardware version and no VMClass version, resulting VM version = 21 (host default)

Please add a release note if necessary:

✨Adds minimum hardware version to VirtualMachine CRD

@github-actions github-actions bot added testing-needed-e2e-fast size/L Denotes a PR that changes 100-499 lines. labels Aug 18, 2023
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch 2 times, most recently from 9df30a3 to 12ee8d3 Compare August 18, 2023 17:35
@srm09 srm09 changed the title ✨ Adds minimum hardware version to VirtualMachine CRD [WIP] ✨ Adds minimum hardware version to VirtualMachine CRD Aug 19, 2023
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch from 12ee8d3 to a3b84e7 Compare August 21, 2023 14:18
@srm09 srm09 added testing-done-e2e-fast Indicates the fast, low-cost e2e testing has been used to validate a PR and removed testing-needed-e2e-fast labels Aug 22, 2023
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch 2 times, most recently from 4f599f0 to fa1d625 Compare September 18, 2023 17:49
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch from fa1d625 to 5faeb07 Compare September 22, 2023 00:04
@srm09
Copy link
Contributor Author

srm09 commented Sep 28, 2023

Waiting on the v1a2 work to be brought to a stable state before introducing more API changes, work has been completed for now.

@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch 2 times, most recently from ef1ce0e to 2c8463e Compare November 1, 2023 22:53
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch from 2c8463e to 0ad01d5 Compare November 9, 2023 00:25
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch from 0ad01d5 to cbcfcee Compare November 13, 2023 18:29
Introduces a new field on the VirtualMachine CRD which allows the user
to define the minimum hardware version for the provisioned VM.
The behavior of the field is as follows:
- If the VMClassAsConfig FSS is enabled, it will override the hardware version
  derived from the VMClass's ConfigSpec if it is lower than the minimum version
  field. Otherwise, the value from the ConfigSpec is honored.
- If the VMClassAsConfig FSS is disabled, it will reconfigure the VM post
  creation before the power on operation to ensure that the h/w version is
  atleast set to the minimum version. This means, it can override the hardware
  version of the OVA with a hardware version value lower than this field.

Signed-off-by: Sagar Muchhal <[email protected]>
@srm09 srm09 force-pushed the vm-api-change/add-min-hw-version branch from cbcfcee to 1853fb5 Compare November 13, 2023 18:38
Copy link

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha1/clustercontentlibraryitem 83%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha1/contentlibraryitem 82%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha1/contentsource 83%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha1/utils 95%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/clustercontentlibraryitem 86%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/contentlibraryitem 85%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/v1alpha2/utils 91%
github.com/vmware-tanzu/vm-operator/controllers/infracluster 75%
github.com/vmware-tanzu/vm-operator/controllers/infraprovider 75%
github.com/vmware-tanzu/vm-operator/controllers/providerconfigmap 74%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/util/remote 41%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/v1alpha1 45%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/v1alpha2 70%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass/v1alpha1 31%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass/v1alpha2 71%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha1 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest/v1alpha2 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha1 82%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha1/providers 96%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha1/providers/simplelb 66%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha1/utils 84%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2 84%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/providers 96%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/providers/simplelb 66%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/v1alpha2/utils 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy/v1alpha1 80%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy/v1alpha2 80%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 74%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2 72%
github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha1 87%
github.com/vmware-tanzu/vm-operator/controllers/volume/v1alpha2 86%
github.com/vmware-tanzu/vm-operator/pkg/builder 73%
github.com/vmware-tanzu/vm-operator/pkg/conditions 90%
github.com/vmware-tanzu/vm-operator/pkg/conditions2 90%
github.com/vmware-tanzu/vm-operator/pkg/context 0%
github.com/vmware-tanzu/vm-operator/pkg/context/fake 100%
github.com/vmware-tanzu/vm-operator/pkg/lib 87%
github.com/vmware-tanzu/vm-operator/pkg/manager 78%
github.com/vmware-tanzu/vm-operator/pkg/metrics 89%
github.com/vmware-tanzu/vm-operator/pkg/metrics2 85%
github.com/vmware-tanzu/vm-operator/pkg/patch 78%
github.com/vmware-tanzu/vm-operator/pkg/patch2 78%
github.com/vmware-tanzu/vm-operator/pkg/prober 92%
github.com/vmware-tanzu/vm-operator/pkg/prober/context 100%
github.com/vmware-tanzu/vm-operator/pkg/prober/fake 85%
github.com/vmware-tanzu/vm-operator/pkg/prober/fake/probe 83%
github.com/vmware-tanzu/vm-operator/pkg/prober/fake/worker 88%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 83%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 86%
github.com/vmware-tanzu/vm-operator/pkg/prober2 94%
github.com/vmware-tanzu/vm-operator/pkg/prober2/context 100%
github.com/vmware-tanzu/vm-operator/pkg/prober2/fake 85%
github.com/vmware-tanzu/vm-operator/pkg/prober2/fake/probe 83%
github.com/vmware-tanzu/vm-operator/pkg/prober2/fake/worker 89%
github.com/vmware-tanzu/vm-operator/pkg/prober2/probe 89%
github.com/vmware-tanzu/vm-operator/pkg/prober2/worker 85%
github.com/vmware-tanzu/vm-operator/pkg/record 89%
github.com/vmware-tanzu/vm-operator/pkg/topology 85%
github.com/vmware-tanzu/vm-operator/pkg/util 85%
github.com/vmware-tanzu/vm-operator/pkg/util/kube 89%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 74%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/fake 76%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere 71%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/client 74%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/clustermodules 85%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/config 85%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/contentlibrary 71%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/instancestorage 92%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/internal 0%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/network 88%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/placement 83%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/resources 47%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/session 84%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/storage 77%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/test 98%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/vcenter 80%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere/virtualmachine 83%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2 70%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/client 49%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/clustermodules 85%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/config 70%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/contentlibrary 50%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/instancestorage 75%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/internal 0%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/network 81%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/placement 70%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/resources 38%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/session 83%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/storage 77%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/test 98%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vcenter 80%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/virtualmachine 83%
github.com/vmware-tanzu/vm-operator/pkg/vmprovider/providers/vsphere2/vmlifecycle 78%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 53%
github.com/vmware-tanzu/vm-operator/webhooks/common 100%
github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha1/mutation 81%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha1/validation 94%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/mutation 79%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2/validation 96%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha1/mutation 59%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha1/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/mutation 59%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/v1alpha2/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/v1alpha2/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha1/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha1/validation 91%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/v1alpha2/validation 91%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha1/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha1/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/v1alpha2/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation 92%
Summary 79% (11693 / 14734)

Minimum allowed line rate is 60%

Copy link
Contributor

@sreyasn sreyasn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, Sagar. Looks good.

@srm09 srm09 merged commit e951730 into vmware-tanzu:main Nov 14, 2023
14 of 15 checks passed
@srm09 srm09 deleted the vm-api-change/add-min-hw-version branch November 14, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required size/L Denotes a PR that changes 100-499 lines. testing-done-e2e-fast Indicates the fast, low-cost e2e testing has been used to validate a PR testing-needed-e2e-fast
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose hardware version configuration on VirtualMachine resource
4 participants