Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


KVM to KVM migration
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

KVM to KVM migration

Is it possible to do it without having access to the host machine and to rescue mode?

For example I am thinking of moving a machine to leaseweb VPS but they don't offer it for the S model.

Comments

  • To migrate a KVM VPS you'll definitely require some sort of host access or get a backup file, if you want to move from a host to another.

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    It's possible.

    You can boot both instances with something like gparted and just transfer the data over. Netcat is an option but completely unencrypted so you'll want something else (or setup some sort of VPN between the spots if that's a real concern).

    Depending on your partition layout (namely if / is a single fat partition) you can shrink it to the smallest possible size and then just do a copy of the partition and not of the entire drive.

    I did this for a customer the other day, worked pretty well minus the fact the source datacenter had extremely unstable network speeds.

    Francisco

    Thanked by 2Abdussamad Nihim
  • @Francisco said:

    I am not exactly sure I understood your method but you suggest that you have managed to do it without access to rescue mode in case grub / network / init / etc. fails - where you would need rescue mode to find out what exactly failed and to fix it.

  • @Nihim - I do this quite regularly with my KVMs and OpenVZ setups (non-live migration). Typically when I get a new VPS, what I'll do is to first get a local copy of my "templatized" VPS via rsync. Then in the new VPS, I nuke pretty much everything with the templatized version (after reducing running services to a bare minimum including SSH) and then reboot. The key files/settings to preserve are fstab (for KVM) and the /etc/network/interfaces file. Everything else is from the template. Works without any issues for me. Depending on how things are running udev may give you some pain, but if you are running udev with the templatized version all should be well. You may have to make an exception for the /dev/simfs (or ploop file) as the case may be. Very often you can also ignore the /dev folder (along with /proc, /sys, /tmp, /run etc.) when you nuke from the template. I will usually also have my own /boot folder for KVM (with whatever kernel) and then I will rerun grub-update to get to boot it correctly. This is very quick and reliable (so far in my experience).

    See: https://www.lowendtalk.com/discussion/comment/1926507/#Comment_1926507 for a bit more on the comment thread.

    HTH.

    P.S: Of course remember to use --numeric-ids -AXSH with rsync to preserve all the correct file properties/metadata.

    Thanked by 1Nihim
  • I've used clonezilla in the past on a machine that I was able to boot a custom OS on using the console but not download a copy of the root disk.

    Essentially booted the thing into Clonezilla then imaged it over SSH.

Sign In or Register to comment.