git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux/kvm-inventory
diff options
context:
space:
mode:
authorH. P. <harald.p.@xmart.de> 2018-11-01 13:30:58 +0100
committerH. P. <harald.p.@xmart.de> 2018-11-01 13:30:58 +0100
commit0632591996893fe136a1f2fe44d9b9f404f41f3e (patch)
tree7340edbe7c212da3db45a83219147143a3268c8d /documentation/aux/kvm-inventory
downloadfedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2
Initial commit
Diffstat (limited to 'documentation/aux/kvm-inventory')
-rwxr-xr-xdocumentation/aux/kvm-inventory18
1 files changed, 18 insertions, 0 deletions
diff --git a/documentation/aux/kvm-inventory b/documentation/aux/kvm-inventory
new file mode 100755
index 0000000..c739514
--- /dev/null
+++ b/documentation/aux/kvm-inventory
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "$SCDIR/ctrl-c"||exit 1
+ODETFIL="$SCDIR/../kvm_overview"
+ODETDIR="$SCDIR/../kvm-details"
+
+echo -n "Fetching KVM config"
+(
+ echo -n ".";>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||true
+ echo -n ".";virsh list --all --title>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";echo "" >> "$ODETFIL";virsh net-list --all>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";echo "" >> "$ODETFIL";virsh pool-list --all --details>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh list --all --name);do virsh dumpxml "$i">"$ODETDIR"/domain-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh net-list --all --name);do virsh net-dumpxml "$i">"$ODETDIR"/net-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh pool-list --all --name);do virsh pool-dumpxml "$i">"$ODETDIR"/pool-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+)
+[ "$?" -ne 0 ]&&echo "failed."||echo "done."