From 25fbc6a0885e165befe86be6e0b32c783bcddcbf Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Fri, 9 Jun 2017 08:26:40 +0000 Subject: [PATCH] switched container engine to lxc --- orchestra/contrib/vps/backends.py | 19 +++++++++++++++++++ orchestra/contrib/vps/settings.py | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/orchestra/contrib/vps/backends.py b/orchestra/contrib/vps/backends.py index 2ead22c3..8b817b40 100644 --- a/orchestra/contrib/vps/backends.py +++ b/orchestra/contrib/vps/backends.py @@ -133,3 +133,22 @@ class ProxmoxOpenVZTraffic(ServiceMonitor): 'object_id': vps.id, 'hostname': vps.hostname, } + + +class LxcController(ServiceController): + model = 'vps.VPS' + + RESOURCES = ( + ('memory', 'mem'), + ('disk', 'disk'), + ('vcpu', 'vcpu') + ) + + def prepare(self): + super(LxcController, self).prepare() + + def save(self, vps): + # TODO create the container + pass + + diff --git a/orchestra/contrib/vps/settings.py b/orchestra/contrib/vps/settings.py index 5e65fe34..ec0e2a1a 100644 --- a/orchestra/contrib/vps/settings.py +++ b/orchestra/contrib/vps/settings.py @@ -4,13 +4,14 @@ from orchestra.contrib.settings import Setting VPS_TYPES = Setting('VPS_TYPES', ( ('openvz', 'OpenVZ container'), + ('lxc', 'LXC container') ), validators=[Setting.validate_choices] ) VPS_DEFAULT_TYPE = Setting('VPS_DEFAULT_TYPE', - 'openvz', + 'lxc', choices=VPS_TYPES ) @@ -18,13 +19,14 @@ VPS_DEFAULT_TYPE = Setting('VPS_DEFAULT_TYPE', VPS_TEMPLATES = Setting('VPS_TEMPLATES', ( ('debian7', 'Debian 7 - Wheezy'), + ('placeholder', 'LXC placeholder') ), validators=[Setting.validate_choices] ) VPS_DEFAULT_TEMPLATE = Setting('VPS_DEFAULT_TEMPLATE', - 'debian7', + 'placeholder', choices=VPS_TEMPLATES )