This is a plugin for Chef's knife tool.
Add this line to your application's Gemfile:
gem 'knife-vserver', :git => "git://github.com/hamann/knife-vserver.git"
And then execute:
$ bundle
Please execute knife vserver sub-command --help
to see available options in detail.
This plugin provides the following sub-commands:
- knife vserver list QUERY (options)
Uses Chef Server to list all available containers on nodes returned by the query. If option -m
is set, QUERY is a list of comma seperated hostnames and Chef isn't needed in that case
-
knife vserver create SERVER (options)
-
knife vserver delete SERVER (options)
-
knife vserver modify memory SERVER (options)
-
knife vserver add address SERVER (options)
-
knife vserver remove address SERVER (options)
-
knife vserver start SERVER (options)
-
knife vserver stop SERVER (options)
This plugin was developed and tested on Debian (squeeze/wheezy)
- Recent Linux VServer Kernel on hosts
- Recent
util-vserver
version - all commands are executed by SSH
- Memory modification and adding/removing addresses will be synced with vserver configuration files
A few examples:
List all available containers
$ knife vserver list "chef_environment:production"
Create a container on server containerhost.example.net with 1024 MB Ram, 2048 MB Swap and some IP addresses
$ knife vserver create containerhost.example.net -C testcontainer1 \
-H 'testcontainer1.example.net' -R 1024 -S 2048 -I "eth0|10.20.20.2/26,eth0|172.30.0.1/16"
modify its memory settings
$ knife vserver modify memory containerhost.example.net -C testcontainer1 \
-R 2048 -S 4096
add an aditional IP Address
$ knife vserver add address containerhost.example.net -C testcontainer1 \
-I "eth0|192.168.100.2/24"
and remove it
$ knife vserver remove address containerhost.example.net -C testcontainer1 \
-I "192.168.100.2/24"
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request