[DRE-maint] Bug#838637: vagrant-libvirt: vagrant libvirt-boxes cannot boot properly when the network is configured via systemd-networkd
Emmanuel Kasper
emmanuel at libera.cc
Fri Sep 23 08:15:06 UTC 2016
Package: vagrant-libvirt
Version: 0.0.33-1
Severity: important
Tags: upstream
vmdebootstrap switched to systemd-networkd for newly created images, some time ago
( could not find a changelog entry for that but it's mentionned in #831025)
switching to systemd-networkd from ifupdown means the OS uses the systemd intern dhcp client instead of ISC dhcp client.
And this breaks vagrant-libvirt in a very subtil way, making vagrant-libvirt boot sequences
hanging on:
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
To login over ssh during the vagrant up sequence, vagrant-libirt needs to know the ip
adress of the box, which provided by the dnsmasq server integrated into libvirt.
To get this information, vagrant-libvirt currently parses /proc/net/arp, trying to
find here an IP adress which matches the MAC adress registered in the libvirt
domain. ( see https://github.com/vagrant-libvirt/vagrant-libvirt/blob/a963ff4c70f5e6ce5bc2589b7e98c1c0671e2ccc/lib/vagrant-libvirt/driver.rb#L35 )
I don't know the internals of systemd vs ISC dhcp clients, but what happens is that
the systemd dhcp client gets an adress from dnsmasq, but the mac adress is not registered in the arp cache.
the output of /proc/net/arp becomes of such:
head -2 /proc/net/arp
IP address HW type Flags HW address Mask Device
192.168.121.221 0x1 0x0 00:00:00:00:00:00 * virbr1
(notice the empty HW address making the match with the mac address of the VM domain impossible)
(but as soon as you ping 192.168.121.221 the arp entry get populated and the vagrant up
sequence can continue)
Recent version of libvirt allow now to query directly for the IP adress of the VM domain,
so IMHO vagrant-libvirt should use this information when available. I get his should be accessible via the fog bindinds of the libvirt ruby bindings.
virsh domifaddr vmdebootstrap-libvirt-vagrant_default
Name MAC address Protocol Address
-------------------------------------------------------------------------------
vnet1 52:54:00:d3:d9:78 ipv4 192.168.121.221/24
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.5.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages vagrant-libvirt depends on:
ii ruby 1:2.3.0+4
ii ruby-fog-libvirt 0.0.3-1
ii ruby-nokogiri 1.6.8-2
ii ruby1.9.1 [ruby-interpreter] 1.9.3.194-8.1+deb7u2
ii ruby2.1 [ruby-interpreter] 2.1.5-4
ii ruby2.2 [ruby-interpreter] 2.2.4-1
vagrant-libvirt recommends no packages.
vagrant-libvirt suggests no packages.
-- no debconf information
More information about the Pkg-ruby-extras-maintainers
mailing list