Page MenuHomePhabricator

Make MediaWiki-Vagrant work with LXC provider on Debian Buster when using role::labs::mediawiki_vagrant
Closed, ResolvedPublic

Description

When trying to set up a new Vagrant box on cloud VSP following the steps in the tutorial, during vagrant up the command sudo /usr/bin/env lxc-create -B none --template /srv/vagrant-data/gems/2.5.5/gems/vagrant-lxc-1.4.3/scripts/lxc-template --name mediawiki-vagrant_default_1571976477222_87370 -- --tarball /srv/vagrant-data/boxes/debian-VAGRANTSLASH-stretch64/9.1.0/lxc/rootfs.tar.gz --config /srv/vagrant-data/boxes/debian-VAGRANTSLASH-stretch64/9.1.0/lxc/lxc-config dies with

lxc-create: mediawiki-vagrant_default_1571976477222_87370: confile.c: set_config_net: 260 lxc.net must not have a value
lxc-create: mediawiki-vagrant_default_1571976477222_87370: parse.c: lxc_file_for_each_line_mmap: 142 Failed to parse config file "/etc/lxc/default.conf" at line "lxc.network.type = veth"
lxc-create: mediawiki-vagrant_default_1571976477222_87370: confile.c: set_config_net: 260 lxc.net must not have a value
lxc-create: mediawiki-vagrant_default_1571976477222_87370: parse.c: lxc_file_for_each_line_mmap: 142 Failed to parse config file "/var/lib/lxc/mediawiki-vagrant_default_1571976477222_87370/config" at line "lxc.network.type = veth"
lxc-create: mediawiki-vagrant_default_1571976477222_87370: tools/lxc_create.c: main: 327 Failed to create container mediawiki-vagrant_default_1571976477222_87370

This looks like an lxc version incompatibility; the internet suggests that lxc.network.type is now lxc.net.0.type.

Event Timeline

Tgr created this task.Oct 25 2019, 4:14 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 25 2019, 4:14 AM
Tgr added a comment.EditedOct 25 2019, 10:58 AM

After fixing that manually, I get

No such file or directory - Failed to open file "/usr/share/lxc/config/debian.common.conf"
Failed to parse config file "/var/lib/lxc/mediawiki-vagrant_default_1571976477222_87370/config" at line "lxc.include = /usr/share/lxc/config/debian.common.conf"

(/var/lib/lxc/mediawiki-vagrant_default_1571976477222_87370/config doesn't exist - presumably the file is /srv/vagrant-data/boxes/debian-VAGRANTSLASH-stretch64/9.1.0/lxc/lxc-config.)

Tgr added a comment.EditedOct 25 2019, 11:13 AM

Changing the include file to /usr/share/lxc/config/debian.common.conf is enough to pull the container up (no idea if it breaks something important). vagrant up then fails with (...snip... moved to T236499: Pulling Vagrant up in Cloud VPS on buster fails with apparmor preventing the mount)

Mentioned in SAL (#wikimedia-cloud) [2019-10-25T15:22:18Z] <tgr> made wikispore-prod temporarily its own puppetmaster to work around T236455

Change 546221 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[operations/puppet@production] [WIP] Make lxc work on buster in Cloud VPS

https://gerrit.wikimedia.org/r/546221

bd808 updated the task description. (Show Details)Oct 27 2019, 2:28 AM
bd808 added a subscriber: bd808.EditedOct 27 2019, 2:49 AM

@Tgr looks like we are trying the same thing (MediaWiki-Vagrant on Buster) at almost the same time. I have found several issues that need to be fixed in the Puppet setup to work with the version of LXC that is on Buster:

  • https://wiki.debian.org/LXC#Network_setup_in_buster
    • The different /etc/lxc/default.conf settings that you noticed
    • Installation of new packages: libvirt-clients libvirt-daemon-system iptables ebtables
    • Setup of the virsh network
  • Install lxc-templates package to provide /usr/share/lxc/config files expected by vagrant-lxc

There is another pain in the ass problem in Vagrant itself too which is documented at https://github.com/fgrehm/vagrant-lxc/issues/481. When the Vagrantfile defines a custom hostname Vagrant >=2.2.4 tries to do things inside the managed instance "that do not work on LXC. Commenting out the config.vm.hostname = mwv.boxname + '.mediawiki-vagrant.dev' in our Vagrantfile "fixes" this by disabling the feature. I think I can restore the basic functionality with some Puppet magic in mwv itself.

bd808 renamed this task from Cloud-vagrant: lxc.net must not have a value to Make MediaWiki-Vagrant work with LXC provider on Debian Buster when using role::labs::mediawiki_vagrant.Oct 27 2019, 2:51 AM
bd808 claimed this task.
bd808 triaged this task as Medium priority.
bd808 edited projects, added cloud-services-team (Kanban); removed Patch-For-Review.

Change 546372 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[mediawiki/vagrant@master] Set hostname via Puppet instead of Vagrant

https://gerrit.wikimedia.org/r/546372

Change 546372 merged by jenkins-bot:
[mediawiki/vagrant@master] Set hostname via Puppet instead of Vagrant

https://gerrit.wikimedia.org/r/546372

Change 546373 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[operations/puppet@production] cloud vps: Add support for Buster to LXC module

https://gerrit.wikimedia.org/r/546373

Change 546221 abandoned by Gergő Tisza:
[WIP] Make lxc work on buster in Cloud VPS

https://gerrit.wikimedia.org/r/546221

Change 546373 merged by Arturo Borrero Gonzalez:
[operations/puppet@production] cloud vps: Add support for Buster to LXC module

https://gerrit.wikimedia.org/r/546373

bd808 closed this task as Resolved.Oct 28 2019, 4:26 PM
Pharos moved this task from Backlog to Done on the Wikispore board.Dec 30 2019, 6:45 PM