switched container engine to lxc

This commit is contained in:
Marc Aymerich 2017-06-09 08:26:40 +00:00
parent 35c7265bff
commit 25fbc6a088
2 changed files with 23 additions and 2 deletions

View File

@ -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

View File

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