Commit a3a300e
committed
guestfs: bringup: fix debian networking issue
When doing make bringup, virt-builder boots an image with network to be
able to install packages for image baseline creation. In order to have
network in the booted image, virt-builder assumes isc-dhcp-client is the
default Debian package for this task. However, this is not the case as
Debian trixie has replaced the default dhcp client isc-dhcp-client with
dhcpcd.
The proper way to fix this is to address the problem at libguestfs
and ensure both packages can be used. This was supported already in
libguestfs for Fedora/Red Hat but not for Debian. So, package support
has been added to libguestfs for Debian hosts [1][2][3]. The fix is now
merged in libguestfs v1.54.1.
[1]
https://lists.libguestfs.org/archives/list/[email protected]/
thread/ANINW4N4D2VYRD5GTAUQWDZDECAN6XFM/#ANINW4N4D2VYRD5GTAUQWDZDECAN6XF
M
[2] 91fab3f498b6847454656acd2f3d5788c533033b ("appliance: add dhcpcd
support on Debian")
[3]
libguestfs/libguestfs@91fab3f498b6847454656acd
2f3d5788c533033b
While we wait Debian to upgrade the package to a newer libguestfs
release that includes the fix, we need to ensure isc-dhcp-client is part
of the host tools. Note that we need to be explicit as isc-dhcp-client
is listed as optional runtime dependency for libguestfs [4].
[4] https://packages.debian.org/trixie/libguestfs0t64
This was reported already in a previous Debian release:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775514
In order to fix this, introduce a new target under the bringup_guestfs
playbook to install libguestfs and it's dependencies. Add this for
Debian, Suse and Fedora/RedHat.
This new target also allows to remove the dependency check at
min_deps introduced by commit 0111187
("Makefile.min_deps: ensure you have virt-builder when using
guestfs"). Min deps is intended for minimal kdevops dependencies to
run kdevops. And it's kdevops job with Ansible/Makefile dedicated
playbooks-roles/targets to ensure libguestfs (including virt-builder) is
installed in the host.
To replicate the issue in Debian testing (without isc-dhcp-client
installed and a libguestfs version < 1.54.1 ), run any of the following
virt-builder commands:
virt-builder fedora-27 --install qemu-guest-agent
[ 3.2] Downloading: http://archive.libguestfs.org/builder/fedora-27.xz
[ 3.7] Planning how to build this image
[ 3.7] Uncompressing
[ 5.3] Opening the new disk
libguestfs: warning: current user is not a member of the KVM group
(group ID 994). This user cannot access /dev/kvm, so libguestfs may run
very slowly. It is recommended that you 'chmod 0666 /dev/kvm' or add
the current user to the KVM group (you might need to log out and log
in again).
[ 27.3] Setting a random seed
[ 27.4] Installing packages: qemu-guest-agent
Error: Failed to synchronize cache for repo 'updates'
virt-builder: error: dnf -y install 'qemu-guest-agent': command exited
with an error
If reporting bugs, run virt-builder with debugging enabled and include the
complete output:
virt-builder -v -x [...]
sudo virt-builder debian-12 --install sudo
[ 0.7] Downloading: http://builder.libguestfs.org/debian-12.xz
[ 1.0] Planning how to build this image
[ 1.0] Uncompressing
[ 2.9] Opening the new disk
[ 6.3] Setting a random seed
virt-builder: warning: random seed could not be set for this type of guest
[ 6.4] Installing packages: sudo
Ign:1 http://security.debian.org/debian-security bookworm-security
InRelease
Ign:2 http://deb.debian.org/debian bookworm InRelease
Ign:3 http://deb.debian.org/debian bookworm-updates InRelease
Ign:1 http://security.debian.org/debian-security bookworm-security
InRelease
Ign:2 http://deb.debian.org/debian bookworm InRelease
Ign:3 http://deb.debian.org/debian bookworm-updates InRelease
Ign:2 http://deb.debian.org/debian bookworm InRelease
Ign:1 http://security.debian.org/debian-security bookworm-security
InRelease
Ign:3 http://deb.debian.org/debian bookworm-updates InRelease
Err:2 http://deb.debian.org/debian bookworm InRelease
Temporary failure resolving 'deb.debian.org'
Err:1 http://security.debian.org/debian-security bookworm-security
InRelease
Temporary failure resolving 'security.debian.org'
Err:3 http://deb.debian.org/debian bookworm-updates InRelease
Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease
Temporary failure resolving 'deb.debian.org'
W: Failed to fetch
http://security.debian.org/debian-security/dists/bookworm-security/InRel
ease
Temporary failure resolving 'security.debian.org'
W: Failed to fetch
http://deb.debian.org/debian/dists/bookworm-updates/InRelease Temporary
failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old
ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1889 kB of archives.
After this operation, 6199 kB of additional disk space will be used.
Ign:1 http://deb.debian.org/debian bookworm/main amd64 sudo amd64 1.9.13p3-1
Ign:1 http://deb.debian.org/debian bookworm/main amd64 sudo amd64 1.9.13p3-1
Ign:1 http://deb.debian.org/debian bookworm/main amd64 sudo amd64 1.9.13p3-1
Err:1 http://deb.debian.org/debian bookworm/main amd64 sudo amd64 1.9.13p3-1
Temporary failure resolving 'deb.debian.org'
E: Failed to fetch
http://deb.debian.org/debian/pool/main/s/sudo/sudo_1.9.13p3-1_amd64.deb
Temporary failure resolving 'deb.debian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?
virt-builder: error:
export DEBIAN_FRONTEND=noninteractive
apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
apt-get $apt_opts update
apt-get $apt_opts install 'sudo'
: command exited with an error
If reporting bugs, run virt-builder with debugging enabled and include
the complete output:
virt-builder -v -x [...]
Signed-off-by: Daniel Gomez <[email protected]>1 parent 36bc81c commit a3a300e
File tree
7 files changed
+62
-5
lines changed- playbooks/roles/bringup_guestfs/tasks
- install-deps
- debian
- redhat
- suse
- scripts
7 files changed
+62
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 13 | | |
19 | 14 | | |
20 | 15 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
0 commit comments