Skip to content

Instantly share code, notes, and snippets.

@waja
Last active August 29, 2015 14:07
Show Gist options
  • Save waja/9cc17eccaa1c7fd055ea to your computer and use it in GitHub Desktop.
Save waja/9cc17eccaa1c7fd055ea to your computer and use it in GitHub Desktop.
Shell script gathering Xen DomU resources on a Dom0
#!/bin/sh
for DOMU in $(xm list | grep -v -E "^(Name|Domain-0)" | awk '{print $1}'); do
PARTSPACE=$(lvdisplay /dev/xen-vol/${DOMU}-disk | grep Size | awk '{print $3}')
RESOURCES=$(xm list | grep ${DOMU} | awk '{printf "%s %s %s",$6,$3,$4}')
# name_domu cpu_time ram vcpu part_space
echo ${DOMU} ${RESOURCES} ${PARTSPACE}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment