Skip to content

Rackspace support #168

Closed
Closed

Description

@thoughtpolice

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

  1. CMCDragonkai commented on May 11, 2014

    @CMCDragonkai
    Member

    Any news on this front?

  2. thoughtpolice commented on May 17, 2014

    @thoughtpolice
    MemberAuthor

    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.

  3. jwiegley commented on May 17, 2014

    @jwiegley

    @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?

  4. auntieNeo commented on May 30, 2014

    @auntieNeo

    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.

  5. rbvermaa commented on Jun 4, 2014

    @rbvermaa
    Member

    @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?

  6. thoughtpolice commented on Jun 4, 2014

    @thoughtpolice
    MemberAuthor

    No, I'm afraid I still haven't had any time to look closely at nova-agent for 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.

  7. rbvermaa commented on Jun 4, 2014

    @rbvermaa
    Member

    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).

  8. thoughtpolice commented on Jun 4, 2014

    @thoughtpolice
    MemberAuthor

    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).

  9. rbvermaa commented on Jun 5, 2014

    @rbvermaa
    Member

    @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:

    # xenstore read vm-data/networking/BC764E2062CC
    {"ip6s": [{"ip": "2001:4802:7801:102:be76:4eff:fe20:62cc", "netmask": 64, "enabled": "1", "gateway": "fe80::def"}], "label": "public", "broadcast": "162.242.226.255", "ips": [{"ip": "162.242.226.197", "netmask": "255.255.255.0", "enabled": "1", "gateway": "162.242.226.1"}], "mac": "BC:76:4E:20:62:CC", "gateway_v6": "fe80::def", "dns": ["69.20.0.164", "69.20.0.196"], "gateway": "162.242.226.1"}
    
  10. auntieNeo commented on Jun 8, 2014

    @auntieNeo

    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:

    error in setup command: Error parsing /tmp/nix-build-python2.7-novaclient-3dff4cf1c2d535c29eaff064e9eea17e358392f7.drv-6/python-novaclient-3dff4cf1c2d535c29eaff064e9eea17e358392f7/setup.cfg: OSError: [Errno 2] No such file or directory
    

    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.

  11. auntieNeo commented on Jun 14, 2014

    @auntieNeo

    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.

  12. thoughtpolice commented on Jun 19, 2014

    @thoughtpolice
    MemberAuthor

    nova-agent is, 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-agent pulls information from xenstore (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-agent installed 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 point nova-agent has set up the network. The Python API, pyrax, is already packaged in nixpkgs.

  13. thoughtpolice commented on Jun 19, 2014

    @thoughtpolice
    MemberAuthor

    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.

  14. thoughtpolice commented on Jun 19, 2014

    @thoughtpolice
    MemberAuthor

    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.

  15. auntieNeo commented on Jun 19, 2014

    @auntieNeo

    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. :)

  16. thoughtpolice commented on Jun 22, 2014

    @thoughtpolice
    MemberAuthor

    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

  17. rbvermaa commented on Aug 6, 2014

    @rbvermaa
    Member

    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:

    # xenstore-read vm-data/networking/$(cat /sys/class/net/eth0/address | sed -e 's|:||g' | tr '[:lower:]' '[:upper:]') | python -mjson.tool  
    {
        "broadcast": "104.130.6.255",
        "dns": [
            "69.20.0.164",
            "69.20.0.196"
        ],
        "gateway": "104.130.6.1",
        "gateway_v6": "fe80::def",
        "ip6s": [
            {
                "enabled": "1",
                "gateway": "fe80::def",
                "ip": "2001:4802:7802:104:be76:4eff:fe20:8c90",
                "netmask": 64
            }
        ],
        "ips": [
            {
                "enabled": "1",
                "gateway": "104.130.6.1",
                "ip": "104.130.6.26",
                "netmask": "255.255.255.0"
            }
        ],
        "label": "public",
        "mac": "BC:76:4E:20:8C:90"
    }
    
  18. domenkozar commented on Jul 8, 2017

    @domenkozar
    Member

    @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?

  19. Phreedom commented on Jul 10, 2017

    @Phreedom
    Member
  20. domenkozar commented on Jul 10, 2017

    @domenkozar
    Member

    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.

  21. Phreedom commented on Jul 10, 2017

    @Phreedom
    Member

    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 :)

  22. domenkozar commented on Aug 14, 2018

    @domenkozar
    Member

    @thoughtpolice I think rackspace since abandoned open source sponsoring program?

  23. grahamc commented on Apr 20, 2020

    @grahamc
    Member

    NixOps supports backends as plugins, so closing this. A plugin could be made :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions