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
SRIOV migration based hotplug #10185
Conversation
Skipping CI for Draft Pull Request. |
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
22d2de4
to
e227d20
Compare
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
e227d20
to
6dbd1fc
Compare
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
/retest |
1 similar comment
/retest |
/test pull-kubevirt-e2e-kind-1.27-sriov |
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
6dbd1fc
to
1c752bc
Compare
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
1c752bc
to
a17920f
Compare
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
a17920f
to
318e625
Compare
/test pull-kubevirt-e2e-k8s-1.26-sig-network-multus-v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think we are still missing a test (see inline) and the commit messages still need fixing (subject line is too long).
But I will not block the change on those, feel free to remove the hold.
/hold
nil, | ||
nil, | ||
expectNoChange, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking for "expectToChange" + new SR-IOV not added.
I do not think we have it.
vmi.Namespace, vmi.Spec.Domain.Devices.Interfaces, vmi.Spec.Networks, pod)).To(HaveOccurred()) | ||
}) | ||
}) | ||
|
||
Context("hotplug operation", func() { | ||
Context("pod status update", func() { | ||
const mac1 = "abc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure how it is related to the code changes done here, but I will not dig into it further.
If an SRIOV interface is added to the spec of a running VM, don't update the pod multus annotation with this interface. To configure SRIOV on the pod, device plugin has to be invovled. Kubelet invokes the device plugin of pod startup only. Therefore, there is no point in adding the SRIOV interface to the multus annotation at this point. It should be added only on migration to the new target pod multus annotation. Signed-off-by: Alona Paz <alkaplan@redhat.com>
The vmi network and interfaces spec may contain interface that are not plugged to the pod yet and therefore not reported in the multus status annotation. Those interfaces should be ignored when building the "kubevirt.io/network-pci-map" annotation. Signed-off-by: Alona Paz <alkaplan@redhat.com>
If there are SRIOV interfaces in the spec that are not in the domain (plug pending)-> SRIOV hotplug is invoked. This commit changes the code to invoke the SRIOV hotplug only if those plug pending interfaces are reported in the multus annotation. If they are not reported by the multus annotation it means the pod cannot use the VF yet. Signed-off-by: Alona Paz <alkaplan@redhat.com>
A preparation step for hotplug_sriov test file to be added. Signed-off-by: Alona Paz <alkaplan@redhat.com>
8eab2db
to
a21ebd4
Compare
a21ebd4
to
87993a4
Compare
Signed-off-by: Alona Paz <alkaplan@redhat.com>
87993a4
to
560e4cb
Compare
mac, err := GenerateRandomMac() | ||
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since addSRIOVInterface
used only in one place, also MAC address has no actual affect on the hotplug logic isn't it?
sriovIfaceNotPlugged := iface.SRIOV != nil && !ifaceInStatus | ||
return !sriovIfaceNotPlugged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the intermediate variable doesn't help understanding what will be the result, the reader still need to interpret what !sriovIfaceNotPlugged
means.
How about using the direct condition with better descriptive name?
nonSriovDesiredIfaces := iface.SRIOV == nil || ifaceInStatus
return nonSriovDesiredIfaces
We can address it later though.
pkg/virt-controller/watch/network.go
Outdated
@@ -24,23 +24,29 @@ import ( | |||
"kubevirt.io/kubevirt/pkg/network/vmispec" | |||
) | |||
|
|||
func calculateDynamicInterfaces(vmi *v1.VirtualMachineInstance) ([]v1.Interface, []v1.Network, bool) { | |||
vmiSpecIfaces := vmispec.FilterInterfacesSpec(vmi.Spec.Domain.Devices.Interfaces, func(iface v1.Interface) bool { | |||
func calculateInterfacesAndNetworksForMultusAnnotation(vmi *v1.VirtualMachineInstance) ([]v1.Interface, []v1.Network, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So its basicly set the desired interfaces in the VMI hence in the pod.
I would call it somthing like calcuclateDesiredInterfaces
or calcuclateDesiredPodInterfaces
.
We can address this later and improve the naming around that area.
/approve Increasing 2 lgtms to approve. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlonaKaplan 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 |
/unhold |
/retest |
/retest-required |
1 similar comment
/retest-required |
PR kubevirt#10185 introduced the SR-IOV migration-based hotplug with an E2E test that fails [1] in case the `HotplugNICs` feature gate is disabled. The CI system of kubevirt/kubevirtci, has an SR-IOV lane that deploys a cluster and runs the conformance test mechanism with a focus on SR-IOV tests[2] without enabling the `HotplugNICs` feature gate. This causes the pre-submit jobs in kubevirt/kubevirtci to fail[3], and requires a maintainer override in order to merge PRs. As an immediate fix, skip the SR-IOV migration based hotplug tests if the `HotplugNICs` feature gate is disabled. The kubevirt/kubevirt tests will not be affected by this change. A more permanent fix will follow. [1] https://github.com/kubevirt/kubevirt/blob/cb29e9f87d41deae0d9e1efa6b0cde53ecd8c28a/tests/network/hotplug_sriov.go#L52 [2] https://github.com/kubevirt/project-infra/blob/88e8dbd315a7bc908f637ebe3168f1fe7da97839/github/ci/prow-deploy/files/jobs/kubevirt/kubevirtci/kubevirtci-presubmits.yaml#L53 [3] https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirtci/1070/check-up-kind-1.27-sriov/1691706923780411392 Signed-off-by: Orel Misan <omisan@redhat.com>
PR kubevirt#10185 introduced the SR-IOV migration-based hotplug with an E2E test that fails [1] in case the `HotplugNICs` feature gate is disabled. The CI system of kubevirt/kubevirtci, has an SR-IOV lane that deploys a cluster and runs the conformance test mechanism with a focus on SR-IOV tests[2] without enabling the `HotplugNICs` feature gate. This causes the pre-submit jobs in kubevirt/kubevirtci to fail[3], and requires a maintainer override in order to merge PRs. As an immediate fix, skip the SR-IOV migration based hotplug tests if the `HotplugNICs` feature gate is disabled. The kubevirt/kubevirt tests will not be affected by this change. A more permanent fix will follow. [1] https://github.com/kubevirt/kubevirt/blob/cb29e9f87d41deae0d9e1efa6b0cde53ecd8c28a/tests/network/hotplug_sriov.go#L52 [2] https://github.com/kubevirt/project-infra/blob/88e8dbd315a7bc908f637ebe3168f1fe7da97839/github/ci/prow-deploy/files/jobs/kubevirt/kubevirtci/kubevirtci-presubmits.yaml#L53 [3] https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirtci/1070/check-up-kind-1.27-sriov/1691706923780411392 Signed-off-by: Orel Misan <omisan@redhat.com>
PR kubevirt#10185 introduced the SR-IOV migration-based hotplug with an E2E test that fails [1] in case the `HotplugNICs` feature gate is disabled. The CI system of kubevirt/kubevirtci, has an SR-IOV lane that deploys a cluster and runs the conformance test mechanism with a focus on SR-IOV tests[2] without enabling the `HotplugNICs` feature gate. This causes the pre-submit jobs in kubevirt/kubevirtci to fail[3], and requires a maintainer override in order to merge PRs. As an immediate fix, skip the SR-IOV migration based hotplug tests if the `HotplugNICs` feature gate is disabled. The kubevirt/kubevirt tests will not be affected by this change. A more permanent fix will follow. [1] https://github.com/kubevirt/kubevirt/blob/cb29e9f87d41deae0d9e1efa6b0cde53ecd8c28a/tests/network/hotplug_sriov.go#L52 [2] https://github.com/kubevirt/project-infra/blob/88e8dbd315a7bc908f637ebe3168f1fe7da97839/github/ci/prow-deploy/files/jobs/kubevirt/kubevirtci/kubevirtci-presubmits.yaml#L53 [3] https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirtci/1070/check-up-kind-1.27-sriov/1691706923780411392 Signed-off-by: Orel Misan <omisan@redhat.com>
PR kubevirt#10185 introduced the SR-IOV migration-based hotplug with an E2E test that fails [1] in case the `HotplugNICs` feature gate is disabled. The CI system of kubevirt/kubevirtci, has an SR-IOV lane that deploys a cluster and runs the conformance test mechanism with a focus on SR-IOV tests[2] without enabling the `HotplugNICs` feature gate. This causes the pre-submit jobs in kubevirt/kubevirtci to fail[3], and requires a maintainer override in order to merge PRs. As an immediate fix, skip the SR-IOV migration based hotplug tests if the `HotplugNICs` feature gate is disabled. The kubevirt/kubevirt tests will not be affected by this change. A more permanent fix will follow. [1] https://github.com/kubevirt/kubevirt/blob/cb29e9f87d41deae0d9e1efa6b0cde53ecd8c28a/tests/network/hotplug_sriov.go#L52 [2] https://github.com/kubevirt/project-infra/blob/88e8dbd315a7bc908f637ebe3168f1fe7da97839/github/ci/prow-deploy/files/jobs/kubevirt/kubevirtci/kubevirtci-presubmits.yaml#L53 [3] https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirtci/1070/check-up-kind-1.27-sriov/1691706923780411392 Signed-off-by: Orel Misan <omisan@redhat.com>
What this PR does / why we need it:
This PR adds support for migration based SRIOV hotplug.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: