VMs and Logical Volumes

michaelf

Member
Oct 13, 2023
51
1
8
michaelfirsov.wordpress.com
Hello!

After installing Proxmox I created four virtual machines as can be seen in the picture on the left:

Q1.png

Q1-2.png

The question: Given that I was creating those VMs in the same way why did Proxmox create the LV for VMs 102 and 104 and did not create for VMs 100 and 101?

Thank you in advance,
Michael
 

Attachments

  • Q1.png
    Q1.png
    70.8 KB · Views: 22
  • Q1.png
    Q1.png
    70.8 KB · Views: 17
Just look closer. You only have your EFI and TPM "disks" on LVM. All other disks are on "Storage" which seems is not a LVM.
 
Last edited:
  • Like
Reactions: michaelf
It looks more like a directory on root (blue mark). "data" is almost empty (yellow mark).
 

Attachments

  • Q1.png
    Q1.png
    71.1 KB · Views: 12
You want everything on your "local-lvm", right? So just select every HDD from your VMs one by one and click on "Disk Action" - "Move Storage" and choose in "Target Storage" your "local-lvm" (tic "Delete Source" to free up your directory).
 
"You want everything on your "local-lvm", right? So just select every HDD from your VMs one by one and click on "Disk Action" - "Move Storage" and choose in "Target Storage" your "local-lvm" (tic "Delete Source" to free up your directory)." - yes, but I just wanted to create my own directory on "data" LV and store VMs there - but as far as I understand I can't do it by default - at least untill I add a mount point to data.
 
Your LV "data" is not a filesystem, its a volume. So it can't be mounted and you can't create directories or files on a volume without a filesystem...
...but I just wanted to create my own directory on "data" LV and store VMs there...
Why? You will only have disadvantages...
 
"Your LV "data" is not a filesystem, its a volume. So it can't be mounted and you can't create directories or files on a volume without a filesystem..." - yes, and that's what's confusing me the most: all textbooks I've read so far were saying ~ "...the last step - you must create a file system on you LV and mount it somewhere (~/srv/lv1). I've never seen a logical volume whithout a file system mounted to some directory...

"Why? You will only have disadvantages..." - just training for the situation when I would add a new hdd (mirror1, for example) and would like to store my VMs there.
 
`data` is a particular type of logical volume (lvm thin). Whereas `root` and `swap` are regular logical volumes that have been formated and mounted.
All are within the same volume group `pve`. I look at it as `data` being a volume group within a logical volume, in which PVE creates LVs assigned as guest disks. There are quite a few levels of abstraction before you get to an actual vm disk partition. HTH!
 
Last edited:
"`data` is a particular type of logical volume (lvm thin)." - yes, I know, but it doesn't mean you can access that thin volume without first mounting it to some directory, for example:
04.png
In this case Proxmox does not create any mount points for the volume "data"...
02.png

...that's why I'm wondering how can I create any (sub)directory on volume "data"?

And the next question that would arise: if I later add another disk and convert it to a thin LV - should I create a mount point for it to be accessible by Proxmox or it would "see" the new thin volume without the mount point?

Regards,
Michael
 
...that's why I'm wondering how can I create any (sub)directory on volume "data"?

And the next question that would arise: if I later add another disk and convert it to a thin LV - should I create a mount point for it to be accessible by Proxmox or it would "see" the new thin volume without the mount point?
That `data` volume is not a regular LV but a thin pool. For want of a better word, it is a container of other LVs. You cannot mount the entire contents of `data` to a single directory.
If you add an additonal disk, you can create a new lvm thin pool and assign it as storage all from the PVE UI.
If you are looking for directory based storage, then do not set it up as lvm-thin. You can of course have both.

PVE employs the thin pool for both guest storage types: LVs representing entire disks (for VMs) and LVs for single filesystems (containers). You could manually create an LV, in the thin pool, for some other use. e.g. format it with a single fs, and mount it in the host. But I don't see anyone doing this.
 
Last edited:
  • Like
Reactions: michaelf
"
If you add an additonal disk, you can create a new lvm thin pool and assign it as storage all from the PVE UI.
If you are looking for directory based storage, then do not set it up as lvm-thin. You can of course have both." - I see , thank you!
 
Last edited:
Are you confusing the thin provisioned pool `data` with individual volumes created within it? This is why I said I like to think of the thin pool (e.g. the `data` volume in this case) as being like a volume group.
 
Something I did, after adding a new disk as lvm-thin backed storage, was to disable vm/ct disk storage for the default local storage (/var/lib/vz) and only use it for iso, container templates, snippets etc. This way, you don't inadvertently create disk volumes in unexpected places.
 
Last edited:
"Something I did, after adding a new disk as lvm-thin backed storage, was to disable vm/ct disk storage for the default local storage (/var/lib/vz) and only use it for iso, container templates, snippets etc. This way, you don't inadvertently create disk volumes in unexpected places." - ...it is a very correct action, thanks for the thought!
 

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!