LVM from VM on visible on hardvare node

zystem

New Member
Feb 5, 2013
19
0
1
I have hardware 1 node cluster. Volumes stored on local LVM.
I create VM with 2 virtio disks (vda,vdb). First for root and secon for test.
on vdb disk I create LVM with VG named "main" and LV named "disk"

root@ha-stor1:~# vgs
VG #PV #LV #SN Attr VSize VFree
main 1 1 0 wz--n- 16.00g 15.00g
root@ha-stor1:~# pvs
PV VG Fmt Attr PSize PFree
/dev/vdb main lvm2 a-- 16.00g 15.00g
root@ha-stor1:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
disk main -wi-a----- 1.00g

But now i can see this LV and VG in hardware node

root@node:~# vgs
VG #PV #LV #SN Attr VSize VFree
main 1 1 0 wz--n- 16.00g 15.00g
pve 1 22 0 wz--n- 2.73t 2.26t

root@node:~# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
disk main -wi------ 1.00g
data pve -wi-ao--- 16.00g
root pve -wi-ao--- 8.00g
swap pve -wi-ao--- 8.00g
vm-160-disk-1 pve -wi-ao--- 32.00g

Why it is bug.
If I create two VM-s with same named VG-s I see on hardware node duplicated VG-s

root@node:~# vgs
VG #PV #LV #SN Attr VSize VFree
main 1 1 0 wz--n- 16.00g 15.00g
main 1 1 0 wz--n- 16.00g 15.00g
pve 1 22 0 wz--n- 2.73t 2.26t

And all operations with LVM on hardware node imediately start to run very slow. Because on every VM creation proxmox runs vgs or vgscan and this operation takes much time because of duplicated VG-s
 
Hi,
we had the same thing times ago.
I found out that the reason why some Guest LVs are visible on the underlaying host is the way how you create the VG on the VM.
If you make a pvcreate on the raw (e.g. vda) device this vg will be visible on the Proxomox host.
This will slow down LVM and we get many LVM-Change Files inside the /etc/lvm/archive directory.

If you first create a partition table with an LVM partition on vda (cfdisk e.g.) and than use it for LVM every thing is ok.
I think this is not a Promxox problem it seems to be a LVM thing.
 

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!