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, 'object_id': vps.id,
'hostname': vps.hostname, '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', VPS_TYPES = Setting('VPS_TYPES',
( (
('openvz', 'OpenVZ container'), ('openvz', 'OpenVZ container'),
('lxc', 'LXC container')
), ),
validators=[Setting.validate_choices] validators=[Setting.validate_choices]
) )
VPS_DEFAULT_TYPE = Setting('VPS_DEFAULT_TYPE', VPS_DEFAULT_TYPE = Setting('VPS_DEFAULT_TYPE',
'openvz', 'lxc',
choices=VPS_TYPES choices=VPS_TYPES
) )
@ -18,13 +19,14 @@ VPS_DEFAULT_TYPE = Setting('VPS_DEFAULT_TYPE',
VPS_TEMPLATES = Setting('VPS_TEMPLATES', VPS_TEMPLATES = Setting('VPS_TEMPLATES',
( (
('debian7', 'Debian 7 - Wheezy'), ('debian7', 'Debian 7 - Wheezy'),
('placeholder', 'LXC placeholder')
), ),
validators=[Setting.validate_choices] validators=[Setting.validate_choices]
) )
VPS_DEFAULT_TEMPLATE = Setting('VPS_DEFAULT_TEMPLATE', VPS_DEFAULT_TEMPLATE = Setting('VPS_DEFAULT_TEMPLATE',
'debian7', 'placeholder',
choices=VPS_TEMPLATES choices=VPS_TEMPLATES
) )