~ruther/guix-local

2e8439d37ec79f6e0896f29d26bca2d024bd27fe — Roman Scherer 1 year, 4 months ago a4168d8
machine: hetzner: Fix deployment on smaller instances.

* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-os): Avoid out of
disk space error by bind mounting /mnt/tmp/gnu/store to /gnu/store.
* tests/machine/hetzner.scm: Test with smaller instances.
* doc/guix.texi (Invoking guix deploy): Mention unsupported instance.

Change-Id: If8bfb6733de493b51813b3e82e255849192f7cba
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
3 files changed, 13 insertions(+), 4 deletions(-)

M doc/guix.texi
M gnu/machine/hetzner.scm
M tests/machine/hetzner.scm
M doc/guix.texi => doc/guix.texi +3 -1
@@ 45397,7 45397,9 @@ server type} this virtual server should be created with.  For example,
@code{"cx42"} corresponds to a x86_64 server that has 8 VCPUs, 16 GB of
memory and 160 GB of storage, while @code{"cax31"} to the AArch64
equivalent.  Other server types and their current prices can be found
@uref{https://www.hetzner.com/cloud/#pricing, here}.
@uref{https://www.hetzner.com/cloud/#pricing, here}.  The @code{"cpx11"}
server type is currently not supported, since its rescue system is too
small to bootstrap a Guix system from.

@item @code{ssh-key}
The file name of the SSH private key to use to authenticate with the

M gnu/machine/hetzner.scm => gnu/machine/hetzner.scm +8 -1
@@ 551,6 551,13 @@ chmod 700 /mnt/root/.ssh
cp /root/.ssh/authorized_keys /mnt/root/.ssh/authorized_keys
chmod 600 /mnt/root/.ssh/authorized_keys

# Small instance don't have much disk space.  Bind mount the store of the
# rescue system to the tmp directory of the new Guix system.
mkdir -p /mnt/tmp/gnu/store
mkdir -p /gnu/store
mount --bind /mnt/tmp/gnu/store /gnu/store

apt-get install guix --assume-yes
cat > /tmp/guix/deploy/hetzner-os.scm << EOF
(use-modules (gnu) (guix utils))
(use-package-modules ssh)


@@ 605,7 612,7 @@ fdisk -l /dev/sda"
     (format #f "#!/usr/bin/env bash
set -eo pipefail
apt-get update
apt-get install guix cloud-initramfs-growroot --assume-yes"))
apt-get install cloud-initramfs-growroot --assume-yes"))
    (format #t "successfully installed rescue system packages on '~a'\n" name)))

(define (hetzner-machine-delete machine server)

M tests/machine/hetzner.scm => tests/machine/hetzner.scm +2 -2
@@ 64,7 64,7 @@
   (environment hetzner-environment-type)
   (configuration (hetzner-configuration
                   (labels %labels)
                   (server-type "cax41")
                   (server-type "cax11")
                   (ssh-key %ssh-key-file)))))

(define %x86-machine


@@ 76,7 76,7 @@
   (environment hetzner-environment-type)
   (configuration (hetzner-configuration
                   (labels %labels)
                   (server-type "cpx51")
                   (server-type "cx22")
                   (ssh-key %ssh-key-file)))))

(define (cleanup machine)