summaryrefslogtreecommitdiff
path: root/remove-vm
diff options
context:
space:
mode:
Diffstat (limited to 'remove-vm')
-rwxr-xr-xremove-vm10
1 files changed, 5 insertions, 5 deletions
diff --git a/remove-vm b/remove-vm
index 680bef4..363f2a0 100755
--- a/remove-vm
+++ b/remove-vm
@@ -7,14 +7,14 @@ set -eu
# Command line parameters.
name="$1"
-# What volume group should we use?
-vg="exolobe1-vg"
+# Read config variables.
+. "$HOME/.config/ansibleness/vm.conf"
# Shut down and remove the VM, if it exists.
-if virsh list --all | grep -F "$name" > /dev/null
+if virsh -c qemu:///system list --all | grep -F "$name" > /dev/null
then
- virsh destroy "$name" || true
- virsh undefine "$name"
+ virsh -c qemu:///system destroy "$name" || true
+ virsh -c qemu:///system undefine "$name"
fi
# Remove the LV, if it exists.