summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/installer/domain.xml36
-rw-r--r--lib/python/apex/deploy_env.py30
-rw-r--r--lib/python/apex/ip_utils.py6
-rw-r--r--lib/python/apex/network_environment.py1
4 files changed, 61 insertions, 12 deletions
diff --git a/lib/installer/domain.xml b/lib/installer/domain.xml
new file mode 100644
index 00000000..c710e561
--- /dev/null
+++ b/lib/installer/domain.xml
@@ -0,0 +1,36 @@
+<domain type='%(engine)s'>
+ <name>%(name)s</name>
+ <memory unit='KiB'>%(memory)s</memory>
+ <vcpu>%(cpus)s</vcpu>
+ <cpu mode='host-passthrough'/>
+ <os>
+ <type arch='%(arch)s'>hvm</type>
+ <boot dev='%(bootdev)s'/>
+ <bootmenu enable='no'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <controller type='scsi' model='virtio-scsi' index='0'/>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2' cache='unsafe'/>
+ <source file='%(imagefile)s'/>
+ <target dev='sda' bus='%(diskbus)s'/>
+ </disk>
+ %(network)s
+ %(bm_network)s
+ %(enable_serial_console)s
+ <input type='mouse' bus='ps2'/>
+ <graphics type='vnc' port='-1' autoport='yes'/>
+ <video>
+ <model type='cirrus' vram='9216' heads='1'/>
+ </video>
+ </devices>
+</domain>
diff --git a/lib/python/apex/deploy_env.py b/lib/python/apex/deploy_env.py
index be8779a9..25e2d0a7 100644
--- a/lib/python/apex/deploy_env.py
+++ b/lib/python/apex/deploy_env.py
@@ -15,6 +15,7 @@ REQ_DEPLOY_SETTINGS = ['sdn_controller',
'sdn_l3',
'tacker',
'congress',
+ 'dataplane',
'sfc',
'vpn']
@@ -22,6 +23,7 @@ OPT_DEPLOY_SETTINGS = ['performance']
VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage']
VALID_PERF_OPTS = ['kernel','nova']
+VALID_DATAPLANES = ['ovs','ovs_dpdk','fdio']
class DeploySettings:
"""
@@ -45,23 +47,33 @@ class DeploySettings:
if 'deploy_options' not in self.deploy_settings:
raise DeploySettingsException("No deploy options provided in"
- "deploy settings file")
+ " deploy settings file")
if 'global_params' not in self.deploy_settings:
raise DeploySettingsException("No global options provided in"
- "deploy settings file")
+ " deploy settings file")
deploy_options = self.deploy_settings['deploy_options']
if not isinstance(deploy_options, dict):
raise DeploySettingsException("deploy_options should be a list")
- for option in deploy_options:
- if option not in REQ_DEPLOY_SETTINGS + OPT_DEPLOY_SETTINGS:
+ for setting, value in deploy_options.items():
+ if setting not in REQ_DEPLOY_SETTINGS + OPT_DEPLOY_SETTINGS:
raise DeploySettingsException("Invalid deploy_option {} "
- "specified".format(option))
-
- for required_setting in REQ_DEPLOY_SETTINGS:
- if required_setting not in deploy_options:
- self.deploy_settings['deploy_options'][required] = False
+ "specified".format(setting))
+ if setting == 'dataplane':
+ if value not in VALID_DATAPLANES:
+ planes = ' '.join(VALID_DATAPLANES)
+ raise DeploySettingsException("Invalid dataplane {} "
+ "specified. Valid dataplanes:"
+ " {}".format(value,planes))
+
+
+ for req_set in REQ_DEPLOY_SETTINGS:
+ if req_set not in deploy_options:
+ if req_set == 'dataplane':
+ self.deploy_settings['deploy_options'][req_set] = 'ovs'
+ else:
+ self.deploy_settings['deploy_options'][req_set] = False
if 'performance' in deploy_options:
if not isinstance(deploy_options['performance'], dict):
diff --git a/lib/python/apex/ip_utils.py b/lib/python/apex/ip_utils.py
index d7099db5..f51f227a 100644
--- a/lib/python/apex/ip_utils.py
+++ b/lib/python/apex/ip_utils.py
@@ -56,7 +56,7 @@ def get_ip_range(start_offset=None, count=None, end_offset=None,
end_index = -1 - end_offset
else:
raise IPUtilsException("Argument error: must pass in exactly 2 of"
- "start_offset, end_offset and count")
+ " start_offset, end_offset and count")
start_ip = cidr[start_index]
end_ip = cidr[end_index]
@@ -77,7 +77,7 @@ def get_ip_range(start_offset=None, count=None, end_offset=None,
else:
raise IPUtilsException(
"Argument error: must pass in exactly 2 of"
- "start_offset, end_offset and count")
+ " start_offset, end_offset and count")
else:
if count and start_offset and not end_offset:
start_ip = network[start_offset]
@@ -91,7 +91,7 @@ def get_ip_range(start_offset=None, count=None, end_offset=None,
else:
raise IPUtilsException(
"Argument error: must pass in exactly 2 of"
- "start_offset, end_offset and count")
+ " start_offset, end_offset and count")
else:
raise IPUtilsException("Must pass in cidr or interface to generate"
diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py
index 4bab34c9..c9b7d3cc 100644
--- a/lib/python/apex/network_environment.py
+++ b/lib/python/apex/network_environment.py
@@ -82,6 +82,7 @@ class NetworkEnvironment:
net_settings[constants.PUBLIC_NETWORK]['gateway']
self.netenv_obj[param_def]['EC2MetadataIp'] = \
net_settings[constants.ADMIN_NETWORK]['provisioner_ip']
+ self.netenv_obj[param_def]['DnsServers'] = net_settings['dns_servers']
if constants.PRIVATE_NETWORK in enabled_networks:
priv_range = net_settings[constants.PRIVATE_NETWORK][