xci: vm: start-new-vm: Copy deployment image to clean VM 01/58901/1
authorMarkos Chandras <mchandras@suse.de>
Fri, 22 Jun 2018 08:10:18 +0000 (09:10 +0100)
committerMarkos Chandras <mchandras@suse.de>
Fri, 22 Jun 2018 08:12:21 +0000 (09:12 +0100)
In order to save us some time and bandwidth we can copy the deployment
image to the clean VM in order to be used by bifrost to prepare the
virtual machines. Moreover, we also put our key there so we can ssh
as the root user.

Change-Id: Id21e19aaefde71862c21180129c664c1bf121c32
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/scripts/vm/start-new-vm.sh

index 8f6effe..ecc2998 100755 (executable)
@@ -353,6 +353,9 @@ $vm_ssh ${VM_NAME} "sudo mv /home/devuser/releng-xci/vm_hosts.txt /etc/hosts"
 # Disable 3-level nested virtualization since it makes things terribly slow
 $vm_ssh ${VM_NAME} "sudo bash -c 'echo \"options kvm_intel nested=0\" > /etc/modprobe.d/qemu-system-x86.conf'"
 $vm_ssh ${VM_NAME} "sudo modprobe -r kvm_intel && sudo modprobe -a kvm_intel"
+$vm_ssh ${VM_NAME} "sudo bash -c 'mkdir -p /root/.ssh && cat /home/devuser/.ssh/id_rsa.pub > /root/.ssh/authorized_keys'"
+$vm_ssh ${VM_NAME} "sudo bash -c 'mkdir -p /var/lib/libvirt/images'"
+rsync -a -e "$vm_ssh" --include "${BASE_PATH}/${XCI_DEPLOYMENT_IMAGE}*" --exclude '*' root@${VM_NAME}:/var/lib/libvirt/images/
 
 set +e