Migrate existing KVMs to proxmox

Sep 21, 2017
11
0
1
64
Hi,
I like to migrate all my existing KVMs (Disks as image files, each KVM in its own zfs filesystem) to proxmox without copy of all image date.
Is it possible to create a custom VM using existing image files ?
Best Regards
admin
 
Yes, this is possible, see
https://pve.proxmox.com/pve-docs/ch...ing_virtual_machines_from_foreign_hypervisors for example

the only difference is that you the disk format will be qcow2 or raw if you're importing from KVM

when using a ZFS pool as target storage, PVE will create a zfs zvol for each disk image you import.

This a block device you can inspect under /dev/zd*, but not a file on filesystem like ext4 or vfat.
Use of block devices for disk images is recommended when virtualizing for feature and performance reasons/
 
My existing directory structure for each KVM is
/pool/kvm/VMx/VMx-boot.raw
/pool/kvm/VMx/VMx-root.raw
/pool/kvm/VMx/VMx-swap.raw
So I have tried with qm create ... and qm importdisk ... (I aborted because of copying disk image)
After all I edit /etc/pve/storage.cfg manually and appended
...
dir: localkvm
path /rpool/kvm
content images
Then I changed the mountpoint of pool/kvm/VMx to /rpool/kvm/images/888
and renamed the image files to vm-888-disk-{boot,root,swap}.raw .
Finally I manual edited /etc/pve/qemu-server/888.conf and entered the disk images as
virtio0: localkvm:888/vm-888-disk-boot.raw
virtio1: localkvm:888/vm-888-disk-root.raw
virtio2: localkvm:888/vm-888-disk-swap.raw

Is ist allowed to edit those config files manually? I war surprised that the pve web interface immediately shows my edit actions.
Best regards
 
Yes you can edit these configuration files manually, PVE does not have an intermediate state between the underlying configuration files and the GUI.

concerning your setup: if you want to have your disk image as visible files in a zfs dataset, make sure you keep the format to raw, as qcow2 on top of ZFS will bring you performance problems ( google for write amplificiation for the details)
 
Thanks for your quick and meaningful responses.
Finally I must praise your pve iso installer which is very excellent concerning zfs. I use zfs round about 12 years under solaris and later under ubuntu 12.04 and 14.04 (with my own manual "installer" like github recipes). But nothing of those comes close to your installer.
 

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!