TT#105151 Stop removing just-generated udev-rules for network in VMs

The code removed was enabled when $VAGRANT=true, and this happened when
passing "vagrant" parameter to deployment.sh, which is done in places
like proxmox-vm-clone job, the base of many of our tests machines.

VMs do not necessarily have the same hardware configuration, so removing
udev-rules for network devices makes sense in principle.  Especially
when since the beginning we were using network devices named "eth*"
everywhere, even if in the last years we had to use net.ifnames=0 and
udev-rules files in hardware to keep using "eth*" names.

However, now with mr9.5 and the move to Debian bullseye we have to start
using different names, and we settled on the direct translation to
"neth*".  So we need a way to assign whatever network devices the
machines come with, including VMs, to names "neth*".

(If we used the new-permanent device names like ens18 or enp3s0f1 we
would have to adapt network.yml and files like network interface, and
they would be different across all the different machines (HW and VM) so
this is not a better or faster solution to the problem.)

So, back to the topic of removal of this udev-rules file: in many cases
in our test infra, the machines are built "in place" and then rebooted
for upgrades or tests, in princicple with the same hardware
configuration, so there is no need to remove these files.

In cases where the underlying (virtualized) hardware changes, e.g. to
use like local VirtualBox-based vagrant machines, we will need to adapt
the rules for the existing devices.

Change-Id: I57e39a2ec6849f3b5bb8f6cf518e2a2923ec19cb
mr10.0
Manuel Montecelo 5 years ago
parent 44750996be
commit eaecf474c2

@ -1015,11 +1015,6 @@ vagrant_configuration() {
ln -sf /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/mount.vboxsf "${TARGET}/sbin/mount.vboxsf"
fi
# MACs are different on buildbox and on local VirtualBox
# see http://ablecoder.com/b/2012/04/09/vagrant-broken-networking-when-packaging-ubuntu-boxes/
echo "Removing '${TARGET_UDEV_PERSISTENT_NET_RULES}'"
rm -f "${TARGET_UDEV_PERSISTENT_NET_RULES:?}"
if [ -d "${TARGET}/etc/.git" ]; then
echo "Commit /etc/* changes using etckeeper"
grml-chroot "${TARGET}" etckeeper commit "Vagrant/VirtualBox changes on /etc/*"

Loading…
Cancel
Save