How to attach existing LV to KVM

boblin

Renowned Member
May 24, 2010
9
0
66
Hi all,
I have Ubuntu server (LTSP) and I want to run this server under Proxmox/KVM. At first I want to test performance of this server running under KVM.

Now I have installed Proxmox on first hard disk and on second hard disk is my Ubuntu server (partitions are on lvm). I created proxmox kvm virtual and now I want to attach existing lv(root, home, var) from second hard disk.

I tried to add /etc/qemu-server/101.conf lines:
virtio0: vg:vm-101-disk-1 (boot)
virtio1: vg:root
virtio3: vg:var
virtio4: vg:home
... but it can't start: pvedaemon[4649]: VM 101 start failed

Can you help me?

Thank's

boblin
 
Hi all,
I have Ubuntu server (LTSP) and I want to run this server under Proxmox/KVM. At first I want to test performance of this server running under KVM.

Now I have installed Proxmox on first hard disk and on second hard disk is my Ubuntu server (partitions are on lvm). I created proxmox kvm virtual and now I want to attach existing lv(root, home, var) from second hard disk.

I tried to add /etc/qemu-server/101.conf lines:
virtio0: vg:vm-101-disk-1 (boot)
virtio1: vg:root
virtio3: vg:var
virtio4: vg:home
... but it can't start: pvedaemon[4649]: VM 101 start failed

Can you help me?

Thank's

boblin
Hi,
what's about:
virtio0: /dev/sdb

and filter sdb in the lvm.conf of the host.

Udo
 
Hi all,
and now I want to attach existing lv(root, home, var) from second hard disk
Try adding pve tag to lv's on your LVM:
lvchange --addtag pve ...
I don't really remember tag name though (not sure it is 'pve') and maybe you need to add another tag which specifies VMID, I'll check a bit later and tell you.
then add your LVM to Storages in proxmox webui, check if your disk is visible through webui if you click on newly created storage, then you can add this LV to a VM as a hard disk. Then set boot disk in vm options tab, after that it should just start.
 
In my case was solution to use /dev/sdb as ide0:

/etc/qemu-server/101.conf
Code:
ide0: /dev/sdb
bootdisk: ide0

You also were right with tagging partition for using in pve, but this is bit another case of use.

Thank you all ;)
 

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!