From b3c610b205f88dddb02cdac39638c52eafaaf82c Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Tue, 12 Sep 2017 17:32:56 -0400 Subject: Adds ability to deploy from upstream openstack To deploy with upstream openstack branch, use new deploy setting 'os_version'. A default scenario file for nosdn with pike has been included in this patch. If 'os_version' is a version other than the default version for this OPNFV release, then upstream is used. In order to use upstream with the current OS version use '--upstream' argument to the deploy command, to force an upstream deployment. Also include '-e upstream-environment.yaml' to use default upstream deployment settings. Supports nosdn and odl-nofeature deployments. Change-Id: Ic07e308827b449637b4e86cdd086434e4de2fb69 Signed-off-by: Tim Rozet --- apex/undercloud/undercloud.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apex/undercloud') diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py index 50035638..5d73dd49 100644 --- a/apex/undercloud/undercloud.py +++ b/apex/undercloud/undercloud.py @@ -30,13 +30,15 @@ class Undercloud: This class represents an Apex Undercloud VM """ def __init__(self, image_path, template_path, - root_pw=None, external_network=False): + root_pw=None, external_network=False, + image_name='undercloud.qcow2'): 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.image_name = image_name self.template_path = template_path self.vm = None if Undercloud._get_vm(): @@ -134,9 +136,14 @@ class Undercloud: def setup_volumes(self): for img_file in ('overcloud-full.vmlinuz', 'overcloud-full.initrd', - 'undercloud.qcow2'): + self.image_name): src_img = os.path.join(self.image_path, img_file) - dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH, img_file) + if img_file == self.image_name: + dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH, + 'undercloud.qcow2') + else: + dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH, + img_file) if not os.path.isfile(src_img): raise ApexUndercloudException( "Required source file does not exist:{}".format(src_img)) @@ -147,7 +154,6 @@ class Undercloud: # TODO(trozet):check if resize needed right now size is 50gb # there is a lib called vminspect which has some dependencies and is # not yet available in pip. Consider switching to this lib later. - # execute ansible playbook def inject_auth(self): virt_ops = list() -- cgit 1.2.3-korg