Set compute to qemu only in virtual deployment 47/35747/1
authorZhijiang Hu <hu.zhijiang@zte.com.cn>
Fri, 2 Jun 2017 14:45:39 +0000 (22:45 +0800)
committerZhijiang Hu <hu.zhijiang@zte.com.cn>
Fri, 2 Jun 2017 14:45:39 +0000 (22:45 +0800)
Change-Id: I0660c016e18491395c7253e5576f8fa1c8aa051e
Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
ci/deploy/deploy.sh
deploy/prepare.sh
deploy/prepare/execute.py

index acf99dd..c665e22 100755 (executable)
@@ -295,7 +295,7 @@ touch $WORKSPACE/known_hosts
 scp $WORKSPACE/known_hosts root@$DAISY_IP:/root/.ssh/
 
 echo "====== add relate config of kolla ======"
-ssh $SSH_PARAS $DAISY_IP "bash $REMOTE_SPACE/deploy/prepare.sh -n $NETWORK"
+ssh $SSH_PARAS $DAISY_IP "bash $REMOTE_SPACE/deploy/prepare.sh -n $NETWORK -b $IS_BARE"
 
 echo "====== prepare cluster and pxe ======"
 ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --cluster 'yes'"
index d68a6a4..803d246 100644 (file)
@@ -21,7 +21,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 usage: `basename $0` -n network_config_file
 
 OPTIONS:
-  -nw  network configuration path, necessary
+  -n  network configuration path, necessary
+  -b  0 for virtual, 1 for baremetal
   -h  Print this message and exit
 
 Description:
@@ -35,12 +36,15 @@ EOF
 
 NETWORK_CONF=''
 
-while getopts "n:h" OPTION
+while getopts "n:b:h" OPTION
 do
     case $OPTION in
         n)
             NETWORK_CONF=${OPTARG}
             ;;
+        b)
+            IS_BARE=${OPTARG}
+            ;;
         h)
             usage
             exit 0
@@ -53,4 +57,4 @@ do
     esac
 done
 
-python $PYTHONPATH/deploy/prepare/execute.py -nw $NETWORK_CONF
+python $PYTHONPATH/deploy/prepare/execute.py -nw $NETWORK_CONF -b $IS_BARE
index 67c31b1..2b46119 100644 (file)
@@ -39,7 +39,7 @@ def _config_service(service, subs):
 
 
 @_config_service('nova', ['compute'])
-def _set_default_compute():
+def _set_qemu_compute():
     return '[libvirt]\n' \
            'virt_type=qemu\n' \
            'cpu_mode=none\n'
@@ -65,8 +65,15 @@ def main():
                         type=str,
                         required=True,
                         help='network configuration file')
+    parser.add_argument('-b', '--is-baremetal',
+                        type=str,
+                        required=True,
+                        help='0 for virtual, 1 for baremetal')
     args = parser.parse_args()
-    _set_default_compute()
+
+    if args.is_baremetal == '0':
+        _set_qemu_compute()
+
     _set_default_floating_pool(args.network_file)
     _set_trusts_auth()