Skip to content

Commit

Permalink
Clean libvirt volumes and display license details when checking images (
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap authored Aug 10, 2020
1 parent 9e440a6 commit 28ea724
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: "*"
runs-on: [self-hosted, linux, x64]
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
stage:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
runs-on: [self-hosted, linux, x64]
needs: build-libvirt
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
stage:
Expand Down
24 changes: 16 additions & 8 deletions tools/cleanup_all_vms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ done < <(VBoxManage list hdds | grep '^UUID:')

test -d "${HOME}/VirtualBox VMs" && rm -rvf "${HOME}/VirtualBox VMs"

echo "*** Remove all libvirt instances"
for VM in $(virsh --connect=qemu:///system list --all --name); do
echo "*** ${VM}"
if virsh --connect=qemu:///system dominfo "${VM}" | grep -q running; then
virsh --connect=qemu:///system destroy "${VM}"
fi
virsh --connect=qemu:///system undefine --remove-all-storage "${VM}"
done
if command -v virsh &>/dev/null; then
echo "*** Remove all libvirt instances"
for VM in $(virsh --connect=qemu:///system list --all --name); do
echo "*** ${VM}"
if virsh --connect=qemu:///system dominfo "${VM}" | grep -q running; then
virsh --connect=qemu:///system destroy "${VM}"
fi
virsh --connect=qemu:///system undefine --remove-all-storage "${VM}"
done

echo "*** Remove all libvirt disks"
for VOL in $(virsh vol-list default | awk '/.img/ { print $1 }'); do
echo "*** ${VOL}"
virsh vol-delete "${VOL}" --pool default
done
fi

if [[ -d "${LOGDIR}" ]]; then
echo "*** Remove directory: ${LOGDIR}"
Expand Down
2 changes: 2 additions & 0 deletions vagrant_init_destroy_boxes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ check_vagrant_vm() {
vagrant winrm --shell cmd --command 'systeminfo | findstr /B /C:"OS Name" /C:"OS Version"'
echo "*** Running: vagrant winrm --shell powershell --command 'Get-Service ...'"
vagrant winrm --shell powershell --command "Get-ChildItem -Path Cert:\LocalMachine\TrustedPublisher; Get-Service | where {\$_.Name -match \".*QEMU.*|.*Spice.*|.*vdservice.*|.*VBoxService.*\"}; Get-WmiObject -Class Win32_Product; Get-WmiObject Win32_PnPSignedDriver | where {\$_.devicename -match \".*Red Hat.*|.*VirtIO.*\"} | select devicename, driverversion" | uniq
echo "*** Running: vagrant winrm --shell powershell --command 'cscript slmgr.vbs...'"
vagrant winrm --shell cmd --command 'cscript C:\Windows\System32\slmgr.vbs /dli'
echo "*** vagrant winrm --shell powershell --command .... finished"
;;
*centos* | *ubuntu* )
Expand Down

0 comments on commit 28ea724

Please sign in to comment.