Skip to content
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

Hetzner Cloud support #35

Open
nh2 opened this issue Jan 27, 2018 · 17 comments
Open

Hetzner Cloud support #35

nh2 opened this issue Jan 27, 2018 · 17 comments

Comments

@nh2
Copy link
Contributor

nh2 commented Jan 27, 2018

A few days ago Hetzner made public their new Cloud platform including very cheap and powerful VM servers and a new API to allocate and manage them.

It would be great for NixOps to support it.

Here are the API docs, they have extensive examples.

These VMs also support the Hetzner Rescue Mode which should make it relatively easy to get NixOS onto them.

@nh2
Copy link
Contributor Author

nh2 commented Jan 27, 2018

BTW until that is done, I've successfully brought NixOS onto the new Hetzner Cloud machines by using https://github.com/jeaye/nixos-in-place; it worked at first try. CC @jeaye

@eliasp
Copy link
Member

eliasp commented Feb 11, 2018

Hetzner Cloud now also offers an NixOS ISO to boot the server in rescue mode with.

@nh2
Copy link
Contributor Author

nh2 commented Apr 15, 2018

@eliasp Where can I find that ISO?

@nh2
Copy link
Contributor Author

nh2 commented Apr 15, 2018

Ah, I see it in the GUI under ISO IMAGES, but got confused first because https://api.hetzner.cloud/v1/isos didn't list it. That was because of pagination, it only showed the first 25 entries.

nh2 referenced this issue in nh2/nixops Apr 17, 2018
nh2 referenced this issue in nh2/nixops Apr 17, 2018
@nh2
Copy link
Contributor Author

nh2 commented Apr 17, 2018

I've got a working prototype in https://github.com/nh2/nixops/tree/hetznercloud

Currently requires the user to first make a NixOS snapshot as described on jeaye/nixos-in-place#41

nh2 referenced this issue in nh2/nixops Apr 17, 2018
@blanky0230
Copy link
Member

Hey! Just putting this out here:

https://github.com/hetznercloud/awesome-hcloud

There's also a little sponsoring plan going on for which this project might be eligible:

https://wiki.hetzner.de/index.php/CloudServer/en#Do_you_sponsor_efforts_to_integrate_Hetzner_Cloud_into_Open_Source_libs.3F

@alexanderkjeldaas
Copy link

There's significant costs to keeping your own nixos snapshot on hetzner cloud (close to the cost of running a server).

It would be great if the existing NixOS 18.03 iso which can be mounted on any running instance could be installed over ubuntu/debian/whatever and thus bring up NixOS without needing to pay for a snapshot.

That would be significantly cheaper.

@alexanderkjeldaas
Copy link

fyi, this is the API for attaching the NixOS ISO to a running server: https://docs.hetzner.cloud/#resources-server-actions-post-13

goodraven referenced this issue in goodraven/nixops May 5, 2018
This is based on the digital ocean backend. It also uses nixos-infect. I extended nixos-infect to be generic
for both backends.

Fixes #855
goodraven referenced this issue in goodraven/nixops May 5, 2018
This is based on the digital ocean backend. It also uses nixos-infect. I extended nixos-infect to be generic
for both backends.

Fixes #855
@nh2
Copy link
Contributor Author

nh2 commented May 5, 2018

There's significant costs to keeping your own nixos snapshot on hetzner cloud (close to the cost of running a server).

I'm planning to use @cleverca22's kexec approach (see here to get rid of the snapshot requirement.

A bit surprised about the

close to the cost of running a server

though, isn't it just "€ 0.01/GB per month"?

@Baughn
Copy link

Baughn commented Nov 6, 2018

@nh2 Any progress on this? I might have reason to help a little, and would like to know where I should start.

@Baughn
Copy link

Baughn commented Nov 6, 2018

It looks like there's a NixOS ISO available on Hetzner now. Using that should be much simpler than kexec.

EDIT: ...is what I thought initially, but there seems to be no way to programmatically access the console. Hmm. Maybe not, then.

@ptman
Copy link

ptman commented Nov 7, 2018

I was able to easily install nixos by mounting the ISO, rebooting and using the remote console. But you're probably right that it isn't automatable. Also the ISO could be updated I think.

asymmetric referenced this issue in asymmetric/nixops Apr 14, 2019
This is based on the digital ocean backend. It also uses nixos-infect. I extended nixos-infect to be generic
for both backends.

Fixes #855
asymmetric referenced this issue in asymmetric/nixops Apr 19, 2019
This is based on the digital ocean backend. It also uses nixos-infect. I extended nixos-infect to be generic
for both backends.

Fixes #855
@nh2
Copy link
Contributor Author

nh2 commented Oct 15, 2019

The Python API I used for my prototype is now deprecated:

lsymds/hetznercloud-py#8 (comment)

Hetzner has a new official Python API: https://github.com/hetznercloud/hcloud-python

@grahamc grahamc transferred this issue from NixOS/nixops Apr 20, 2020
@nh2
Copy link
Contributor Author

nh2 commented May 29, 2020

I've just written a simple script to install NixOS from the Hetzner Cloud provided NixOS ISO image:

https://gist.github.com/nh2/c02612e05d1a0f5dc9fd50dda04b3e48

@reyman
Copy link

reyman commented Jul 21, 2020

Thanks @nh2 for you work, a version with luks/encrypted option could be really cool. Like here : https://gitlab.com/shellmachine/nixos-config-phoenix/-/blob/master/phoenix/nixos-init.sh

@nh2
Copy link
Contributor Author

nh2 commented Nov 25, 2020

I got an email about https://github.com/lukebfox/nixops-hetznercloud being created out of this but it seems to disappeared here now.

@lukebfox
Copy link
Member

Hey! I'm the author of the nixops-hetznercloud plugin. It seemed like this was a wanted integration that no one really had the time to complete. I've pulled together the ideas in this thread and wrote the start of a NixOps 2.0 plugin for managing both servers and resources. It uses the hcloud python library from hetznercloud, and a stripped down nixos-infect. Please go break it!

In regards to the email, I posted a comment here similar to my words above but decided to hold off releasing it until nixops#1410 was merged so that the plugin could be mixed with other plugins in https://github.com/lukebfox/nixops-plugged, and people could easily start using it. In any case the patch hasn't been merged yet, and I got tired of waiting therefore currently nixops-plugged will let you use the hetznercloud plugin, but to avoid a (nixops) dependency conflict with other plugins you can't mix it with other plugins just yet.

Thanks for the work so far everyone and I'm looking forward to some fresh issues as there is much work still to be done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants