Directory vs LVM Storage for VMs - Pros and Cons? (2024)

W

Whitterquick

Member
Aug 1, 2020
246
9
23
  • Jan 30, 2022
  • #1

Hey hows it going yall,

I have read up on the differences between the two and see the the differences between Block level and File level storage. I also see that Snapshots are possible with Directory storage when using the Qcow2 format. When creating VMs and virtual disks on Directory storage I notice it doesn't preallocate the size of the disk; is there any way to enable this or is this considered a good feature (as it can be used for over-provisioning etc)? In general are there any advantages LVM would have over Directory? I see LVM vs LVM-Thin being compared everywhere but not much discussion around the default Directory storage.

Interested to hear some comments on this Directory vs LVM Storage for VMs - Pros and Cons? (1)

  • Directory vs LVM Storage for VMs - Pros and Cons? (2)

Reactions:

DvdNwk

Dunuin

Distinguished Member
Jun 30, 2020
14,753
4,472
258
Germany
  • Jan 30, 2022
  • #2

In general thin-provisioning is a good thing. You loose a tiny bit of performance (because blocks need to be allocated dynamically on the fly) but you waste way less space. Lets say I got 20 VMs where each VM needs 50GB for the OS but I also want 50GB free as a spare so the VMs won't run out of space. If i store these 20 VMs on LVM they would need 20x 100GB = 2TB.
Same VMs on LVM-thin just need 1TB and if I would got a 2TB HDD I could easily put 30 of such VMs on that with still 500GB free that these 30 VMs could use if they need more space. And if you later see that these VMs even need more space you can easily add another SSD as a second VM storage and migrate some of them over to the new VM storage. You just need to make sure to monitor your storages so they never get full. But for that there are mlnitoring tools like zabbix, checkmk and so on.
And in case of VMs thin-provisioned storages are way more convinient. I dont know if you ever needed to extend the disk of one of your virtual disks, but it is very annoying. You first need to extend the virtual disk, then rebuild the partition table inside the guest, then extend the VGs, then estend the LVs, then extend the filesystem.
With thin-provisioning I dont need to be thrifty. If I think my VM will need 50GB I can give it a 200 GB disk so it got plenty of space to grow and I possibly dont need to extend it later because of all the spare space. Without thin-provisioning I couldn't do that because I would waste too much space. There I would give the VM 75 or 100GB and it is way more likely that this VM runs out of space so that I would be forced to manually extend the disks. Its way easier to extend your VM storage once every several years instead of extending dozens of virtual disks.

And for the directory vs LVM:
If you use LVM instead of a directory you can save a additional layer in between that adds overhead. With directory you get a additional filesystem layer and filesystems can add alot of overhead. Lets say for example I write 1TB of data as 4k random sync writes. For every 1 TB of data this will add 4TB of metadata so 5TB is written. That basically means your SSD will die 5 times faster and the performance will drop by 80%. A block storage doesn't add this overhead so a virtual disk on a block storage like LVM should be faster than a directory storage.

Last edited:

  • Directory vs LVM Storage for VMs - Pros and Cons? (4)

Reactions:

DvdNwk, fabiobasso, ZipTX and 1 other person

W

Whitterquick

Member
Aug 1, 2020
246
9
23
  • Jan 31, 2022
  • #3

Dunuin said:

And for the directory vs LVM:
If you use LVM instead of a directory you can save a additional layer in between that adds overhead. With directory you get a additional filesystem layer and filesystems can add alot of overhead. Lets say for example I write 1TB of data as 4k random sync writes. For every 1 TB of data this will add 4TB of metadata so 5TB is written. That basically means your SSD will die 5 times faster and the performance will drop by 80%. A block storage doesn't add this overhead so a virtual disk on a block storage like LVM should be faster than a directory storage.

Oh wow, no wonder my first SSD died with unexplainably little use!

Are there use cases where Directory may be better than LVM? Did you not say LVM-Thin is a little more transparent in terms of security? If I already have a VM setup on Directory how easy is it to back it up, erase the Directory storage, and then re-set it up as LVM/Thin and restore the VM onto it? Are here any issues if the VM was previously on a different type of storage?

Thanks for the explanation, no one seems to talk about Directory much…

Dunuin

Distinguished Member
Jun 30, 2020
14,753
4,472
258
Germany
  • Jan 31, 2022
  • #4

Whitterquick said:

Oh wow, no wonder my first SSD died with unexplainably little use!

Overhead shouldn't be that bad in real life, because async and bigger writes cause way less overhead. But write amplification multiplies with each layer so you get an exponential growth and even small overhead can add up. So its always a good idea to remove a unnessesary layer if possible.

Whitterquick said:

Are there use cases where Directory may be better than LVM? Did you not say LVM-Thin is a little more transparent in terms of security?

Yes, thin-provisioning is always not that secure on an encrypted disk because you can see whats empty and what encrypted. But all your data is still encrypted, so thats secure enough for me.

Whitterquick said:

If I already have a VM setup on Directory how easy is it to back it up, erase the Directory storage, and then re-set it up as LVM/Thin and restore the VM onto it? Are here any issues if the VM was previously on a different type of storage?

VMs don't care about the storage as a backup restore will create a new VM from scratch based on your backupped data. So backup and restore to a new storage should be fine. But you should consider first if you want to loose the qcow2 features. Because if I remember right qcow2 can't be used with LVM so you are loosing the snapshot functionality.

Last edited:

  • Directory vs LVM Storage for VMs - Pros and Cons? (6)

Reactions:

ZipTX and Whitterquick

W

Whitterquick

Member
Aug 1, 2020
246
9
23
  • Feb 1, 2022
  • #5

@Dunuin when backing up LVM-thin does it take up the full quota or just used space?

Dunuin

Distinguished Member
Jun 30, 2020
14,753
4,472
258
Germany
  • Feb 1, 2022
  • #6

Backups should always only use the size of the actual data. No matter if you use LVM-Thin or LVM because the compression will compress the empty areas.

  • Directory vs LVM Storage for VMs - Pros and Cons? (8)

Reactions:

Whitterquick

W

Whitterquick

Member
Aug 1, 2020
246
9
23
  • Feb 6, 2022
  • #7

If I already have existing encrypted LVM setup on a disk and I want to use the 'LVM' storage type in Proxmox GUI, is that possible? When I try to setup anything other than 'Directory' the disk is already showing as full, I guess because the underlying LVM is taking up the full disk...

W

Whitterquick

Member
Aug 1, 2020
246
9
23
  • Feb 6, 2022
  • #8

Scratch that last question, it doesn’t even make sense Directory vs LVM Storage for VMs - Pros and Cons? (9)

You must log in or register to reply here.

Directory vs LVM Storage for VMs - Pros and Cons? (2024)
Top Articles
WIS International hiring GROCERY RESET MERCHANDISER – PUBLIX in Miami Beach, Florida, United States | LinkedIn
6725 Harding Avenue, Unit 306, Miami Beach, FL 33141 | Compass
Fernald Gun And Knife Show
Hometown Pizza Sheridan Menu
Fan Van Ari Alectra
Patreon, reimagined — a better future for creators and fans
Metra Union Pacific West Schedule
Cottonwood Vet Ottawa Ks
Terrorist Usually Avoid Tourist Locations
³µ¿Â«»ÍÀÇ Ã¢½ÃÀÚ À̸¸±¸ ¸íÀÎ, ¹Ì±¹ Ķ¸®Æ÷´Ï¾Æ ÁøÃâ - ¿ù°£ÆÄ¿öÄÚ¸®¾Æ
Falgout Funeral Home Obituaries Houma
The Potter Enterprise from Coudersport, Pennsylvania
Cinepacks.store
Ap Chem Unit 8 Progress Check Mcq
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Summer Rae Boyfriend Love Island – Just Speak News
Yakimacraigslist
Plan Z - Nazi Shipbuilding Plans
Andhrajyothy Sunday Magazine
91 East Freeway Accident Today 2022
Walgreens Alma School And Dynamite
Best Mechanics Near You - Brake Masters Auto Repair Shops
Quest: Broken Home | Sal's Realm of RuneScape
Two Babies One Fox Full Comic Pdf
Construction Management Jumpstart 3Rd Edition Pdf Free Download
Naya Padkar Gujarati News Paper
Kentuky Fried Chicken Near Me
Boxer Puppies For Sale In Amish Country Ohio
Mals Crazy Crab
Ullu Coupon Code
Valley Craigslist
6465319333
Kltv Com Big Red Box
2024 Ford Bronco Sport for sale - McDonough, GA - craigslist
Sadie Sink Doesn't Want You to Define Her Style, Thank You Very Much
Dynavax Technologies Corp (DVAX)
Wattengel Funeral Home Meadow Drive
Eastern New Mexico News Obituaries
Anya Banerjee Feet
Tillman Funeral Home Tallahassee
Ursula Creed Datasheet
Www.craigslist.com Waco
Guy Ritchie's The Covenant Showtimes Near Grand Theatres - Bismarck
Uc Davis Tech Management Minor
Watch Chainsaw Man English Sub/Dub online Free on HiAnime.to
Zeeks Pizza Calories
Playboi Carti Heardle
Craigslist Chautauqua Ny
Powah: Automating the Energizing Orb - EnigmaticaModpacks/Enigmatica6 GitHub Wiki
Tommy Gold Lpsg
Appsanywhere Mst
91 East Freeway Accident Today 2022
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 6252

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.