diff options
Diffstat (limited to 'deploy/environment.py')
-rw-r--r-- | deploy/environment.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/deploy/environment.py b/deploy/environment.py index 21a0970a..d18bf550 100644 --- a/deploy/environment.py +++ b/deploy/environment.py @@ -13,6 +13,7 @@ import time from config.schemas import ( MIN_NODE_DISK_SIZE, + MIN_CEPH_DISK_SIZE ) from daisy_server import ( DaisyServer @@ -176,7 +177,7 @@ class VirtualEnvironment(DaisyEnvironmentBase): create_vm(template, name=self.daisy_server_info['name'], - disk_file=self.daisy_server_info['image']) + disks=[self.daisy_server_info['image']]) def create_daisy_server(self): self.create_daisy_server_image() @@ -206,7 +207,16 @@ class VirtualEnvironment(DaisyEnvironmentBase): template = node['template'] disk_file = path_join(self.storage_dir, name + '.qcow2') create_virtual_disk(disk_file, size) - create_vm(template, name, disk_file) + + disks = [disk_file] + ceph_disk_name = self.deploy_struct.get('ceph_disk_name', '') + if ceph_disk_name and ceph_disk_name != '/dev/sda' and 'CONTROLLER_LB' in roles: + ceph_size = self.deploy_struct.get('disks', {}).get('ceph', MIN_CEPH_DISK_SIZE) + ceph_disk_file = path_join(self.storage_dir, name + '_data.qcow2') + create_virtual_disk(ceph_disk_file, ceph_size) + disks.append(ceph_disk_file) + + create_vm(template, name, disks) def create_nodes(self): # TODO: support virtNetTemplatePath in deploy.yml |