+create_k8scluster(){
+ attempts=3
+ while [ $attempts -ge 0 ] ; do
+ echo -e "\n$( date '+%F_%H:%M:%S' ) Creating K8s Cluster"
+
+ osm k8scluster-add --creds ${K8S_CREDENTIALS} --version "v1" --vim ${VIM_TARGET} --k8s-nets "{\"net1\": \"${VIM_MGMT_NET}\"}" ${VIM_TARGET} --description "Robot cluster" --skip-jujubundle
+
+ STATUS=""
+ i=0
+ while [[ ${STATUS} != "ENABLED" ]]
+ do
+ ((i++))
+ if [[ $i -eq 5 ]]; then
+ echo "K8s cluster stuck for more than 50 seconds:"
+ osm k8scluster-show ${VIM_TARGET}
+ osm k8scluster-delete ${VIM_TARGET}
+ sleep 5
+ break
+ fi
+ sleep 10
+ STATUS=`osm k8scluster-list | grep ${VIM_TARGET} | awk '{print $8}'`
+ done
+ if [[ ${STATUS} = "ENABLED" ]] ; then
+ break
+ fi
+ ((attempts--))
+ done
+ if [ $attempts -lt 0 ] ; then
+ echo "K8s cluster failed to enter ENABLED state"
+ exit 1
+ fi
+}
+
+create_vim(){