summaryrefslogtreecommitdiffstats
path: root/deploy/environment.py
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-05-12 00:08:01 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-05-15 22:44:38 +0800
commitbfacd100e576a50be19447f7c1b6cea2ac55ebd0 (patch)
treed9bc28d621e1a327ce7758845d4310cd5eff4a2f /deploy/environment.py
parentcbdb2b6ab819f1cad4cfcdc47c53d76030305633 (diff)
add separated disk for ceph in multi-nodes virtual deploy
Change-Id: Ic3f67bb889c20e95916a1052f0cfa1e238f133a8 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/environment.py')
-rw-r--r--deploy/environment.py14
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