summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Chapman <michapma@redhat.com>2016-07-19 16:41:32 -0400
committerMichael Chapman <michapma@redhat.com>2016-07-21 17:39:10 -0400
commitffab5943f9f4c0ddf87004352791f2e852b9bdc4 (patch)
tree9e19a7fe709b829aef174277c3143b02644aec72 /lib
parent66f4a30987f870d5a6416b2c46c7dfb95130b4d9 (diff)
Add nova ssh key for vm resize
SSH keys for the nova account are required for the nova resize functionality. A new pair of keys is generated for each deploy. In addition, host keys are populated and a shell is provided to the nova user on all compute nodes via puppet. opnfv-tht-pr: 43 Change-Id: Ibde6877d279bc0b87553301fbce44975286cb092 JIRA: APEX-147 Signed-off-by: Michael Chapman <michapma@redhat.com>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/overcloud-deploy-functions.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh
index 14c37247..75c53149 100755
--- a/lib/overcloud-deploy-functions.sh
+++ b/lib/overcloud-deploy-functions.sh
@@ -203,6 +203,14 @@ if [ "${deploy_options_array['tacker']}" == 'True' ]; then
sed -i '/EnableTacker/\\c EnableTacker: true' opnfv-environment.yaml
fi
+# Create a key for use by nova for live migration
+echo "Creating nova SSH key for nova resize support"
+ssh-keygen -f nova_id_rsa -b 1024 -P ""
+public_key=\'\$(cat nova_id_rsa.pub | cut -d ' ' -f 2)\'
+sed -i "s#replace_public_key:#key: \$public_key#g" opnfv-environment.yaml
+python -c 'open("opnfv-environment-new.yaml", "w").write((open("opnfv-environment.yaml").read().replace("replace_private_key:", "key: \"" + "".join(open("nova_id_rsa").readlines()).replace("\\n","\\\n") + "\"")))'
+mv -f opnfv-environment-new.yaml opnfv-environment.yaml
+
source stackrc
set -o errexit
# Workaround for APEX-207 where sometimes swift proxy is down