SOLVED: SolusVM KVM to Proxmox Migration

ejmerkel

Well-Known Member
Sep 20, 2012
117
4
58
I've been working on a project to migration some KVM VM's from SolusVM to Promox. My first two migrations I have been able to get them working. However, I just copied a third and for some reason the image is not showing any partitions.

Here is the process I've been using.
  1. Take LVM snapshot of currently running SolusVM KVM CentOS7 instance.
  2. dd the snapshot and copy it to the Proxmox Hypverisor
  3. Create a new KVM on the Proxmox server with LVM disks the same size as the source
  4. dd the raw snapshot image to the LVM device ie vm-VMID-disk-0
  5. Boot the new VM with CentOS 7 rescue CD and fix device names, update initramfs, etc and reboot
Again that process has worked twice for me. This 3rd time, when I boot the new VM with a rescue CD, it shows the device /dev/sda but there are no linux partitions. There should be a / and swap partition on the drive. I verified the source and destinations are the same size.

What could cause this? What am I missing?

Best regards,
Eric
 
  • Like
Reactions: oxzhor
Have you tried the process a second time?

Maybe something went wrong in the steps from making a copy, moving the copy to the Proxmox VE node and then applying the copy to the new virtual disk.

All in all, this is a viable option to migrate your VMs.
 
Have you tried the process a second time?

Maybe something went wrong in the steps from making a copy, moving the copy to the Proxmox VE node and then applying the copy to the new virtual disk.

All in all, this is a viable option to migrate your VMs.

Yes, I've tried a couple times varying the block size, etc but still for some reason the image lacks any partition information.
 
Well, I finally got it working. The image size was 45G and that is the size I created in Proxmox. On a hunch I just created a 50G and re-synched the image and it worked. I am guessing the source image was just a small bit bigger than 48?

In any case it is working now. :)
 
Great to hear. What does the partition table of the VM show?

Also, if your problem is solved please mark the thread as solved :)
 
The partitions now show correctly.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 44.5G 0 part /
└─sda2 8:2 0 512M 0 part [SWAP]
 
I've been working on a project to migration some KVM VM's from SolusVM to Promox. My first two migrations I have been able to get them working. However, I just copied a third and for some reason the image is not showing any partitions.

Here is the process I've been using.
  1. Take LVM snapshot of currently running SolusVM KVM CentOS7 instance.
  2. dd the snapshot and copy it to the Proxmox Hypverisor
  3. Create a new KVM on the Proxmox server with LVM disks the same size as the source
  4. dd the raw snapshot image to the LVM device ie vm-VMID-disk-0
  5. Boot the new VM with CentOS 7 rescue CD and fix device names, update initramfs, etc and reboot
Again that process has worked twice for me. This 3rd time, when I boot the new VM with a rescue CD, it shows the device /dev/sda but there are no linux partitions. There should be a / and swap partition on the drive. I verified the source and destinations are the same size.

What could cause this? What am I missing?

Best regards,
Eric
Hi Eric,

Thank you for the steps! useful information.
 
Last edited:
I've been working on a project to migration some KVM VM's from SolusVM to Promox. My first two migrations I have been able to get them working. However, I just copied a third and for some reason the image is not showing any partitions.

Here is the process I've been using.
  1. Take LVM snapshot of currently running SolusVM KVM CentOS7 instance.
  2. dd the snapshot and copy it to the Proxmox Hypverisor
  3. Create a new KVM on the Proxmox server with LVM disks the same size as the source
  4. dd the raw snapshot image to the LVM device ie vm-VMID-disk-0
  5. Boot the new VM with CentOS 7 rescue CD and fix device names, update initramfs, etc and reboot
Again that process has worked twice for me. This 3rd time, when I boot the new VM with a rescue CD, it shows the device /dev/sda but there are no linux partitions. There should be a / and swap partition on the drive. I verified the source and destinations are the same size.

What could cause this? What am I missing?

Best regards,
Eric
Hi Eric,

Would you feel free to share the command that you used during this 1-5 migration process?

Thank you very much.
 
Hi Eric,

Would you feel free to share the command that you used during this 1-5 migration process?

Thank you very much.

Show the logical volumes of the VM's

# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert kvm361_img ssd_vg -wi-ao---- 10.00g kvm363_img ssd_vg -wi-a----- 60.00g kvm364_img ssd_vg -wi-ao---- 45.00g kvm365_img ssd_vg -wi-a----- 45.00g kvm368_img ssd_vg -wi-a----- 50.00g kvm369_img ssd_vg -wi-a----- 50.00g kvm370_img ssd_vg -wi-a----- 75.00g kvm381_img ssd_vg owi-aos--- 60.00g kvm381_img_2 ssd_vg owi-aos--- 50.00g kvm382_img ssd_vg -wi-a----- 50.00g

So for example kvm_361_img is the logical volume of the KVM VM 361

You can look closer at the logical volumes to find the device names.

lvdisplay --- Logical volume --- LV Path [B]/dev/ssd_vg/kvm361_img[/B] LV Name kvm361_img VG Name ssd_vg LV UUID Erj7JT-2u1H-LBx2-GqXf-Mekx-TloP-X8WRIK

Create a snapshot larger than the image size so 20G instead of 10G. You don't have to double it but just make sure you have enough room to hand the changes while you are copying it.

lvcreate -L20G -s -n /dev/ssd_vg/kvm381_snap /dev/ssd_vg/kvm361_img Logical volume "kvm361_snap" created.

You should now see a snapshot

lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert kvm361_img ssd_vg -wi-ao---- 10.00g kvm361_snap ssd_vg swi-a-s--- 20.00g kvm361_img 0.00

Now copy the snap shot to a new server.

ssh -p22 new-pve-server.domain.com "dd if=/dev/ssd_vg/kvm361_snap bs=512K | gzip -1 -" | dd of=kvm361.img.gz

Create a new VM in proxmox VMID 512 in this example. Now unzip and copy to did created for VMID 512

gunzip kvm361.img.gz dd if=kvm361.img of=/dev/local_ssd/vm-512-disk-0

Now you can try booting the VM in Promox. Most likely the system will not boot. You will need rebuild the initramfs so that it will boot. In order to do this mount the CentOS 7 or whatever boot CD and go into rescue mode. Once in rescue mode you will need to mount the device and run the following commands. You may also need to change the /etc/fstab device from /dev/vda to /dev/sda or something similar. Reference https://www.centos.org/forums/viewtopic.php?f=47&t=63988 and https://access.redhat.com/discussions/3326141


mount /dev/sda1 /mnt/sysimage mount --bind /proc /mnt/sysimage/proc mount --bind /dev /mnt/sysimage/dev mount --bind /sys /mnt/sysimage/sys chroot /mnt/sysimage vi /etc/fstab # change the device names to what you see in lsblk command dracut --regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg exit cd / sync telinit 6

I hope this helps.
 
  • Like
Reactions: tim874536

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!