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

Make VMI non-migratable when incompatible CPU #2982

Closed
wants to merge 6 commits into from

Conversation

petrkotas
Copy link
Contributor

What this PR does / why we need it:
During migration compatible CPU model have to be used.
This is hard when cpu-passthrough or host-model is used
as a choice for CPU.

This issue can be ovecomed in a short term by blocking
migration for host-model or cpu-passthrough.

Signed-off-by: Petr Kotas petr.kotas@gmail.com

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 # https://bugzilla.redhat.com/show_bug.cgi?id=1760028

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jan 13, 2020
@kubevirt-bot kubevirt-bot added size/L kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Jan 13, 2020
@petrkotas petrkotas force-pushed the migration-hostmodel branch 2 times, most recently from 3660090 to 142e6e1 Compare January 14, 2020 13:00
@petrkotas
Copy link
Contributor Author

/retest

@petrkotas
Copy link
Contributor Author

Hi @MarSik would you please have time to take a look at this PR as it is related to the part you have been working on? I understand you have you workload, so once you are OK with it. Thank you.

@petrkotas
Copy link
Contributor Author

/retest

1 similar comment
@petrkotas
Copy link
Contributor Author

/retest

Copy link

@danielBelenky danielBelenky left a comment

Choose a reason for hiding this comment

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

A few minor comments with some personal suggestions... feel free to change them or not...

// checkCPUForMigration is a hotfix for bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1760028
// to disable migration when host-model od cpu-pass-through is used.
// The check here relies on the fact the first defaulting is done in mutating webhook
// where the default is set based od cluster-wide config, which still can be empty.

Choose a reason for hiding this comment

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

s/od/on

// to disable migration when host-model od cpu-pass-through is used.
// The check here relies on the fact the first defaulting is done in mutating webhook
// where the default is set based od cluster-wide config, which still can be empty.
// If no CPU is setup in VMI and the empty CPU gets here it is passed over to virt-launcher.

Choose a reason for hiding this comment

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

s/setup in/set on

pkg/virt-handler/vm.go Outdated Show resolved Hide resolved
@@ -233,6 +233,8 @@ const (
VirtualMachineInstanceReasonDisksNotMigratable = "DisksNotLiveMigratable"
// Reason means that VMI is not live migratioable because of it's network interfaces collection
VirtualMachineInstanceReasonInterfaceNotMigratable = "InterfaceNotLiveMigratable"
// Reason means that VMI is not live migratioable because of it's network interfaces collection

Choose a reason for hiding this comment

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

I think that the comment here is wrong...

@danielBelenky
Copy link

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 17, 2020
@ksimon1
Copy link
Member

ksimon1 commented Jan 17, 2020

/lgtm

@ksimon1 ksimon1 removed their assignment Jan 17, 2020
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 17, 2020
@petrkotas
Copy link
Contributor Author

/retest

1 similar comment
@petrkotas
Copy link
Contributor Author

/retest

@petrkotas
Copy link
Contributor Author

Hi @danielBelenky and @ksimon1 would you have time to do recheck for this PR? I see the tests are failing for following issues, which are unrelated.

k8s-1.14.6: [rfe_id:3423][vendor:cnv-qe@redhat.com][level:component]oc/kubectl get vm/vmi tests should verify set of wide columns for [test_id:3422]virtualmachineinstance
k8s-1.16.2: [rfe_id:3423][vendor:cnv-qe@redhat.com][level:component]oc/kubectl get vm/vmi tests should verify set of wide columns for [test_id:3422]virtualmachineinstance

Copy link
Member

@ksimon1 ksimon1 left a comment

Choose a reason for hiding this comment

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

LGTM

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2020
@danielBelenky
Copy link

/lgtm

Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

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

Looking good already. The only thing I'm missing here is unit tests for the new method checkCPUForMigration. While you're at it, could you please add unit tests for checkNetworkInterfacesForMigration also?

pkg/virt-handler/vm.go Outdated Show resolved Hide resolved
pkg/virt-handler/vm_test.go Outdated Show resolved Hide resolved
@enp0s3
Copy link
Contributor

enp0s3 commented Sep 16, 2020

/assign

@fabiand
Copy link
Member

fabiand commented Sep 17, 2020

High level comment:
On a homogeneous cluster OR if CPUNodeDiscovery is used, then host-model is safe to migrate.
Thus it must not block migration (speak: not featuregated).

host-passthrough is also migratable, but under much stricter constraints. But because this is required for certain workloads we should allow this, but make it harder to use (speak: featuregated)

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 21, 2020
During migration compatible CPU model have to be used.
This is hard when cpu-passthrough or host-model is used
as a choice for CPU.
This issue can be ovecomed in a short term by blocking
migration for host-model or cpu-passthrough.

This commit hotfixes
https://bugzilla.redhat.com/show_bug.cgi?id=1760028

Signed-off-by: Petr Kotas <petr.kotas@gmail.com>
Signed-off-by: Petr Kotas <petr.kotas@gmail.com>
Signed-off-by: Petr Kotas <petr.kotas@gmail.com>
Signed-off-by: Petr Kotas <petr.kotas@gmail.com>
Signed-off-by: Petr Kotas <petr.kotas@gmail.com>
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2020
@enp0s3 enp0s3 force-pushed the migration-hostmodel branch 2 times, most recently from ddce86f to 371a092 Compare October 4, 2020 12:08
@enp0s3
Copy link
Contributor

enp0s3 commented Oct 4, 2020

/hold fixing merge issues

@enp0s3
Copy link
Contributor

enp0s3 commented Oct 4, 2020

/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 Oct 4, 2020
Copy link
Member

@dankenigsberg dankenigsberg left a comment

Choose a reason for hiding this comment

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

Please modify the PR text (and summary?) to mention that migration is STILL possible if the feature gates are enabled.
Also, please confirm that the feature gate can be requested via HCO.

@@ -34,6 +34,11 @@ const (
SnapshotGate = "Snapshot"
HostDiskGate = "HostDisk"
VirtIOFSGate = "ExperimentalVirtiofsSupport"
// CPUMigrationGate allows users to block migrations for virtual machines with host-model
CPUMigrationGate = "MigrationCPU"
Copy link
Member

Choose a reason for hiding this comment

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

this name is too opaque for me - I cannot tell what it means. How about MigratableHostModel ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dankenigsberg Completely agree. I haven't started the re-factoring. It was only the rebase. Now I will update the PR code itself according to the discussion

@enp0s3 enp0s3 force-pushed the migration-hostmodel branch 3 times, most recently from 0191cce to f724c39 Compare October 5, 2020 11:28
Signed-off-by: L. Pivarc <lpivarc@redhat.com>
@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Oct 6, 2020

@petrkotas: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubevirt-e2e-k8s-1.16.2 f0743e1 link /test pull-kubevirt-e2e-k8s-1.16.2
pull-kubevirt-e2e-k8s-1.15.1-ceph f0743e1 link /test pull-kubevirt-e2e-k8s-1.15.1-ceph
pull-kubevirt-e2e-k8s-1.14.6 f0743e1 link /test pull-kubevirt-e2e-k8s-1.14.6
pull-kubevirt-e2e-k8s-1.14 d7c1f09 link /test pull-kubevirt-e2e-k8s-1.14
pull-kubevirt-e2e-k8s-1.15-ceph 7384be5 link /test pull-kubevirt-e2e-k8s-1.15-ceph
pull-kubevirt-e2e-kind-k8s-1.17.0-ipv6 99b76c7 link /test pull-kubevirt-e2e-kind-k8s-1.17.0-ipv6
pull-kubevirt-goveralls d2b65f8 link /test pull-kubevirt-goveralls

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.

@enp0s3
Copy link
Contributor

enp0s3 commented Oct 6, 2020

Due to many changes I would like to close this PR and relate to #4323

@enp0s3
Copy link
Contributor

enp0s3 commented Oct 6, 2020

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2020
@enp0s3
Copy link
Contributor

enp0s3 commented Oct 6, 2020

/close

@kubevirt-bot
Copy link
Contributor

@enp0s3: Closed this PR.

In response to this:

/close

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.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API release-note-none Denotes a PR that doesn't merit a release note. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.