[bug#76501,1/1] gnu: machine: hetzner: Fix deployment on smaller instances.
Commit Message
* 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: Mention unsupported instance.
Change-Id: If8bfb6733de493b51813b3e82e255849192f7cba
---
doc/guix.texi | 4 +++-
gnu/machine/hetzner.scm | 9 ++++++++-
tests/machine/hetzner.scm | 4 ++--
3 files changed, 13 insertions(+), 4 deletions(-)
Comments
On 2025-02-23, 13:22 +0100, Roman Scherer <roman@burningswell.com> wrote:
> * 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: Mention unsupported instance.
Hi All.
Thanks Roman for your work on 'hetzner-environment-type', it's really
cool that 'guix deploy' gets expanded with other integrations and
features. Also thanks for getting back to me so quickly when I reached
out the other day.
I confirm that the patch works well for me. I was able to provision
various cx22 (and above) Hetzner instances with it.
Just a cosmetic thing, here it should be "rescue":
> +# Small instance don't have much disk space. Bind mount the store of the
> +# resuce system to the tmp directory of the new Guix system.
Thanks, best wishes, Fabio.
I also opened a support ticket at Hetzner with the request to have more
disk space on the rescue system of smaller instances. They said they
handed the request over to their customers team and will prioritize it,
depending on demand.
@Fabio / anyone listening: If you want to see this happening, maybe also
send them an email about this ;)
Fabio Natali <me@fabionatali.com> writes:
> On 2025-02-23, 13:22 +0100, Roman Scherer <roman@burningswell.com> wrote:
>> * 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: Mention unsupported instance.
>
> Hi All.
>
> Thanks Roman for your work on 'hetzner-environment-type', it's really
> cool that 'guix deploy' gets expanded with other integrations and
> features. Also thanks for getting back to me so quickly when I reached
> out the other day.
>
> I confirm that the patch works well for me. I was able to provision
> various cx22 (and above) Hetzner instances with it.
>
> Just a cosmetic thing, here it should be "rescue":
>
>> +# Small instance don't have much disk space. Bind mount the store of the
>> +# resuce system to the tmp directory of the new Guix system.
>
> Thanks, best wishes, Fabio.
On 2025-02-25, 11:27 +0100, Roman Scherer <roman@burningswell.com> wrote:
> I also opened a support ticket at Hetzner with the request to have more
> disk space on the rescue system of smaller instances. They said they
> handed the request over to their customers team and will prioritize it,
> depending on demand.
>
> @Fabio / anyone listening: If you want to see this happening, maybe also
> send them an email about this ;)
Hi Roman,
Absolutely, good idea and glad to do that. I think the Guix Foundation
has a Hetzner account too, we could think of sending an email from that
account too. I'll try and reach out to someone at the Guix Foundation
(Tanguy? Chris?) to suggest this.
Shall we generally indicate that we've run into issues with the size of
the rescue system - or do we have any number that we can attach to our
request? E.g. anything above X GB on all instances (including the
smallest ones)?
This is orthogonal and probably worth a separate thread but I wonder how
this works with the other guix deploy backend, the DigitalOcean one, and
if there's any similar limitation there.
Thanks, best wishes, Fabio.
Hi Fabio,
Fabio Natali <me@fabionatali.com> writes:
> On 2025-02-25, 11:27 +0100, Roman Scherer <roman@burningswell.com> wrote:
>> I also opened a support ticket at Hetzner with the request to have more
>> disk space on the rescue system of smaller instances. They said they
>> handed the request over to their customers team and will prioritize it,
>> depending on demand.
>>
>> @Fabio / anyone listening: If you want to see this happening, maybe also
>> send them an email about this ;)
>
> Hi Roman,
>
> Absolutely, good idea and glad to do that. I think the Guix Foundation
> has a Hetzner account too, we could think of sending an email from that
> account too. I'll try and reach out to someone at the Guix Foundation
> (Tanguy? Chris?) to suggest this.
>
> Shall we generally indicate that we've run into issues with the size of
> the rescue system - or do we have any number that we can attach to our
> request? E.g. anything above X GB on all instances (including the
> smallest ones)?
The current approach works with the smallest ARM instance, cax11, and it
has 1.9GB free space when booted into the rescue system. Maybe ask for a
bit more than this, just to be safe.
> This is orthogonal and probably worth a separate thread but I wonder how
> this works with the other guix deploy backend, the DigitalOcean one, and
> if there's any similar limitation there.
On Digital Ocean guix deploy does not use a resuce system, but instead
boots into a Debian system that then gets "infected" with a Guix system,
by installing it on top of the Debian system, and moving directories
like /etc around. I tried this initially, but run into issues with the
network not resolving hosts anymore when /etc got moved. It looked like
the infect script used for Digitial Ocean is tied to a specific Debian
version, that wasn't available on Hetzner.
> Thanks, best wishes, Fabio.
Hi,
I sent v2 that fixes the spelling.
Thanks, Roman.
Fabio Natali <me@fabionatali.com> writes:
> On 2025-02-23, 13:22 +0100, Roman Scherer <roman@burningswell.com> wrote:
>> * 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: Mention unsupported instance.
>
> Hi All.
>
> Thanks Roman for your work on 'hetzner-environment-type', it's really
> cool that 'guix deploy' gets expanded with other integrations and
> features. Also thanks for getting back to me so quickly when I reached
> out the other day.
>
> I confirm that the patch works well for me. I was able to provision
> various cx22 (and above) Hetzner instances with it.
>
> Just a cosmetic thing, here it should be "rescue":
>
>> +# Small instance don't have much disk space. Bind mount the store of the
>> +# resuce system to the tmp directory of the new Guix system.
>
> Thanks, best wishes, Fabio.
@@ -45361,7 +45361,9 @@ Invoking guix deploy
@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
@@ -551,6 +551,13 @@ (define (hetzner-machine-rescue-install-os machine ssh-session server)
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
+# resuce 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 @@ (define (hetzner-machine-rescue-install-packages machine ssh-session)
(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)
@@ -64,7 +64,7 @@ (define %arm-machine
(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 @@ (define %x86-machine
(environment hetzner-environment-type)
(configuration (hetzner-configuration
(labels %labels)
- (server-type "cpx51")
+ (server-type "cx22")
(ssh-key %ssh-key-file)))))
(define (cleanup machine)