User Tools

Site Tools


bash:one_liners:migrate_all_libvirt_machines_to_other_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
bash:one_liners:migrate_all_libvirt_machines_to_other_host [2015/03/07 19:22]
biggi
bash:one_liners:migrate_all_libvirt_machines_to_other_host [2015/08/15 22:56] (current)
Line 1: Line 1:
 +To migrate all running VPSes to another host, do the following:
 +<​code>​
 +for x in `virsh list | grep running | awk {'​print $2'}`; do echo "​Migrating $x"; virsh migrate-setspeed $x --bandwidth 1000 && virsh migrate $x qemu+ssh://​USERNAME@HOSTNAME/​system;​ sleep 10; done
 +</​code>​
  
 +Remember to change "​USERNAME"​ and "​HOSTNAME"​.