summaryrefslogtreecommitdiffstats
path: root/deploy/environment.py
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-05-09 11:11:53 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-05-10 23:14:42 +0800
commitfb09a7ed97707b6a007721ff4b72a904c4204e93 (patch)
treeba626025fdb12d185a183521c9313dea5a14976f /deploy/environment.py
parent568edb9d5ed462672d5a5c53ac735e04d8f687c4 (diff)
refacort deploy.yml and add jsonschema to validate it
1. add adapter type in deploy.yml Do not rely on the pod's name to detemine whether impi or libvirt should be used. 2. increase disk size in deploy.yml The disk sizes should be bigger than 102400 mega-bytes according to the minimum of root_lv_size in upstream openstack/daisycloud-core. 3. add schemas.py Use jsonschema to validate deploy.yml Change-Id: I3f197f93403caece75460147c8df49b95e0ae9d3 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/environment.py')
-rw-r--r--deploy/environment.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/deploy/environment.py b/deploy/environment.py
index 088e5008..21a0970a 100644
--- a/deploy/environment.py
+++ b/deploy/environment.py
@@ -11,6 +11,9 @@ import os
import shutil
import time
+from config.schemas import (
+ MIN_NODE_DISK_SIZE,
+)
from daisy_server import (
DaisyServer
)
@@ -183,8 +186,9 @@ class VirtualEnvironment(DaisyEnvironmentBase):
def create_virtual_node(self, node):
name = node['name']
roles = node['roles']
- controller_size = self.deploy_struct.get('disks', {'controller': 200}).get('controller')
- compute_size = self.deploy_struct.get('disks', {'compute': 200}).get('compute')
+ disks = self.deploy_struct.get('disks', {})
+ controller_size = disks.get('controller', MIN_NODE_DISK_SIZE)
+ compute_size = disks.get('compute', MIN_NODE_DISK_SIZE)
LI('Begin to create virtual node %s, roles %s' % (name, roles))
if 'CONTROLLER_LB' in roles:
@@ -201,9 +205,6 @@ class VirtualEnvironment(DaisyEnvironmentBase):
if 'template' in node:
template = node['template']
disk_file = path_join(self.storage_dir, name + '.qcow2')
- # TODO: modify the sizes in deploy.yml to more than 100G
- if size < 200:
- size = 200
create_virtual_disk(disk_file, size)
create_vm(template, name, disk_file)