debops / ansible-lxc

Configure and manage LXC environment on a host
GNU General Public License v3.0
17 stars 10 forks source link

Debops template issues #34

Open chekolyn opened 6 years ago

chekolyn commented 6 years ago

I was wondering if anyone is having issues creating containers with the debops templates. It seems that I can't create a container, looks like the issue is from debootstrap and failing to download the rootfs.

I'm able to create a debian container with the standard debian template but the templates differ from each other considerably.

root@frylab:~# lxc-create -t debops -n test01 -- -r jessie
debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/debian-debops/rootfs-jessie-amd64 ... 
Downloading debian minimal ...
I: Retrieving Release 
I: Retrieving Release.gpg 
I: Checking Release signature
I: Valid Release signature (key id 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: acl adduser dmsetup insserv libaudit-common libaudit1 libbz2-1.0 libcap2 libcap2-bin libcryptsetup4 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libgcrypt20 libgpg-error0 libkmod2 libncursesw5 libprocps3 libsemanage-common libsemanage1 libslang2 libsystemd0 libudev1 libustr-1.0-1 procps systemd systemd-sysv udev 
I: Found additional base dependencies: git-man gnupg gpgv init-system-helpers iproute2 isc-dhcp-common libapt-inst1.5 libapt-pkg4.12 libbsd0 libcurl3 libcurl3-gnutls libdns-export100 libedit2 liberror-perl libexpat1 libffi6 libgdbm3 libgmp10 libgnutls-deb0-28 libgnutls-openssl27 libgssapi-krb5-2 libhogweed2 libidn11 libirs-export91 libisc-export95 libisccfg-export90 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle4 libp11-kit0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline6 librtmp1 libsasl2-2 libsasl2-modules-db libsqlite3-0 libssh2-1 libssl1.0.0 libstdc++6 libtasn1-6 libusb-0.1-4 libwrap0 mime-support openssh-client openssh-sftp-server perl perl-modules python-apt-common python-minimal python2.7 python2.7-minimal readline-common vim-common 
I: Checking component main on http://httpredir.debian.org/debian...
Failed to download the rootfs, aborting.
Failed to download 'debian base'
failed to install debian
lxc_container: container creation template for test01 failed
lxc_container: Error creating container test01
root@frylab:~# lxc-create -t debops -n test01 -- -r wheezy
debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/debian-debops/rootfs-wheezy-amd64 ... 
Downloading debian minimal ...
I: Retrieving Release 
I: Retrieving Release.gpg 
I: Checking Release signature
I: Valid Release signature (key id ED6D65271AACF0FF15D123036FB2A1C265FFB764)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: insserv libbz2-1.0 libdb5.1 libsemanage-common libsemanage1 libslang2 libustr-1.0-1 
I: Found additional base dependencies: adduser git-man gnupg gpgv isc-dhcp-common libapt-inst1.5 libapt-pkg4.12 libbsd0 libclass-isa-perl libcurl3 libcurl3-gnutls libedit2 liberror-perl libexpat1 libgcrypt11 libgdbm3 libgnutls26 libgpg-error0 libgssapi-krb5-2 libidn11 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libncursesw5 libp11-kit0 libprocps0 libreadline6 librtmp0 libsasl2-2 libsqlite3-0 libssh2-1 libssl1.0.0 libstdc++6 libswitch-perl libtasn1-3 libusb-0.1-4 libwrap0 mime-support openssh-client perl perl-modules procps python-apt-common python-minimal python-support python2.7 python2.7-minimal readline-common vim-common 
I: Checking component main on http://httpredir.debian.org/debian...
Failed to download the rootfs, aborting.
Failed to download 'debian base'
failed to install debian
lxc_container: container creation template for test01 failed
lxc_container: Error creating container test01
drybjed commented 6 years ago

It seems to be an issue with debootstrap unable to download the packages... Can you try creating a normal debian template, see if that works? if it does, it might indicate an issue with the lxc-debops script.

NB: debops.lxc role was refreshed a bit in the DebOps monorepo where the main development now happens. You might want to consider switching to it.

chekolyn commented 6 years ago

Hey thanks for the suggestion. Looks like I was using the latest Debops monorepo; and I did a small test by installing the template from this repo and I was able to create the container. Just out of curiosity, don't know if you are having the same issues with the monorepo template.

drybjed commented 6 years ago

@chekolyn Not at the moment, but I'm still using Debian Jessie LXC containers, not Debian Stretch.

In the long term, I think that dropping custom lxc-debops script to generate an LXC container directly, and using a custom bootstrap script applied afterwards, or even debops.bootstrap might be a better solution. This is due to issues with creating unprivileged LXC containers via lxc-download script - this cannot be easily customized for DebOps.