Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sitedata/4519f9ec9f88efb6f5cefb9100a2569b to your computer and use it in GitHub Desktop.
Save sitedata/4519f9ec9f88efb6f5cefb9100a2569b to your computer and use it in GitHub Desktop.
Solusvm kvm migration 2-minute outage
#New host
#Create a bank LV the same size as the source
lvcreate -L 400G -n kvm133_img vm_vg
#Old Host
#Creat a snapshot to stop any new data being written to the 400G LV, All changes get written to the snap lv now
lvcreate --snapshot -L10G -n kvm133-snap /dev/4tb_raid_vg/kvm133_img
#Copy the data from the source lv to the new hosts blank lv
dd if=/dev/4tb_raid_vg/kvm133_img bs=1M | pv -ptrb -s 400G | ssh [email protected] 'dd of=/dev/vm_vg/kvm133_img'
# Relax and have a drink
# Wait
# Tap your foot and wait some more
#Shut down vm the on the old host
virsh shutdown kvm133
#Then lastly Sync the data that was changed in the vps while the 400g was copied, should only take 1 minute
lvmsync /dev/4tb_raid_vg/kvm133-snap [email protected]:/dev/vm_vg/kvm133_img
#Solusvm master
/scripts/vm-migrate 77 8
#Then boot the vm up on the new node, don't forget to remove the source LV once your sure everything went well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment