Skip to content

Instantly share code, notes, and snippets.

@d6e
Created May 29, 2013 18:07
Show Gist options
  • Save d6e/5672381 to your computer and use it in GitHub Desktop.
Save d6e/5672381 to your computer and use it in GitHub Desktop.
For modifying VMs
#!/bin/bash
set -x
ls /etc/libvirt/qemu/ | grep ".xml" | sed s/.xml// > vm-names.txt
for name in $(cat vm-names.txt); do
# dumping xml files
virsh dumpxml $name > ${name}.xml
# editing
cat ${name}.xml | sed s/2097152/1097152/
# importing xml files
virsh define ${name}.xml
virsh start $name
rm ${name}.xml
done
rm vm-names.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment