Last active
October 30, 2021 18:47
-
-
Save drolfe/a43bc7a0f7afaa91e4f1 to your computer and use it in GitHub Desktop.
Solusvm kvm migration 2-minute outage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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