nixops icon indicating copy to clipboard operation
nixops copied to clipboard

Use custom images for DigitalOcean instead of nixos-infect

Open 3noch opened this issue 7 years ago • 8 comments

DO finally supports custom images: https://blog.digitalocean.com/custom-images/

This should let us stop infecting Ubuntu and use DO normally.

3noch avatar Oct 06 '18 16:10 3noch

Going to attempt to build an image using a variation of the Azure scripts

ghost avatar Oct 07 '18 14:10 ghost

@mhsjlw any results you can share using a variant of the azure scripts?

paperdigits avatar Nov 16 '18 01:11 paperdigits

https://github.com/NixOS/nixpkgs/pull/58464 :o

infinisil avatar Apr 01 '19 17:04 infinisil

I'm working on the above but I've given up on the cloud-init route. My current approach is to try to generate a NixOS module from the digital ocean metadata (sort of like hardware-configuration.nix on a PC install) and then rebuild.

The biggest reason to need configuration from the Digital Ocean side is to get an initial SSH key into the image that NixOps could then use to push the closure for the system. But it would also be nice to make sure all of the Digital Ocean networking features (floating IPs, IPv6, &c) worked properly.

eamsden avatar Apr 01 '19 22:04 eamsden

One other thing to note is that the Digital Ocean API (as opposed to the web GUI) only supports getting a custom image from an HTTP server. It does not support directly uploading a custom image.

To create a new custom image, send a POST request to /v2/images. The body must contain a url attribute pointing to a Linux virtual machine image to be imported into DigitalOcean.

https://developers.digitalocean.com/documentation/v2/#create-a-custom-image

Hopefully we can have builds of the DO image (which I'm hoping to have complete soon) hosted at nixos.org, so that this won't be an issue. We should probably also tag the uploaded image somehow so we don't have to upload another image for each new machine or deployment.

Also, NixOps closures for Digital Ocean should implicitly import the DO configuration, as that configuration sets up kernel settings for the console as well as RNG initialization using DO-provided seeds*.

:* Not yet, but it will before I take the draft tag off.

eamsden avatar Apr 16 '19 13:04 eamsden

what's the current status of this?

zeratax avatar Oct 25 '20 01:10 zeratax

Any updates on this?

yash-ahir avatar Jan 06 '21 16:01 yash-ahir

NixOS has digital ocean image builds in master, so I think it is a matter of a PR to get NixOps using them for DO.

Unfortunately that's not a PR I have time to make :\

eamsden avatar Jan 09 '21 00:01 eamsden