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

Add experimental support for VirtIO-FS #3493

Merged
merged 12 commits into from Sep 19, 2020

Conversation

vladikr
Copy link
Member

@vladikr vladikr commented May 31, 2020

What this PR does / why we need it:

This PR will add experimental support for virtio-fs.
Users will be able to provide a Filesystem based volume and passthrough filesystem to the guest.

spec:                                                                           
  domain:                                                                       
    devices:          
      filesystems:
      - name: disk1
        virtiofs: {}
...
...
  volumes:
  - name: disk1
    persistentVolumeClaim:
    claimName: test-nfs2v2nb75bds2ddvkslxt5gv922nvpdnlm7n6dhrdmflp597t7

depends on #3268

Special notes for your reviewer:

Release note:

virtIO-FS is being added as experimental, protected by a feature-gate that needs to be enabled in the kubevirt config by the administrator

@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-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/XL labels May 31, 2020
@vladikr
Copy link
Member Author

vladikr commented May 31, 2020

/hold

@kubevirt-bot kubevirt-bot added 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 labels May 31, 2020
@vladikr
Copy link
Member Author

vladikr commented May 31, 2020

/cc @fabiand

@vladikr vladikr force-pushed the virtiofs_experimental branch 2 times, most recently from 57d7539 to 4b6741a Compare June 1, 2020 21:45
@vladikr
Copy link
Member Author

vladikr commented Jun 3, 2020

/retest

@fabiand fabiand requested a review from jean-edouard June 3, 2020 22:30
@fabiand
Copy link
Member

fabiand commented Jun 3, 2020

@jean-edouard mind giving this a review?

@fabiand
Copy link
Member

fabiand commented Jun 3, 2020

@vladikr in the end it's probably worth to have a release note ,)

})
It("should start a VMI with virtiofs", func() {
hugepageSize := "2Mi"
memory := "64Mi"
Copy link
Member Author

Choose a reason for hiding this comment

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

64 is to small, requires at least 512...

@vladikr
Copy link
Member Author

vladikr commented Jun 4, 2020

In order to make the tests pass on kubevirtci, the kernel needs to be updated to 4.18.0-193 and the node should have at least 512Mi of 2m hugepages available

I wonder how to go around this. Should I follow kubevirt/kubevirtci#344 and increase the number of huge pages or should I create a new lane?
@rmohr @dhiller @danielBelenky

Copy link
Contributor

@jean-edouard jean-edouard left a comment

Choose a reason for hiding this comment

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

This looks sane, example VM(s) would be nice to have too if possible.
Don't we need a libvirt bump? https://virtio-fs.gitlab.io/ seems to say it's available starting from v6.2.0.
What is the plan for SELinux, do we want to create a new type?
What's the plan for CI? Since the kernel in Centos 8 is too old, do we need a new lane?

vmi.Spec.Domain.Resources.Requests = k8sv1.ResourceList{
k8sv1.ResourceMemory: resource.MustParse("64Mi"),
}
vmi.Spec.Domain.Memory = &v1.Memory{Guest: &guestMemory}
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done


By("Checking that virtio-fs is mounted")
_, err = expecter.ExpectBatch([]expect.Batcher{
&expect.BSnd{S: "ls -l %s/*disk* | wc -l\n"},
Copy link
Contributor

Choose a reason for hiding this comment

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

What does %s refer to here? Nit: maybe use ls -1?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jean-edouard any chance you could see what did I do wrong here? This fails with the new expecter.

@@ -1,6 +1,6 @@
/*
* This file is part of the KubeVirt project
*
*
Copy link
Contributor

Choose a reason for hiding this comment

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

To clean

@vladikr
Copy link
Member Author

vladikr commented Jun 5, 2020

Don't we need a libvirt bump? https://virtio-fs.gitlab.io/ seems to say it's available starting from v6.2.0.

Yeah, libvirt is already updated to 6.0 (as part of #3268 ) - our kubevirt/libvirt already have that virtiofs support it in

@vladikr
Copy link
Member Author

vladikr commented Jun 5, 2020

What is the plan for SELinux, do we want to create a new type?

Working on it :)
First I had to figure out CI.
Basically we will need to enable exactly what conainer_kvm_t allows for virtiofs: https://github.com/containers/container-selinux/blob/master/container.te#L1096

@vladikr
Copy link
Member Author

vladikr commented Jun 5, 2020

What's the plan for CI? Since the kernel in Centos 8 is too old, do we need a new lane?

We just need to update the kernel in this image. virtiofs also needs more hugepages, I'm not sure what's the best route.

@openshift-ci-robot
Copy link
Collaborator

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

Test name Commit Details Rerun command
ci/prow/e2e-azure-nested-virt 05f5ec2 link /test e2e-azure-nested-virt

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@fabiand
Copy link
Member

fabiand commented Jun 29, 2020

@rmohr @davidvossel could one of you please give this a look?
@dhiller @danielBelenky do you know something about the libvirt rebase and needed ci changes?

@@ -372,6 +372,9 @@ type Devices struct {
//Whether to attach a GPU device to the vmi.
// +optional
GPUs []GPU `json:"gpus,omitempty"`
// Filesystems describes filesystem which is connected to the vmi.
// +optional
Copy link
Member

Choose a reason for hiding this comment

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

add // +listType=set or // +listType=atomic here

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 thanks!

@vladikr
Copy link
Member Author

vladikr commented Sep 16, 2020

/retest

2 similar comments
@vladikr
Copy link
Member Author

vladikr commented Sep 16, 2020

/retest

@vladikr
Copy link
Member Author

vladikr commented Sep 17, 2020

/retest

Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
…label

Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
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


volume := volumes[fs.Name]
if volume == nil {
return fmt.Errorf("No matching volume with name %s found", fs.Name)
Copy link
Member

Choose a reason for hiding this comment

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

i think it's fine to keep this check here. It would be good to add this to the validation webhook as well though so we can catch this condition earlier.

i don't think the PR necesssarily needs to be blocked for that though. it can come in a follow up pr

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2020
@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

@vladikr
Copy link
Member Author

vladikr commented Sep 18, 2020

/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 Sep 19, 2020

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

Test name Commit Details Rerun command
pull-kubevirt-e2e-k8s-1.15-ceph c19b324 link /test pull-kubevirt-e2e-k8s-1.15-ceph
pull-kubevirt-e2e-kind-1.17-sriov ec398f4 link /test pull-kubevirt-e2e-kind-1.17-sriov

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-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.

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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants