__        ___     _ _       _____                ____ __  __
\ \      / / |__ (_) |_ ___|  ___|   _ ___  ___ / ___|  \/  |
 \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ |   | |\/| |
  \ V  V / | | | | | ||  __/  _|| |_| \__ \  __/ |___| |  | |
   \_/\_/  |_| |_|_|\__\___|_|   \__,_|___/\___|\____|_|  |_|
                                            Container Manager

!The application is not yet ready for production usage, use at your own risk!

WhiteFuse CM Node API

WhiteFuse CM is a web-based management system for Linux/FreeBSD based container virtualization. Currently support for LXC and linux-vserver is implemented. The node api is a service that runs on the virtualization nodes. It exposes a RESTful interface that the master can connect in order to administrate the node and it's containers. The node api is packaged in a ruby gem called wf_node_api .

Supported container systems

Currently the api supports:

  • LXC
  • linux-vserver

Future support is planned for:

  • FreeBSD jails through ezjail

Supported operating systems

While the node api basically works on any Linux distribution that supports one of the two implemented containerization solutions, the development is only being done on:

  • CentOS 7 for LXC
  • CentOS 6 for linux-vserver

The test/development environment already comes with a Vagrantfile that creates and provisions virtual machines for both lxc and vserver.

Setting up a development / testing environment

Requirements: Mac OS X or Linux, VirtualBox, Vagrant, Subnet 192.168.41.0/24 not in use (otherwise you will have to customize the Vagrantfile)

  1. Check out the source code
  2. Run vagrant up lxc or vagrant up vserver depending on which system you want to test drive
  3. Wait for the creation and provisioning to finish
  4. The node api is exposed on https://192.168.41.210:1357/ for LXC or https://192.168.41.211:1357/ for linux-vserver. The API token can be found in /etc/wf-node-api.conf in the virtual machine. Logs go to /var/log/wf-node-api.log

Setting up a production node

  1. Set up a host with either lxc or linux-vserver and ensure that you can create, run (and so on) containers from cli
  2. Install Ruby 2.0 or higher and RubyGems
  3. Run gem install wf_node_api to install the node api
  4. Run wf_node_api to initially create the configuration file
  5. Adjust /etc/wf-node-api.conf to your needs
  6. Run wf_node_api start to run the api as a service in background

After a reboot you have to run wf_node_api in order to bring the api up again... or write an init script ;)

Using the API

The Node API is a synchronous REST API, that allows you to manage your container host over HTTPS. A fully featured API documentation is located in the _docs/rest/ folder.