-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions on how to use this to make a Hetzner Cloud snapshot (includes moving /old-root/nixos to /) #41
Comments
Also note this is very similar to #37; though I only found that issue after I had already written the above. Probably something in there can be used to remove the two hardcodes I have made above:
Would be great if somebody could figure that out! |
This is excellent info, @nh2! We're not currently using a wiki or any other doc collection, so keeping it as an issue and referencing it from the README, which I have just done, should be fine. Thanks so much for the detailed breakdown. As for the hard-coding, you can probably just glob it up. |
Why does the machine have to be placed into rescue mode? Also, would it be possible to attach the existing NixOS 18.03 ISO using the Hetzner API? https://docs.hetzner.cloud/#resources-server-actions-post-13 If the ISO is attached like that, it should be immediately available, and maybe installation can be faster so we don't need to pay for a snapshot - which is quite expensive on hetzner (relative to a server at least). |
Worked for me, note to future internet users. I would not leave out the checkout sum, remember to reboot from webconsole after turning on rescue mode. |
When I did |
Note to my future self (or others who bump into this): If getting boot problems from @nh2 's method
vim /mnt/boot/grub/grub.cfg change: and change: Or if |
@nh2 Can |
@srid There should most likely be the possibility, however for Hetzner and many other hosters, doing a clean (not I think |
This describes how you can use
nixos-in-place
to create a NixOS Snapshot on Hetzner Cloud, from which you can then boot more NixOS machines.I am currently working on implementing NixOps support for snapshots created that way.
Maybe we want to put it into a file or wiki or something @jeaye, let me know what you think.
Step 1: Running
nixos-in-place
on an Ubuntu 16.04 Hetzner Cloud machineYou can copy-paste this all in one go and paste it into the Ubuntu root shell.
Step 2: Moving
/old-root/nixos
to/
To turn a Hetzner Cloud machine converted with
nixos-in-place
into a normal NixOS installation, moving the/nixos
directory to be the new root:You need to replace the
users.extraUsers.root.openssh.authorizedKeys.keys
with your SSH pubkey in the below so you can SSH into the machine.Put the machine into Hetzner rescue mode and run on it (you can copy-paste this all in one go after replacing the pubkey string):
Now you can SSH into the machine with the key you've put in above.
You can also use Hetzner Cloud's web terminal, where the username is
root
and the password isnixos
(this password obviously works only via the web terminal and not via SSH).The text was updated successfully, but these errors were encountered: