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

Introduce virtualMachineOptions to hco cr #2356

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

fossedihelm
Copy link
Contributor

@fossedihelm fossedihelm commented May 30, 2023

What this PR does / why we need it:
VirtualMachineOptions holds the cluster level information regarding the virtual machine. This defines the default behavior of some features related to the virtual machines.

  • DisableFreePageReporting With freePageReporting the guest OS informs the hypervisor about pages which are not in use by the guest anymore. The hypervisor can use this information for freeing these pages.

    freePageReporting is an attribute that can be defined at Memory balloon device
    in libvirt. freePageReporting will NOT be enabled for the vmis which does not have the Memballoon driver, OR which are requesting any high performance components. A vmi is considered as high performance if one of the following is true:

    • the vmi requests a dedicated cpu.
    • the realtime flag is enabled.
    • the vmi requests hugepages.

    With DisableFreePageReporting freePageReporting will never be enabled in any vmi.
    DisableFreePageReporting is a boolean and freePageReporting is disabled by default.

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Jira Ticket:

https://issues.redhat.com/browse/CNV-29040

Release note:

Introduce cluster level virtualMachineOptions field.

@kubevirt-bot kubevirt-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels May 30, 2023
@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

1 similar comment
@openshift-ci
Copy link

openshift-ci bot commented May 30, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels May 30, 2023
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 31, 2023
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 7, 2023
@kubevirt-bot kubevirt-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 7, 2023
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 3, 2023
@fossedihelm
Copy link
Contributor Author

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.27

@openshift-ci
Copy link

openshift-ci bot commented Jul 3, 2023

@fossedihelm: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test ci-index-hco-bundle
  • /test ci-index-hco-upgrade-bundle
  • /test ci-index-hco-upgrade-prev-bundle
  • /test hco-e2e-kv-smoke-azure
  • /test hco-e2e-kv-smoke-gcp
  • /test hco-e2e-operator-sdk-aws
  • /test hco-e2e-operator-sdk-azure
  • /test hco-e2e-operator-sdk-gcp
  • /test hco-e2e-upgrade-index-aws
  • /test hco-e2e-upgrade-index-azure
  • /test hco-e2e-upgrade-prev-index-aws
  • /test hco-e2e-upgrade-prev-index-azure
  • /test images
  • /test okd-ci-index-hco-bundle
  • /test okd-ci-index-hco-upgrade-bundle
  • /test okd-ci-index-hco-upgrade-prev-bundle
  • /test okd-hco-e2e-operator-sdk-aws
  • /test okd-hco-e2e-operator-sdk-gcp
  • /test okd-hco-e2e-upgrade-index-aws
  • /test okd-hco-e2e-upgrade-index-gcp
  • /test okd-images

The following commands are available to trigger optional jobs:

  • /test hco-e2e-operator-sdk-sno-aws
  • /test hco-e2e-operator-sdk-sno-azure
  • /test hco-e2e-upgrade-index-sno-aws
  • /test hco-e2e-upgrade-index-sno-azure
  • /test hco-e2e-upgrade-prev-index-sno-aws
  • /test hco-e2e-upgrade-prev-index-sno-azure

Use /test all to run all jobs.

In response to this:

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.27

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fossedihelm fossedihelm marked this pull request as ready for review July 3, 2023 09:45
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2023
@fossedihelm
Copy link
Contributor Author

/unhold

@coveralls
Copy link
Collaborator

coveralls commented Jul 3, 2023

Pull Request Test Coverage Report for Build 5464448074

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 86.173%

Totals Coverage Status
Change from base Build 5457040060: 0.02%
Covered Lines: 5042
Relevant Lines: 5851

💛 - Coveralls

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2023
@fossedihelm
Copy link
Contributor Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jul 5, 2023

@fossedihelm: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test ci-index-hco-bundle
  • /test ci-index-hco-upgrade-bundle
  • /test ci-index-hco-upgrade-prev-bundle
  • /test hco-e2e-kv-smoke-azure
  • /test hco-e2e-kv-smoke-gcp
  • /test hco-e2e-operator-sdk-aws
  • /test hco-e2e-operator-sdk-azure
  • /test hco-e2e-operator-sdk-gcp
  • /test hco-e2e-upgrade-index-aws
  • /test hco-e2e-upgrade-index-azure
  • /test hco-e2e-upgrade-prev-index-aws
  • /test hco-e2e-upgrade-prev-index-azure
  • /test images
  • /test okd-ci-index-hco-bundle
  • /test okd-ci-index-hco-upgrade-bundle
  • /test okd-ci-index-hco-upgrade-prev-bundle
  • /test okd-hco-e2e-operator-sdk-aws
  • /test okd-hco-e2e-operator-sdk-gcp
  • /test okd-hco-e2e-upgrade-index-aws
  • /test okd-hco-e2e-upgrade-index-gcp
  • /test okd-images

The following commands are available to trigger optional jobs:

  • /test hco-e2e-operator-sdk-sno-aws
  • /test hco-e2e-operator-sdk-sno-azure
  • /test hco-e2e-upgrade-index-sno-aws
  • /test hco-e2e-upgrade-index-sno-azure
  • /test hco-e2e-upgrade-prev-index-sno-aws
  • /test hco-e2e-upgrade-prev-index-sno-azure

Use /test all to run all jobs.

In response to this:

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.27

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fossedihelm fossedihelm marked this pull request as ready for review July 5, 2023 07:07
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 5, 2023
Copy link
Collaborator

@nunnatsa nunnatsa 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 the PR, @fossedihelm.

Added some inline comments.

api/v1beta1/hyperconverged_types.go Outdated Show resolved Hide resolved
api/v1beta1/hyperconverged_types.go Show resolved Hide resolved
controllers/operands/kubevirt_test.go Show resolved Hide resolved
controllers/operands/kubevirt_test.go Show resolved Hide resolved
controllers/operands/kubevirt_test.go Outdated Show resolved Hide resolved
docs/cluster-configuration.md Outdated Show resolved Hide resolved
g.Expect(hc.Spec.VirtualMachineOptions).Should(Equal(defaultVirtualMachineOptions), "virtualMachineOptions should be equal to default")
}).WithTimeout(2 * time.Second).WithPolling(100 * time.Millisecond).Should(Succeed())
},
Entry("when removing /spec/virtualMachineOptions", "/spec/virtualMachineOptions"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe also add Entry("when removing /spec/virtualMachineOptions", "/spec/virtualMachineOptions/disableFreePageReporting") ?

Comment on lines +444 to +447
if hc.Spec.VirtualMachineOptions != nil && hc.Spec.VirtualMachineOptions.DisableFreePageReporting {
config.VirtualMachineOptions = &kubevirtcorev1.VirtualMachineOptions{DisableFreePageReporting: &kubevirtcorev1.DisableFreePageReporting{}}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

We got a code smell here. The getKVConfig is too complex. Please consider to somehow refactor this function.

Not Blocking!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have some ideas, do you agree on addressing this with a followup PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes. Either that or we'll take it.

@fossedihelm fossedihelm force-pushed the disable_freepagereporting branch 2 times, most recently from 31816fe to 4a4fea3 Compare July 5, 2023 10:26
VirtualMachineOptions holds the cluster level information regarding the virtual machine.
This defines the default behavior of some features related to the virtual machines.
- `DisableFreePageReporting`
  With freePageReporting the guest OS informs the hypervisor about pages which are not
in use by the guest anymore. The hypervisor can use this information for freeing these pages.

  freePageReporting is an attribute that can be defined at [Memory balloon device](https://libvirt.org/formatdomain.html#memory-balloon-device)
in libvirt. freePageReporting will NOT be enabled for the vmis which does not have the Memballoon driver,
OR which are requesting any high performance components. A vmi is considered as high performance if one of the following is true:
  - the vmi requests a dedicated cpu.
  - the realtime flag is enabled.
  - the vmi requests hugepages.

  With `DisableFreePageReporting` freePageReporting will never be enabled in any vmi.
`DisableFreePageReporting` is an empty struct and freePageReporting is disabled by default.

Signed-off-by: fossedihelm <ffossemo@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2023
@fossedihelm
Copy link
Contributor Author

/retest

@fossedihelm
Copy link
Contributor Author

/unhold

@openshift-ci
Copy link

openshift-ci bot commented Jul 6, 2023

@fossedihelm: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-upgrade-prev-index-sno-aws 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link false /test hco-e2e-upgrade-prev-index-sno-aws
ci/prow/hco-e2e-upgrade-index-sno-aws 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link false /test hco-e2e-upgrade-index-sno-aws
ci/prow/hco-e2e-upgrade-prev-index-aws 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link true /test hco-e2e-upgrade-prev-index-aws
ci/prow/hco-e2e-upgrade-index-aws 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link true /test hco-e2e-upgrade-index-aws
ci/prow/hco-e2e-upgrade-index-azure 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link true /test hco-e2e-upgrade-index-azure
ci/prow/hco-e2e-upgrade-prev-index-azure 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link true /test hco-e2e-upgrade-prev-index-azure
ci/prow/hco-e2e-upgrade-index-sno-azure 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link false /test hco-e2e-upgrade-index-sno-azure
ci/prow/hco-e2e-upgrade-prev-index-sno-azure 5e80f0ddba4b753d8e51fdba3224ba09452d4432 link false /test hco-e2e-upgrade-prev-index-sno-azure
ci/prow/okd-hco-e2e-upgrade-index-aws 083a214 link true /test okd-hco-e2e-upgrade-index-aws
ci/prow/hco-e2e-kv-smoke-azure 083a214 link true /test hco-e2e-kv-smoke-azure

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@fossedihelm
Copy link
Contributor Author

/hold cancel

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 6, 2023
@tiraboschi
Copy link
Member

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@tiraboschi: Overrode contexts on behalf of tiraboschi: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiraboschi
Copy link
Member

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiraboschi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2023
@tiraboschi
Copy link
Member

/retest

@kubevirt-bot kubevirt-bot merged commit a3414f3 into kubevirt:main Jul 7, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants