Add nova ssh key for vm resize 91/17191/5
authorMichael Chapman <michapma@redhat.com>
Tue, 19 Jul 2016 20:41:32 +0000 (16:41 -0400)
committerMichael Chapman <michapma@redhat.com>
Thu, 21 Jul 2016 21:39:10 +0000 (17:39 -0400)
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>
build/opnfv-environment.yaml
ci/PR_revision.log
lib/overcloud-deploy-functions.sh

index 61915c9..3d246bd 100644 (file)
@@ -11,6 +11,12 @@ parameters:
   EnableTacker: false
   ExtraConfig:
     tripleo::ringbuilder::build_ring: False
+    nova::nova_public_key:
+      type: 'ssh-rsa'
+      replace_public_key:
+    nova::nova_private_key:
+      type: 'ssh-rsa'
+      replace_private_key:
     nova::policy::policies:
       nova-os_compute_api:servers:show:host_status:
         key: 'os_compute_api:servers:show:host_status'
index de684ef..95d64aa 100644 (file)
@@ -16,3 +16,4 @@
 40,Move mongo to step 1
 42, congress typo
 44,Fixes nova host/ip bug
+43,Add support for live migration and resize
index 14c3724..75c5314 100755 (executable)
@@ -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