# Questions about LVM datastores in OpenNebula 5

**URL:** <https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895>\
**Category:** Product Support\
**Created:** [September 7, 2016, 9:06pm UTC](https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895 "2016-09-07T21:06:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iancote](https://avatars.discourse-cdn.com/v4/letter/i/e47774/32.png) [@iancote](https://forum.opennebula.io/u/iancote)\
**Post date:** [September 7, 2016, 9:06pm UTC](https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895/1 "2016-09-07T21:06:14Z")

</div>

I’m currently running 4.10 with the following datastores:

DATASTORE TEMPLATE  
BASE\_PATH="/var/lib/one//datastores/"  
SHARED="YES"  
TM\_MAD="shared"  
TYPE=“SYSTEM\_DS”

BASE\_PATH="/var/lib/one//datastores/"  
BRIDGE\_LIST="tm-onhost1 tm-onhost2 tm-onhost3 tm-onhost4"  
CLONE\_TARGET="SELF"  
DISK\_TYPE="BLOCK"  
DS\_MAD="lvm"  
LN\_TARGET="NONE"  
TM\_MAD="lvm"  
TYPE="IMAGE\_DS"  
VG\_NAME=“vg0”

I’ve been having recurring issues with CLVM freezing and losing the ability to create new VMs. I noticed with OpenNebula 5, the LVM datastore no longer requires CLVM. I currently use gfs2 for the actual system and image directories, but would love to get rid of all the DLM related services.

If I move to version 5, I’m unclear how to provision the actual filesystems. Do I still need gfs2 or some kind of shared filesystem to hold the links to the LVM volumes? I guess I’m not fully understanding the documentation and how the image and system stores work in the new version.

Thanks,  
-ian

---

<div class="post-metadata">

**Author:** ![jmelis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jmelis/32/24_2.png) [@jmelis](https://forum.opennebula.io/u/jmelis)\
**Post date:** [September 14, 2016, 8:29am UTC](https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895/2 "2016-09-14T08:29:13Z")

</div>

It looks that there are quite a few people having problems with this.

In fs\_lvm you require two datastores:

- An image datastore of type DS\_MAD=fs and TM\_MAD=fs\_lvm. This datastore can have any name whatsoever. The images will be stored as **files** when registered. It will be stored in the frontend, or in any other node if using BRIDGE\_LIST.
- A system datastore of type TM\_MAD=fs\_lvm. A corresponding VG must be created in the hypervisors (not in the frontend) called vg-one-\<ds\_id\>. This VG must be manually created. Additionally, the lvmeta has to be disabled (read the docs for more info).

---

<div class="post-metadata">

**Author:** ![ccesario](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@ccesario](https://forum.opennebula.io/u/ccesario)\
**Post date:** [September 15, 2016, 1:40am UTC](https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895/3 "2016-09-15T01:40:48Z")

</div>

Hi @jmelis ,

Thank you by your explanation!

Best regards,

-Carlos

---

<div class="post-metadata">

**Author:** ![iancote](https://avatars.discourse-cdn.com/v4/letter/i/e47774/32.png) [@iancote](https://forum.opennebula.io/u/iancote)\
**Post date:** [March 31, 2017, 3:38am UTC](https://forum.opennebula.io/t/questions-about-lvm-datastores-in-opennebula-5/2895/4 "2017-03-31T03:38:27Z")

</div>

Thank you @jmelis for the explanation. Just in case others try the fs\_lvm driver, some clarifications that aren’t clear in the documentation (or at least weren’t to me):

Create the two datastores per the documentation. You need to share (via NFS, gfs2) BOTH datastore directories to all the hosts.

You likely need a large lvm volume or other storage partition mounted on the /var/lib/one/datastores/‘fs\_id’ directory, as that is going to need a lot of space. All images uploaded to the server will land there as files. Once again, this directory also needs to be shared out to all the hosts vi NFS or something.

You create a LVM vg for the datastore (vg-one-‘ds\_id’ as @jmelis pointed out). The datastore directory (/var/lib/one/datastores/‘ds\_id’) will get all the vm instance directories with the deployment files, disk links, and context disks. This has to be shared to all the hosts for live migration to work. When a VM is instantiated, the front end will drop the deployment and disk files in the /var/lib/one/datastores/‘ds\_id’/‘vm\_id’ directory. The host will create a logical volume in vg-one-‘ds\_id’ for each disk needed and copy the image from the files datastore.

Once I finally figured it all out, it’s been a lot nicer to work with than the older lvm model which required clvm.
