From: Rihab Banday Date: Wed, 19 Aug 2020 07:35:35 +0000 (+0000) Subject: Merge ""Better" pattern matching for name of jump VM" X-Git-Tag: opnfv-10.0.0~27 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=90ff3b4def93e228423f515a6e98466a5cd78727;hp=-c;p=kuberef.git Merge ""Better" pattern matching for name of jump VM" --- 90ff3b4def93e228423f515a6e98466a5cd78727 diff --combined functions.sh index fd19209,55edfbf..7d867cd --- a/functions.sh +++ b/functions.sh @@@ -10,10 -10,10 +10,10 @@@ # Clean up clean_up() { - if sudo virsh list --all | grep "${VM_NAME}.*running" ; then + if sudo virsh list --all | grep " ${VM_NAME} .*running" ; then sudo virsh destroy "$VM_NAME" fi - if sudo virsh list --all | grep "${VM_NAME}" ; then + if sudo virsh list --all | grep " ${VM_NAME} " ; then sudo virsh undefine "$VM_NAME" fi sudo rm -rf "/var/lib/libvirt/images/$VM_NAME" @@@ -46,8 -46,7 +46,8 @@@ EO # Create VM sudo genisoimage -output "/var/lib/libvirt/images/$VM_NAME/$VM_NAME-cidata.iso" \ -volid cidata -joliet -rock user-data meta-data - + sudo virt-customize -a "/var/lib/libvirt/images/$VM_NAME/$VM_NAME.qcow2" \ + --root-password password:"$ROOT_PASSWORD" sudo virt-install --connect qemu:///system --name "$VM_NAME" \ --ram 4096 --vcpus=4 --os-type linux --os-variant ubuntu16.04 \ --disk path="/var/lib/libvirt/images/$VM_NAME/$VM_NAME.qcow2",format=qcow2 \ @@@ -105,7 -104,7 +105,7 @@@ copy_files_jump() # Host Provisioning provision_hosts() { # shellcheck disable=SC2087 - ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF + ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install and run cloud-infra if [ ! -d "${PROJECT_ROOT}/engine" ]; then ssh-keygen -t rsa -N "" -f ${PROJECT_ROOT}/.ssh/id_rsa @@@ -128,7 -127,7 +128,7 @@@ setup_network() WORKER_IP=$(yq r "$CURRENTPATH"/hw_config/"$VENDOR"/pdf.yaml nodes.[1].interfaces.["$PXE_IF_INDEX"].address) # SSH to jumphost # shellcheck disable=SC2087 - ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF + ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF ssh -o StrictHostKeyChecking=no root@$MASTER_IP \ 'bash -s' < ${PROJECT_ROOT}/${VENDOR}/setup_network.sh ssh -o StrictHostKeyChecking=no root@$WORKER_IP \ @@@ -139,7 -138,7 +139,7 @@@ EO # k8s Provisioning (currently BMRA) provision_k8s() { # shellcheck disable=SC2087 - ssh -tT "$USERNAME"@"$(get_vm_ip)" << EOF + ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install BMRA if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then curl -fsSL https://get.docker.com/ | sh