Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

vagrantfile: Fix vagrant up fedora #3923

Merged
merged 2 commits into from
Sep 8, 2021

Conversation

wainersm
Copy link
Contributor

@wainersm wainersm commented Sep 1, 2021

The aim with this pull request is to fix the vagrant up fedora command which is not currently working. I also send a bonus commit that is just an improvement. I tested both vagrant up fedora and vagrant up ubuntu to ensure no regressions with ubuntu.

@dgibson reported the problem on #3760 but actually I never hit the same issue. Here instead it has crashed because of commit 26cef9d.

@Jakob-Naucke I didn't touch your code which forces the use of Podman on Fedora-likes. Instead I ensure it work with this vagrant file. TBH, I don't know why (and didn't investigate) on the Fedora box with cgroups v2, Podman fails to build the guest image.

Fixes #3760

Since the commit 26cef9d Podman has been used to build the osbuilder
image if on Fedora.

Fedora 32 onward defaults to cgroups v2 which break some tools. The
Vagrantfile instructs the VM to switch back to cgroups v1 (that needs reboot). However
currently it executes the setup script before the reboot (i.e. still cgroups v2)
and then Podman has failed to build the osbuilder image.

With this change the setup script is executed after the reboot, Podman happily uses
cgroup v1, thus the osbuilder image is built.

Fixes kata-containers#3760
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
@wainersm wainersm added the needs-backport Changes need to be applied to an older branch / repository label Sep 1, 2021
@dgibson
Copy link
Contributor

dgibson commented Sep 2, 2021

Changes look fine to me, within my very limited knowledge of vagrant and Ruby. I'm testing them out on my system now.

It seems slightly odd to me that cgroups v2 would break podman: AIUI podman, unlike docker, worked fine with cgroupsv2. But in any case the change is correct: we definitely want to run the setup script in the same kernel environment as the VM then continues to run in.

Copy link
Contributor

@dgibson dgibson left a comment

Choose a reason for hiding this comment

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

It took me a bunch of attempts to get this working... but that appears to be because one of the Fedora servers was flaky, not anything to do with the patches.

Seems to work, excellent!

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @wainersm.

@@ -102,6 +102,12 @@ main()
pkgs_to_install+=" ${rust_agent_pkgs[@]}"
fi

# The redis-server package fails to install if IPv6 is disabled. Let's
# check if that's the case and then enable it.
if [[ $(sudo sysctl -n net.ipv6.conf.all.disable_ipv6) -eq 1 ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: You don't need to use double square brackets here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jodh-intel just updated it to remove the extra square bracket. Thanks!

Copy link
Member

@Jakob-Naucke Jakob-Naucke left a comment

Choose a reason for hiding this comment

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

Hmm, I still get the sd-bus call: Transport endpoint not connected with Fedora. (see below) Btw, just recently I found out you can get Docker on the IBM architectures, but apparently not on RHEL (which I would have to use for CI).

The code that enable IPv6 was moved from the Vagrantfile to
.ci/setup_env_ubuntu.sh so that the environment can be setup
correctly even if not on a vagrant box.

The following line was dropped because I don't think it's worth to
change the developer's environment permanently:

`sudo sed -i 's/\(net.ipv6.conf.all.disable_ipv6\).*/\1=0/' /etc/sysctl.conf`

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
@wainersm
Copy link
Contributor Author

wainersm commented Sep 2, 2021

Hmm, I still get the sd-bus call: Transport endpoint not connected with Fedora. Btw, just recently I found out you can get Docker on the IBM architectures, but apparently not on RHEL (which I would have to use for CI).

Double-checking: using Vagrant you are still getting the sd-bus error? Did you destroy then up the vm?

@Jakob-Naucke
Copy link
Member

@wainersm scratch that -- I had forgotten to apply your changes 🤦‍♂️ taking a look...

@Jakob-Naucke
Copy link
Member

Did anyone else observe this?

Vagrant attempted to execute the capability 'reboot'
on the detect guest OS 'fedora', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

This is system-installed Vagrant 2.2.6 on Ubuntu 20.04 x86_64 with libvirt.

@wainersm
Copy link
Contributor Author

wainersm commented Sep 2, 2021

Did anyone else observe this?

Vagrant attempted to execute the capability 'reboot'
on the detect guest OS 'fedora', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

This is system-installed Vagrant 2.2.6 on Ubuntu 20.04 x86_64 with libvirt.

I always tested the vagrantfile on my Fedora 33 x86_64 machine. Let me create a Ubuntu VM to give it a try.
thanks for reporting it @Jakob-Naucke !

@wainersm
Copy link
Contributor Author

wainersm commented Sep 3, 2021

Did anyone else observe this?

Vagrant attempted to execute the capability 'reboot'
on the detect guest OS 'fedora', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

This is system-installed Vagrant 2.2.6 on Ubuntu 20.04 x86_64 with libvirt.

I always tested the vagrantfile on my Fedora 33 x86_64 machine. Let me create a Ubuntu VM to give it a try.
thanks for reporting it @Jakob-Naucke !

@Jakob-Naucke I could reproduce it in a ubuntu 20.04 VM. I will open another issue. are you okay if I merge this fix?

@wainersm
Copy link
Contributor Author

wainersm commented Sep 3, 2021

/test

@wainersm wainersm merged commit 72aec91 into kata-containers:main Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-backport Changes need to be applied to an older branch / repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vagrant fedora machine does not come up
5 participants