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

vSphere: support for VM Groups #1847

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

ahmedwaleedmalik
Copy link
Member

What this PR does / why we need it:
This PR adds support for adding VMs to pre-defined VM groups. This is useful for VM placement as host rules can be created for VM groups in vSphere.

Which issue(s) this PR fixes:

Fixes #1846

What type of PR is this?

/kind feature

Special notes for your reviewer:

Does this PR introduce a user-facing change? Then add your Release Note here:

vSphere: Support for assigning VMs to VM groups. 

Documentation:

NONE

@ahmedwaleedmalik ahmedwaleedmalik self-assigned this Aug 26, 2024
@kubermatic-bot kubermatic-bot added docs/none Denotes a PR that doesn't need documentation (changes). release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 2024
Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
@ahmedwaleedmalik
Copy link
Member Author

ahmedwaleedmalik commented Aug 26, 2024

vSphere tests are supposed to be fixed in #1844. So we'll need to override them in this PR so that I can continue with the implementation in KKP and dashboard.

W0826 09:40:02.963074 27521 verify.go:157] Creation of "rhel-1-29-8-vs-1828002467011366912" failed, retrying: admission webhook "machinedeployments.machine-controller.kubermatic.io" denied the request: validation failed: failed to get folder "/Hamburg/vm/Kubermatic-ci": folder '/Hamburg/vm/Kubermatic-ci' not found

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
@mohamed-rafraf
Copy link
Member

/approve
/lgtm

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2024
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1a7546c882ef3e0282d81c7f3d329b065b66a144

@xrstf
Copy link
Contributor

xrstf commented Aug 26, 2024

/override pull-machine-controller-e2e-vsphere

@kubermatic-bot
Copy link
Contributor

@xrstf: Overrode contexts on behalf of xrstf: pull-machine-controller-e2e-vsphere

In response to this:

/override pull-machine-controller-e2e-vsphere

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-sigs/prow repository.

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

Some nits, feel free to leave for a follow up if you think it's needed.

return fmt.Errorf("cluster is required for vm group")
}

if config.Cluster != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way that we validate the VMGroup exist?

Comment on lines +320 to +324
if config.VMAntiAffinity && config.Cluster == "" {
return fmt.Errorf("cluster is required for vm anti affinity")
} else if config.VMGroup != "" && config.Cluster == "" {
return fmt.Errorf("cluster is required for vm group")
}
Copy link
Member

Choose a reason for hiding this comment

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

What if both VMAntiAffinity and VMGroup are set, is that supported?

},
}

log.Debugf("Adding VM %s in VM group %s", machine.Name, config.VMGroup)
Copy link
Member

Choose a reason for hiding this comment

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

Technically if something went wrong on vSphere side, this could result in adding multiple VMs to the group at the same time. We should eventually improve logging to reflect that edge case.

@xrstf
Copy link
Contributor

xrstf commented Aug 26, 2024

/approve

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2024
@xrstf
Copy link
Contributor

xrstf commented Aug 26, 2024

/hold for comments

@kubermatic-bot kubermatic-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2024
@ahmedwaleedmalik
Copy link
Member Author

/approve

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik, mohamed-rafraf, xrstf

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:
  • OWNERS [ahmedwaleedmalik,xrstf]

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

@ahmedwaleedmalik
Copy link
Member Author

/unhold

@kubermatic-bot kubermatic-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 26, 2024
@kubermatic-bot kubermatic-bot merged commit 3ead298 into kubermatic:main Aug 26, 2024
14 checks passed
@ahmedwaleedmalik ahmedwaleedmalik deleted the vsphere-vmgroup branch August 26, 2024 11:17
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 Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/feature Categorizes issue or PR as related to a new feature. 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. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vSphere: Support for VM Groups
5 participants