Repository navigation
Description
I'm currently managing Haskell.org servers (on a Hetzner dedicated server, with servers running inside KVM), and at the moment we're thinking of moving some of our servers to Rackspace since they've provided us with free hosting.*
I would absolutely kill for Rackspace support in NixOps, so we could evaluate moving some of our services over to NixOS as well (in particular, user management on a particular machine would be greatly simplified with NixOS, and will allow us to deploy hardened security infrastructure).
Rackspace runs on OpenStack, and most distros are just run in a traditional VirtIO based setup. They do have an API for disk images, I think, but I don't think you can upload images - only create 'custom images' from 'base' images. But they also have a rescue mode with SSH support, which I believe should be usable as well - similar to the way the Hetzner backend works.
I'm currently looking into how feasible this is using their pyrax API, but first I need to get the NixOS virtualisation configuration for Rackspace in place as well.
-
BTW, I'll entice others: Rackspace offers a special program for open source projects which offers tons of free credit a month to the project - covering all their products, from server resources to their CDN/object storage - only asking for some small public recognition in return, like a public thanks or logo somewhere (I won't give $$$ specifics, but I'm not talking about their monthly $50 dev discount - it is a lot of free money per month, more than enough for dozens of machines for Hydra for example, and test instances for NixOps, should I finish this ticket.)
If anyone who's officially associated with nixos.org is interested in this, please contact me (email on my GitHub page) - I'll put you in direct contact with the individual who represents me and haskell.org, and he's a super awesome and swell guy who'll get you up and running in minutes. (Then you can dogfood with me to get this working...)
Activity
CMCDragonkai commentedon May 11, 2014
Any news on this front?
thoughtpolice commentedon May 17, 2014
Not yet. There are a handful of us still interested in working on this but we haven't had time just yet (/cc @codeblock @jwiegley).
I actually have a branch that added skeleton infrastructure, and was going to start by actually adding resources (like block devices) first before servers to get my feet wet with the codebase. Perhaps I should just get that done at least.
jwiegley commentedon May 17, 2014
@thoughtpolice Once I get my computer equipment hooked up at my new house, we should talk this week. Before we do, what resources should I read first to get up to speed with where you are now?
auntieNeo commentedon May 30, 2014
I'm very interested in this. I'm looking hard at getting this working for Linode, but from what you wrote it looks like it's a similar situation to Rackspace. Linode has a simple API for instances and disk images, an SSH management console, and a recovery mode that should be suitable.
I'll look at Rackspace tonight, and get back to you later via email.
rbvermaa commentedon Jun 4, 2014
@thoughtpolice I was looking into running NixOS on Rackspace and noticed it requires either static network configuration or an implementation of nova-agent for NixOS (to dynamically set network config based on xenstore passed metadata). Did you look into this already?
thoughtpolice commentedon Jun 4, 2014
No, I'm afraid I still haven't had any time to look closely at
nova-agentfor NixOS yet.Related: Rackspace now has custom image support, so modulo networking config via Nova, uploads should mostly operate the same as GCE uploads do (i.e. use Nix to build an image, wrap it up, upload it, and boot from that) as opposed to needing a complex set of shennanigans to reboot the machine like Hetzner.
rbvermaa commentedon Jun 4, 2014
Hm, thanks for that link, I will look into this new functionality. Still kind of inefficient to need to generate complete images (also current image generation functions need KVM support to build the images in nix).
thoughtpolice commentedon Jun 4, 2014
Do keep me and/or @jwiegley posted if you make any progress, since any work will probably jumpstart us into action (we really want this).
rbvermaa commentedon Jun 5, 2014
@thoughtpolice I don't think I'll make much progress as I won't have much time to look into it.
Tasks that I see that are needed:
Sample metadata output:
auntieNeo commentedon Jun 8, 2014
I've been working as much as I can (in my free time between a couple jobs) on packaging novaclient, which looks like the most orthodox way of accessing the OpenStack/Rackspace API. Progress so far is on my nixpkgs/novaclient branch: https://github.com/auntieNeo/nixpkgs/compare/novaclient
I'm not very experienced at writing or debugging NixOS packages, so it's been a slow but sure learning experience. The novaclient package is stuck with this error in the build phase:
I suspect that error is from distutils being unable to find the setup.cfg file. I'm not super clear how Nix sandboxes these things. The file it's complaining about is clearly on my system. I'm a bit stuck here.
As for Linode, I did find some python bindings on github: https://github.com/tjfontaine/linode-python
But, as there aren't any official-looking bindings, and the Linode API is a really simple RESTful one, I'm probably just going to write some bindings myself for the portion of the API that I do use, rather than try to push a github repository into nixpkgs.
auntieNeo commentedon Jun 14, 2014
I have a novaclient derivation building on my novaclient branch. It seems to be working, but I haven't tested it with a Rackspace account (I'm still waiting for mine to be activated? I'm not sure). I'm going to wait until I've done a minimal amount of testing before submitting a pull request.
@rbvermaa I'm still not clear on the need for xenstore and nova-agent. Those are for the NixOS image installed on the Rackspace server, correct? While novaclient (or some other OpenStack API binding) is still needed to control the server from NixOps? I think I was confusing them. I'll put more research into them, but if you could point me in a direction that might help speed me along.
thoughtpolice commentedon Jun 19, 2014
nova-agentis, essentially, a small daemon that runs on your machines (every machine you deploy on Rackspace has this) which takes information from the OpenStack instance it is running on, which is powered by Xen. This is needed because when you start a virtual machine, you are not given a static IP, but a dynamic IP that is allocated on demand by OpenStack.Furthermore, private networks can be added to/removed from machines at will, so essentially the networking configuration is completely dynamic from the start.
nova-agentpulls information fromxenstore(essentially a buffer that contains configuration information for you, created and passed from the Xen Dom0 host) continuously in order to respond to new events like this.Independently of that, we'll need Python support for the OpenStack/Rackspace API. This is so that we can actually manage the machines obviously; the flow would be that you first use the API to build a server, and get NixOS running, with the
nova-agentinstalled on it. Once it's built, we can query the API to get its IP addresses and public endpoints. Then, when the machine reboots and is rebuilt, the agent will pull in the right networking configuration. We poll the API to see when it's fully online, shell into the system and begin configuring it, as at this pointnova-agenthas set up the network. The Python API, pyrax, is already packaged in nixpkgs.thoughtpolice commentedon Jun 19, 2014
BTW @auntieNeo, thanks for all the work! I'll look into testing your branch soon as we have an active Rackspace account we're using. We still need a NixOS module for the agent, among other things.
thoughtpolice commentedon Jun 19, 2014
Oh, and it seems @Phreedom has been instead using libcloud for his GCE support (see #194), which also supports Rackspace. It would be excellent to not need an extra dependency for NixOps itself.
auntieNeo commentedon Jun 19, 2014
Oh, well, here I was wasting my time wrestling with rackspace-novaclient. Maybe I'll just start using libcloud and actually get something written. Thanks for the tip. :)
thoughtpolice commentedon Jun 22, 2014
In other news, there's some initial work I've done to get NixOps allocating Rackspace resources, based on @Phreedom's GCE work:
https://github.com/haskell-infra/nixops/tree/rackspace
rbvermaa commentedon Aug 6, 2014
I tried looking into the openstack nova agent, but that thing looks too terrible to package and get working. In the meanwhile we could probably create an image with some simple xen commands to retrieve the network information, and configure eth0, after which we just set the network config declaratively using the physical properties that nixops would get from the API.
Sample network config, taken from metadata using xenstore:
domenkozar commentedon Jul 8, 2017
@thoughtpolice I hear based on your podcast that this is the major blocker for porting haskell infrastructure to nixos? @Phreedom what's your level of effort estimate?
Phreedom commentedon Jul 10, 2017
domenkozar commentedon Jul 10, 2017
I have packaged OpenStack for NixOS and the best thing I can say is: it's terrible.
I'd suggest using libcloud if we can get that rolling since we're already using it.
Phreedom commentedon Jul 10, 2017
You can never tell in advance if that's a good idea. libcloud could be quite broken and incomplete or could use older API version or or or... Everytime I added support for something, I ended up patching both the agent and the client lib :)
domenkozar commentedon Aug 14, 2018
@thoughtpolice I think rackspace since abandoned open source sponsoring program?
grahamc commentedon Apr 20, 2020
NixOps supports backends as plugins, so closing this. A plugin could be made :)