diff options
| author | Roman Scherer <roman@burningswell.com> | 2025-02-27 19:24:46 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-02-28 23:03:36 +0100 |
| commit | 2e8439d37ec79f6e0896f29d26bca2d024bd27fe (patch) | |
| tree | def0c0f6a7f630c75dac399be68fd80c5356e05c | |
| parent | a4168d8ba75bff6d1a855dd6343ffc5d3b6b53c8 (diff) | |
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>
| -rw-r--r-- | doc/guix.texi | 4 | ||||
| -rw-r--r-- | gnu/machine/hetzner.scm | 9 | ||||
| -rw-r--r-- | tests/machine/hetzner.scm | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 93380dc30d4..9fd92b4891d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -45397,7 +45397,9 @@ server type} this virtual server should be created with. For example, | |||
| 45397 | @code{"cx42"} corresponds to a x86_64 server that has 8 VCPUs, 16 GB of | 45397 | @code{"cx42"} corresponds to a x86_64 server that has 8 VCPUs, 16 GB of |
| 45398 | memory and 160 GB of storage, while @code{"cax31"} to the AArch64 | 45398 | memory and 160 GB of storage, while @code{"cax31"} to the AArch64 |
| 45399 | equivalent. Other server types and their current prices can be found | 45399 | equivalent. Other server types and their current prices can be found |
| 45400 | @uref{https://www.hetzner.com/cloud/#pricing, here}. | 45400 | @uref{https://www.hetzner.com/cloud/#pricing, here}. The @code{"cpx11"} |
| 45401 | server type is currently not supported, since its rescue system is too | ||
| 45402 | small to bootstrap a Guix system from. | ||
| 45401 | 45403 | ||
| 45402 | @item @code{ssh-key} | 45404 | @item @code{ssh-key} |
| 45403 | The file name of the SSH private key to use to authenticate with the | 45405 | The file name of the SSH private key to use to authenticate with the |
diff --git a/gnu/machine/hetzner.scm b/gnu/machine/hetzner.scm index 1d9a3f43857..bc8d2efbd34 100644 --- a/gnu/machine/hetzner.scm +++ b/gnu/machine/hetzner.scm | |||
| @@ -551,6 +551,13 @@ chmod 700 /mnt/root/.ssh | |||
| 551 | cp /root/.ssh/authorized_keys /mnt/root/.ssh/authorized_keys | 551 | cp /root/.ssh/authorized_keys /mnt/root/.ssh/authorized_keys |
| 552 | chmod 600 /mnt/root/.ssh/authorized_keys | 552 | chmod 600 /mnt/root/.ssh/authorized_keys |
| 553 | 553 | ||
| 554 | # Small instance don't have much disk space. Bind mount the store of the | ||
| 555 | # rescue system to the tmp directory of the new Guix system. | ||
| 556 | mkdir -p /mnt/tmp/gnu/store | ||
| 557 | mkdir -p /gnu/store | ||
| 558 | mount --bind /mnt/tmp/gnu/store /gnu/store | ||
| 559 | |||
| 560 | apt-get install guix --assume-yes | ||
| 554 | cat > /tmp/guix/deploy/hetzner-os.scm << EOF | 561 | cat > /tmp/guix/deploy/hetzner-os.scm << EOF |
| 555 | (use-modules (gnu) (guix utils)) | 562 | (use-modules (gnu) (guix utils)) |
| 556 | (use-package-modules ssh) | 563 | (use-package-modules ssh) |
| @@ -605,7 +612,7 @@ fdisk -l /dev/sda" | |||
| 605 | (format #f "#!/usr/bin/env bash | 612 | (format #f "#!/usr/bin/env bash |
| 606 | set -eo pipefail | 613 | set -eo pipefail |
| 607 | apt-get update | 614 | apt-get update |
| 608 | apt-get install guix cloud-initramfs-growroot --assume-yes")) | 615 | apt-get install cloud-initramfs-growroot --assume-yes")) |
| 609 | (format #t "successfully installed rescue system packages on '~a'\n" name))) | 616 | (format #t "successfully installed rescue system packages on '~a'\n" name))) |
| 610 | 617 | ||
| 611 | (define (hetzner-machine-delete machine server) | 618 | (define (hetzner-machine-delete machine server) |
diff --git a/tests/machine/hetzner.scm b/tests/machine/hetzner.scm index 39eac4a4d5f..1552bcb9a08 100644 --- a/tests/machine/hetzner.scm +++ b/tests/machine/hetzner.scm | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | (environment hetzner-environment-type) | 64 | (environment hetzner-environment-type) |
| 65 | (configuration (hetzner-configuration | 65 | (configuration (hetzner-configuration |
| 66 | (labels %labels) | 66 | (labels %labels) |
| 67 | (server-type "cax41") | 67 | (server-type "cax11") |
| 68 | (ssh-key %ssh-key-file))))) | 68 | (ssh-key %ssh-key-file))))) |
| 69 | 69 | ||
| 70 | (define %x86-machine | 70 | (define %x86-machine |
| @@ -76,7 +76,7 @@ | |||
| 76 | (environment hetzner-environment-type) | 76 | (environment hetzner-environment-type) |
| 77 | (configuration (hetzner-configuration | 77 | (configuration (hetzner-configuration |
| 78 | (labels %labels) | 78 | (labels %labels) |
| 79 | (server-type "cpx51") | 79 | (server-type "cx22") |
| 80 | (ssh-key %ssh-key-file))))) | 80 | (ssh-key %ssh-key-file))))) |
| 81 | 81 | ||
| 82 | (define (cleanup machine) | 82 | (define (cleanup machine) |
