Merge pull request #5559 from medyagh/cleanup_inaccessible

clean up inaccessible virtualbox
pull/5566/head
Medya Ghazizadeh 2019-10-07 22:33:24 -07:00 committed by GitHub
commit c5111ef3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -133,8 +133,15 @@ if type -P virsh; then
virsh -c qemu:///system list --all || true
fi
if type -P vboxmanage; then
vboxmanage list vms || true
# remove inaccessible stale VMs https://github.com/kubernetes/minikube/issues/4872
vboxmanage list vms \
| grep inaccessible \
| cut -d'"' -f3 \
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
|| true
vboxmanage list vms \
| egrep -o '{.*?}' \
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
@ -247,7 +254,7 @@ cleanup_stale_routes || true
${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true
${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true
rmdir "${TEST_HOME}"
${SUDO_PREFIX} rmdir "${TEST_HOME}" || true
echo ">> ${TEST_HOME} completed at $(date)"
if [[ "${MINIKUBE_LOCATION}" != "master" ]]; then