bkmeneguello
11/6/2019 - 6:38 PM

Sum libvirt hosts memory commited

# require `python3 -m pip install jq`
virsh list --name | \
xargs -I '{}' virsh dumpxml '{}' | \
xq '//domain/memory/text()' | \
sed -rn 's@.*<result>(.*)</result>@\1@p' | \
paste -sd+ | \
bc