No description
Find a file
2016-10-13 04:12:29 +03:00
extra 62: Определение подходящего сетевого интервейса по имеющемуся ipv4 2016-06-02 03:29:36 +03:00
SWSCloudNode fix stats 2016-10-12 23:34:07 +03:00
vm added sudoer user administrator 2016-06-15 15:35:19 +03:00
.gitignore add *.egg-info to ignore file 2016-05-22 12:30:42 +03:00
cloud_node_agent.py fix 2016-10-12 03:19:11 +03:00
cloud_node_statistics.py fix statistics report 2016-10-13 04:12:29 +03:00
cloudcli.py new version with QEMU 2016-05-07 18:29:28 +03:00
README.md new version with QEMU 2016-05-07 18:29:28 +03:00
setup.py fix statistics report 2016-10-13 04:12:29 +03:00
test.py new version with QEMU 2016-05-07 18:29:28 +03:00

SWSCloudNode

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

Develop

Publish to Pypi server

python setup.py sdist register -r local upload -r local