Workaround vagrant-libvirt bug destroying VMs
[icn.git] / ci / jjb / shell / bluval.sh
index 87d5845..bfb6ff6 100644 (file)
@@ -10,7 +10,14 @@ git clone "https://gerrit.akraino.org/r/icn" ${WORKSPACE}/icn
 echo "[ICN] Bringing up test cluster"
 function clean_vm {
     pushd ${WORKSPACE}/icn
-    vagrant destroy -f
+    # TODO Vagrant has a known issue
+    # (https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1371)
+    # destroying the VMs, so destroy them manually here
+    vagrant destroy -f jump
+    virsh -c qemu:///system destroy vm-machine-1
+    virsh -c qemu:///system undefine --nvram --remove-all-storage vm-machine-1
+    virsh -c qemu:///system destroy vm-machine-2
+    virsh -c qemu:///system undefine --nvram --remove-all-storage vm-machine-2
     popd
 }
 trap clean_vm EXIT