summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apex/deploy.py9
-rw-r--r--apex/undercloud/undercloud.py7
2 files changed, 11 insertions, 5 deletions
diff --git a/apex/deploy.py b/apex/deploy.py
index c374e2e4..6866945b 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -64,7 +64,8 @@ def validate_cross_settings(deploy_settings, net_settings, inventory):
# "$tenant_nic_mapping_compute_members
-def build_vms(inventory, network_settings):
+def build_vms(inventory, network_settings,
+ template_dir='/usr/share/opnfv-apex'):
"""
Creates VMs and configures vbmc and host
:param inventory:
@@ -82,7 +83,8 @@ def build_vms(inventory, network_settings):
name, volume_path,
baremetal_interfaces=network_settings.enabled_network_list,
memory=node['memory'], cpus=node['cpu'],
- macs=[node['mac_address']])
+ macs=[node['mac_address']],
+ template_dir=template_dir)
virt_utils.host_setup({name: node['pm_port']})
@@ -288,7 +290,7 @@ def main():
uc_external = True
if args.virtual:
# create all overcloud VMs
- build_vms(inventory, net_settings)
+ build_vms(inventory, net_settings, args.deploy_dir)
else:
# Attach interfaces to jumphost for baremetal deployment
jump_networks = ['admin']
@@ -315,6 +317,7 @@ def main():
else:
root_pw = None
undercloud = uc_lib.Undercloud(args.image_dir,
+ args.deploy_dir,
root_pw=root_pw,
external_network=uc_external)
undercloud.start()
diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py
index 7efc2cb3..a1af4d00 100644
--- a/apex/undercloud/undercloud.py
+++ b/apex/undercloud/undercloud.py
@@ -27,13 +27,15 @@ class Undercloud:
"""
This class represents an Apex Undercloud VM
"""
- def __init__(self, image_path, root_pw=None, external_network=False):
+ def __init__(self, image_path, template_path,
+ root_pw=None, external_network=False):
self.ip = None
self.root_pw = root_pw
self.external_net = external_network
self.volume = os.path.join(constants.LIBVIRT_VOLUME_PATH,
'undercloud.qcow2')
self.image_path = image_path
+ self.template_path = template_path
self.vm = None
if Undercloud._get_vm():
logging.error("Undercloud VM already exists. Please clean "
@@ -60,7 +62,8 @@ class Undercloud:
direct_boot='overcloud-full',
kernel_args=['console=ttyS0',
'root=/dev/sda'],
- default_network=True)
+ default_network=True,
+ template_dir=self.template_path)
self.setup_volumes()
self.inject_auth()