Merge "Add nova ssh key for vm resize"
authorTim Rozet <trozet@redhat.com>
Tue, 26 Jul 2016 19:22:55 +0000 (19:22 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 26 Jul 2016 19:22:55 +0000 (19:22 +0000)
1  2 
build/opnfv-environment.yaml
lib/overcloud-deploy-functions.sh

@@@ -8,9 -8,15 +8,15 @@@ parameters
    ControllerEnableSwiftStorage: false
  #  CloudDomain:
    EnableSahara: false
 -  EnableTacker: false
 +  EnableTacker: true
    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'
@@@ -199,10 -199,18 +199,18 @@@ if [ "$debug" == 'TRUE' ]; the
      LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex
  fi
  
 -if [ "${deploy_options_array['tacker']}" == 'True' ]; then
 -    sed -i '/EnableTacker/\\c  EnableTacker: true' opnfv-environment.yaml
 +if [ "${deploy_options_array['tacker']}" == 'False' ]; then
 +    sed -i '/EnableTacker:/c\  EnableTacker: false' 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