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

Move host-disk to handler #6240

Merged
merged 4 commits into from Aug 23, 2021

Conversation

xpivarc
Copy link
Member

@xpivarc xpivarc commented Aug 12, 2021

What this PR does / why we need it:

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:

NONE

This change is noop because func ReplacePVCByHostDisk is
executed from handler context but the file path is
relevant to launcher context. Therefore the change is
failing 100% time and we are ignoring it.

Also this is side-effect of the function.

Signed-off-by: L. Pivarc <lpivarc@redhat.com>
We create disk only on one node. NFS server needs to
be scheduled on this node.

Signed-off-by: L. Pivarc <lpivarc@redhat.com>
Creating a disk in launcher requires the PVC
to be correctly configurated. This will allow
us to provide better user experience even with
non-root launcher.

Signed-off-by: L. Pivarc <lpivarc@redhat.com>
@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. size/L labels Aug 12, 2021
@xpivarc
Copy link
Member Author

xpivarc commented Aug 12, 2021

/cc @davidvossel
This is the thing we talked about. Let me know what you think.

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

why is moving all of this host-disk logic to handler better than having virt-handler simply set permissions on disks before performing the sync with virt-launcher?

Comment on lines -478 to -482
hostDiskCreator := hostdisk.NewHostDiskCreator(l.notifier, l.lessPVCSpaceToleration, l.minimumPVCReserveBytes)
err = hostDiskCreator.Create(vmi)
if err != nil {
return domain, fmt.Errorf("preparing host-disks failed: %v", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

if lessPVCSpaceToleration and minimumPVCReserveBytes are only used here, then there's a whole chain of things starting with template.go that can be removed related to these vars.

@xpivarc
Copy link
Member Author

xpivarc commented Aug 16, 2021

why is moving all of this host-disk logic to handler better than having virt-handler simply set permissions on disks before performing the sync with virt-launcher?

We would need to set permissions for disk(if exists) and for empty pvc (directory) because disks are created inside sync and not before. For me, it feels like additional code. Moving host-disk to the handler is simpler and it also allows us to drop the dependency from the launcher. This is good as the launcher has fewer privileges now.

@davidvossel
Copy link
Member

We would need to set permissions for disk(if exists) and for empty pvc (directory) because disks are created inside sync and not before

ah okay, so we potentially have to deal with the case where a disk doesn't exist as well. I think this makes sense to move to handler then

Signed-off-by: L. Pivarc <lpivarc@redhat.com>
@xpivarc xpivarc force-pushed the nr-move-host-disk-to-handler branch from ede47f0 to a6de356 Compare August 19, 2021 16:14
Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidvossel

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 Aug 19, 2021
@xpivarc
Copy link
Member Author

xpivarc commented Aug 20, 2021

/retest

2 similar comments
@xpivarc
Copy link
Member Author

xpivarc commented Aug 20, 2021

/retest

@xpivarc
Copy link
Member Author

xpivarc commented Aug 20, 2021

/retest

@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@xpivarc
Copy link
Member Author

xpivarc commented Aug 21, 2021

/retest

@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@enp0s3
Copy link
Contributor

enp0s3 commented Aug 22, 2021

/hold
lets wait for #6280 to get in. We have a an issue with a sig-network macvtap test

@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 Aug 22, 2021
@xpivarc
Copy link
Member Author

xpivarc commented Aug 23, 2021

/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 Aug 23, 2021
@xpivarc
Copy link
Member Author

xpivarc commented Aug 23, 2021

/retest

@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Aug 23, 2021

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

Test name Commit Details Rerun command
pull-kubevirt-check-tests-for-flakes a6de356 link /test pull-kubevirt-check-tests-for-flakes

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.

@kubevirt-bot kubevirt-bot merged commit c5ded0d into kubevirt:main Aug 23, 2021
@xpivarc
Copy link
Member Author

xpivarc commented Sep 6, 2021

/cherrypick release-0.44

@kubevirt-bot
Copy link
Contributor

@xpivarc: #6240 failed to apply on top of branch "release-0.44":

Applying: Remove noop file ownership change
Applying: Fix test with NFS disk not owned by qemu
Applying: Use host-disk creator in handler
Using index info to reconstruct a base tree...
M	pkg/host-disk/host-disk_test.go
M	pkg/virt-handler/vm.go
M	pkg/virt-launcher/virtwrap/BUILD.bazel
M	pkg/virt-launcher/virtwrap/manager.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/virt-launcher/virtwrap/manager.go
Auto-merging pkg/virt-launcher/virtwrap/BUILD.bazel
Auto-merging pkg/virt-handler/vm.go
Auto-merging pkg/host-disk/host-disk_test.go
CONFLICT (content): Merge conflict in pkg/host-disk/host-disk_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Use host-disk creator in handler
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-0.44

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.

xpivarc pushed a commit to xpivarc/kubevirt that referenced this pull request Sep 8, 2021
…ndler

Move host-disk to handler

(cherry picked from commit c5ded0d)
xpivarc pushed a commit to xpivarc/kubevirt that referenced this pull request Sep 8, 2021
…ndler

Move host-disk to handler

(cherry picked from commit c5ded0d)
Signed-off-by: L. Pivarc <lpivarc@redhat.com>
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-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.

None yet

5 participants