No description
Find a file
2015-12-14 05:02:08 +03:00
auth-keys add new folders 2015-12-05 05:18:37 +07:00
configs add new folders 2015-12-05 05:18:37 +07:00
lxc container status report 2015-12-14 05:02:08 +03:00
node container status report 2015-12-14 05:02:08 +03:00
.gitignore add config.py to ignorefile 2015-12-02 01:42:53 +03:00
cloud_node_agent.py container_delete 2015-12-05 16:00:16 +03:00
cloud_node_statistics.py container status report 2015-12-14 05:02:08 +03:00
config.py.origin add config template 2015-12-02 01:42:21 +03:00
README.md init 2015-12-01 02:32:52 +03:00

Version: 1.0

Install

$ apt-get install sqlite3
$ apt-get install lxc
$ apt-get install python-pip
$ pip install pylxc
$ pip install simplejson
$ pip install pyparsing
$ apt-get install dnsmasq

Setting DNSMASQ

Uncomment string in file /etc/dnsmasq.conf:

conf-file=/etc/lxc/dnsmasq.conf

Create config file and create simlink:

touch /etc/lxc/dnsmasq.conf

Change some lines in file: /etc/default/lxc

LXC_AUTO="true"
LXC_SHUTDOWN_TIMEOUT=120

Change some lines in file: /etc/default/lxc-net

USE_LXC_BRIDGE="true"
...
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
...
LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf
...
LXC_DOMAIN="container.ly"
...

Firewall

Forwarding

nano /etc/sysctl.conf

net.ipv4.ip_forward=1

UFW

nano /etc/default/ufw

and change string

DEFAULT_FORWARD_POLICY="DROP"

to

DEFAULT_FORWARD_POLICY="ACCEPT"

$ ufw allow 22
$ ufw allow 5555
$ ufw allow 7001
$ ufw enable

Requests

task_get task_update report_container_status report_container_info

Methods

container_create container_destroy container_start container_stop container_restart container_clone

service_mx_add service_mx_delete

service_web_add service_web_delete service_web_update

service_ssh_allow service_ssh_deny

Using

For execute task from central server (create, start, stop and destroy container)

python client.py

For collect information about containers and host-system into local database

python logger.py

API

List containers

lxc().list()

Check exists container with name 'test'

lxc().exists("control.container.ly")

Start container

lxc().start("control.container.ly")