summaryrefslogtreecommitdiffstats
path: root/apex/overcloud
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-12-05 09:35:52 -0500
committerTim Rozet <trozet@redhat.com>2018-12-06 11:40:26 -0500
commit31e6f7f5529d04f12caabe804bfef305b5f263e8 (patch)
tree7edf6a3b2e5aeb3d04f8e845abeada93f40bb8df /apex/overcloud
parentea88285a511f7aa13cff3d491e143d17188b700f (diff)
Enable CSIT deployments to use NFS backend
In order to support HA as well as live migration a shared storage backend needs to be used. This patch preps the overcloud image to start with an NFS server sharing out of /root/nfs. If csit environment file is used then NFS parameters will be passed to the deployment, configuring Nova and Glance to use NFS hosted by controller0. JIRA: APEX-654 Change-Id: I049d84bfd454013fc7ba5048939ee17100197624 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/overcloud')
-rw-r--r--apex/overcloud/deploy.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py
index e3177065..41b2d56b 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -205,6 +205,8 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir,
else:
deploy_options.append(os.path.join(con.THT_ENV_DIR, v))
+ # TODO(trozet) Fix this check to look for if ceph is in controller services
+ # and not use name of the file
if ds_opts['ceph'] and 'csit' not in env_file:
prep_storage_env(ds, ns, virtual, tmp_dir)
deploy_options.append(os.path.join(con.THT_ENV_DIR,
@@ -434,6 +436,23 @@ def prep_image(ds, ns, img, tmp_dir, root_pw=None, docker_tag=None,
virt_cmds.append(
{con.VIRT_RUN_CMD: "crudini --del {} Unit "
"ConditionPathExists".format(dhcp_unit)})
+ # Prep for NFS
+ virt_cmds.extend([
+ {con.VIRT_INSTALL: "nfs-utils"},
+ {con.VIRT_RUN_CMD: "ln -s /usr/lib/systemd/system/nfs-server.service "
+ "/etc/systemd/system/multi-user.target.wants/"
+ "nfs-server.service"},
+ {con.VIRT_RUN_CMD: "mkdir -p /root/nfs/glance"},
+ {con.VIRT_RUN_CMD: "mkdir -p /root/nfs/cinder"},
+ {con.VIRT_RUN_CMD: "mkdir -p /root/nfs/nova"},
+ {con.VIRT_RUN_CMD: "echo '/root/nfs/glance *(rw,sync,"
+ "no_root_squash,no_acl)' > /etc/exports"},
+ {con.VIRT_RUN_CMD: "echo '/root/nfs/cinder *(rw,sync,"
+ "no_root_squash,no_acl)' >> /etc/exports"},
+ {con.VIRT_RUN_CMD: "echo '/root/nfs/nova *(rw,sync,"
+ "no_root_squash,no_acl)' >> /etc/exports"},
+ {con.VIRT_RUN_CMD: "exportfs -avr"},
+ ])
virt_utils.virt_customize(virt_cmds, tmp_oc_image)
logging.info("Overcloud image customization complete")
return patched_containers