summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2017-08-24 14:03:43 -0400
committerDan Radez <dradez@redhat.com>2017-08-28 09:29:40 -0400
commit614d9d9b9f242a7a55fb3963395f4a5fe3edb8fe (patch)
tree855f4bca901b8f67470581f36685a437709a3e09
parent2af337a7d3a26a034a94f3698b1b1b3512d2c135 (diff)
Passing deploy_dir through to create_vm
Change-Id: I07a1c899d43c5edf1054fc819fff4336d9b3ed16 Signed-off-by: Dan Radez <dradez@redhat.com>
-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 6a08b36f..7900170b 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']})
@@ -284,7 +286,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']
@@ -311,6 +313,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()