fi
         if [ ! -e ./labconfig.yaml ]; then
             virtinstall=1
+            labname="default"
+            cp ../labconfig/default/deployment.yaml ./
+            cp ../labconfig/default/labconfig.yaml ./
+            cp ../labconfig/default/deployconfig.yaml ./
         else
             python genMAASConfig.py -l labconfig.yaml > deployment.yaml
             python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
         ;;
     * )
         virtinstall=1
+        labname="default"
+        cp ../labconfig/default/deployment.yaml ./
+        cp ../labconfig/default/labconfig.yaml ./
+        cp ../labconfig/default/deployconfig.yaml ./
         ;;
 esac
 
 
 # In the case of a virtual deployment get deployment.yaml and deployconfig.yaml
 if [ "$virtinstall" -eq 1 ]; then
-    labname="default"
     MAAS_IP="192.168.122.1"
     API_SERVER="http://$MAAS_IP/MAAS/api/2.0"
     API_SERVERMAAS="http://$MAAS_IP/MAAS/"
     PRIMARY_RACK_CONTROLLER="$MAAS_IP"
     ./cleanvm.sh || true
-    cp ../labconfig/default/deployment.yaml ./
-    cp ../labconfig/default/labconfig.yaml ./
-    cp ../labconfig/default/deployconfig.yaml ./
 fi
 
+#create backup directory
+mkdir ~/joid_config/ || true
+
+# Backup deployment.yaml and deployconfig.yaml in joid_config folder
+
+if [ -e ./deployconfig.yaml ]; then
+    cp ./deployconfig.yaml ~/joid_config/
+    cp ./labconfig.yaml ~/joid_config/
+fi
+
+if [ -e ./deployment.yaml ]; then
+    cp ./deployment.yaml ~/joid_config/
+fi
+
+
 #
 # Prepare local environment to avoid password asking
 #
     sudo pip uninstall google-api-python-client
 fi
 
-#create backup directory
-mkdir ~/joid_config/ || true
-mkdir ~/.juju/ || true
 
 if [ ! -e ~maas/.ssh/id_rsa.pub ]; then
     sudo su - $USER -c "echo |ssh-keygen -t rsa -f $HOME/id_rsa_maas"
 
 echo "... Deployment of maas finish ...."
 
-# Backup deployment.yaml and deployconfig.yaml in .juju folder
-
-#cp ./environments.yaml ~/.juju/
-#cp ./environments.yaml ~/joid_config/
-
-if [ -e ./deployconfig.yaml ]; then
-    cp ./deployconfig.yaml ~/.juju/
-    cp ./labconfig.yaml ~/.juju/
-    cp ./deployconfig.yaml ~/joid_config/
-    cp ./labconfig.yaml ~/joid_config/
-fi
-
-if [ -e ./deployment.yaml ]; then
-    cp ./deployment.yaml ~/.juju/
-    cp ./deployment.yaml ~/joid_config/
-fi
-
 #Added the Qtip public to run the Qtip test after install on bare metal nodes.
 #maas $PROFILE sshkeys new key="`cat ./maas/sshkeys/QtipKey.pub`"
 #maas $PROFILE sshkeys new key="`cat ./maas/sshkeys/DominoKey.pub`"
 #
 
 #read interface needed in Auto mode and enable it. Will be rmeoved once auto enablement will be implemented in the maas-deployer.
-if [ -e ~/joid_config/deployconfig.yaml ]; then
-  cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml
-elif [ -e ~/.juju/deployconfig.yaml ]; then
-  cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
-fi
 
 if [ -e ./deployconfig.yaml ]; then
   enableiflist=`grep "interface-enable" deployconfig.yaml | cut -d ' ' -f 4 `
 
 
 set -ex
 
-if [ ! -d environments.yaml ]; then
-    cp ~/joid_config/environments.yaml ./environments.yaml || true
-    cp ~/.juju/environments.yaml ./environments.yaml || true
-fi
+jujuver=`juju --version`
 
-if [ ! -d deployment.yaml ]; then
-    cp ~/joid_config/deployment.yaml ./deployment.yaml || true
-    cp ~/.juju/deployment.yaml ./deployment.yaml || true
+if [[ "$jujuver" > "2" ]]; then
+    if [ ! -d labconfig.yaml ]; then
+        cp ~/joid_config/deployment.yaml ./deployment.yaml || true
+        cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
+        cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
+    fi
+else
+    if [ ! -d environments.yaml ]; then
+        cp ~/joid_config/environments.yaml ./environments.yaml || true
+        cp ~/.juju/environments.yaml ./environments.yaml || true
+    fi
 fi
 
-jujuver=`juju --version`
 
 if [[ "$jujuver" > "2" ]]; then
     controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployment.yaml`
 
 sudo virsh undefine node4-control || true
 sudo virsh undefine node2-compute || true
 sudo virsh undefine node5-compute || true
-sudo rm -rf  /var/lib/libvirt/images/node1-control.img /var/lib/libvirt/images/node2-compute.img /var/lib/libvirt/images/node3-control.img /var/lib/libvirt/images/node4-control.img /var/lib/libvirt/images/node5-compute.img || true
+sudo rm -rf  /var/lib/libvirt/images/node1-control.qcow2 /var/lib/libvirt/images/node2-compute.qcow2 /var/lib/libvirt/images/node3-control.qcow2 /var/lib/libvirt/images/node4-control.qcow2 /var/lib/libvirt/images/node5-compute.qcow2 || true
  
 if [[ "$maasver" > "2" ]]; then
     sudo virsh destroy bootstrap || true
     sudo virsh undefine bootstrap || true
-    sudo rm -rf  /var/lib/libvirt/images/bootstrap.img || true
+    sudo rm -rf  /var/lib/libvirt/images/bootstrap.qcow2 || true
 fi
 
 echo " Cleanup Finished ..."
 
 #copy the files and create extra resources needed for HA deployment
 # in case of default VM labs.
 deploy() {
-
+  if [ ! -f ./deployment.yaml ] && [ -e ~/.juju/deployment.yaml ]; then
+      cp ~/.juju/deployment.yaml ./deployment.yaml
+  elif [ ! -f ./deployment.yaml ] && [ -e ~/joid_config/deployment.yaml ]; then
+      cp ~/joid_config/deployment.yaml ./deployment.yaml
+  fi
+
+  if [[ "$jujuver" > "2" ]]; then
+    if [ ! -f ./labconfig.yaml ] && [ -e ~/joid_config/labconfig.yaml ]; then
+        cp ~/joid_config/labconfig.yaml ./labconfig.yaml
+    fi
+    if [ ! -f ./deployconfig.yaml ] && [ -e ~/joid_config/deployconfig.yaml ]; then
+        cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml
+    fi
+  else
     if [ ! -f ./environments.yaml ] && [ -e ~/.juju/environments.yaml ]; then
         cp ~/.juju/environments.yaml ./environments.yaml
     elif [ ! -f ./environments.yaml ] && [ -e ~/joid_config/environments.yaml ]; then
         cp ~/joid_config/environments.yaml ./environments.yaml
     fi
-    if [ ! -f ./deployment.yaml ] && [ -e ~/.juju/deployment.yaml ]; then
-        cp ~/.juju/deployment.yaml ./deployment.yaml
-    elif [ ! -f ./deployment.yaml ] && [ -e ~/joid_config/deployment.yaml ]; then
-        cp ~/joid_config/deployment.yaml ./deployment.yaml
-    fi
-    if [ ! -f ./labconfig.yaml ] && [ -e ~/.juju/labconfig.yaml ]; then
-        cp ~/.juju/labconfig.yaml ./labconfig.yaml
-    elif [ ! -f ./labconfig.yaml ] && [ -e ~/joid_config/labconfig.yaml ]; then
-        cp ~/joid_config/labconfig.yaml ./labconfig.yaml
-    fi
-    if [ ! -f ./deployconfig.yaml ] && [ -e ~/.juju/deployconfig.yaml ]; then
-        cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
-    elif [ ! -f ./deployconfig.yaml ] && [ -e ~/joid_config/deployconfig.yaml ]; then
-        cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml
-    fi
-
     #copy the script which needs to get deployed as part of ofnfv release
     echo "...... deploying now ......"
     echo "   " >> environments.yaml
     echo "        enable-os-upgrade: false" >> environments.yaml
     echo "        admin-secret: admin" >> environments.yaml
     echo "        default-series: $opnfvdistro" >> environments.yaml
-
     cp environments.yaml ~/.juju/
     cp environments.yaml ~/joid_config/
+  fi
+
+
 
     if [[ "$opnfvtype" = "ha" && "$opnfvlab" = "default" ]]; then
         createresource