Migrate existing VM to Proxmox

yerun

Member
May 20, 2020
3
0
21
47
Hello all,

I want to migrate my existing VM's from KVM/QEMU on Ubuntu to Proxmox. I created a new Logical Volume Group to store the VMs.
My idea is to create a new VM with the same specs as my existing ones and then copy the hard disk over. I already converted 1 VM's harddisk from qcow2 to raw.
I created a new, empty VM with the same specs as my existing one.
So i'm expecting to find a .raw file somewhere on my system but I can't find it anywhere. Under /var/lib/vz is an empty folder structure (dump, images, private, snippets and template). So there is nothing there after creating the new VM.

Under /dev/ there is the name of the new Volume Group I created, and under this folder is a link to (what looks like) my hard disk (of the new VM) but I cannot access it. Im trying to find it with WinSCP. 'No such file' when I want to browse there.
Under /dev/mapper there is also some kind of link, but the same story. I don't understand anything of it. This is the 2nd time I've done a clean install of Proxmox. The 1st time I saw my VM under /var/lib/vz/images/100 but then I created a directory (I think) and now a Volume Group.
How can I find my newly made harddisk so I can replace it with an existing one?
Thanks in advance (yes i'm a newbee here lol)
 
Hi,

it probably would be easier/better to use qm importdisk VMID /path/to/existing-VM-disk.qcow2 storageid
Replace VMID with the one you created, the path is for your existing Ubuntu VMs disk and "storageid" is the ID from the LVM group you created in Proxmox VE.

The disk will then added as "unused" disk which you can attach to the VM over the webinterface. Ensure that this disk is selected as boot options (VM -> Options) and you should ready to go.
 
Hi,

it probably would be easier/better to use qm importdisk VMID /path/to/existing-VM-disk.qcow2 storageid
Replace VMID with the one you created, the path is for your existing Ubuntu VMs disk and "storageid" is the ID from the LVM group you created in Proxmox VE.

The disk will then added as "unused" disk which you can attach to the VM over the webinterface. Ensure that this disk is selected as boot options (VM -> Options) and you should ready to go.

Thanks Thomas, I will give that a try :)
 
What a struggle sofar, I copied that HD over (15 Gb) and after the copying, my root drive (4 Gb) is out of space... i'm sure 15 Gb doesnt fit on a 4 Gb root drive so how can it become full all of a sudden? :confused:

I did a default install on a 16 Gb flash disk (I have an 120 Gb extra SSD disk for VMs) and it created a root partition of only 4 Gb...


root@pve1:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 14.9G
├─sda1 1007K
├─sda2 vfat 512M /boot/efi
└─sda3 LVM2_member 14.4G
├─pve-swap swap 1.8G [SWAP]
├─pve-root ext4 3.5G /
├─pve-data_tmeta 1G
│ └─pve-data 5.4G
└─pve-data_tdata 5.4G
└─pve-data 5.4G
sdb LVM2_member 111.8G
├─VM1-vm--100--disk--0 15G
└─VM1-vm--100--disk--2 32G
root@pve1:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.7G 0 3.7G 0% /dev
tmpfs 743M 35M 709M 5% /run
/dev/mapper/pve-root 3.4G 3.4G 0 100% / <--- here's my problem :O
tmpfs 3.7G 37M 3.6G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup
/dev/sda2 511M 312K 511M 1% /boot/efi
/dev/fuse 30M 16K 30M 1% /etc/pve
tmpfs 743M 0 743M 0% /run/user/0
root@pve1:~#

Update: I got this solved :)
 
Last edited:

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!