# Creating a nfs shared storage of opennebula one directory

**URL:** <https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501>\
**Category:** Product Support\
**Created:** [July 5, 2016, 1:25pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501 "2016-07-05T13:25:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arshad\_shaikh](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@arshad\_shaikh](https://forum.opennebula.io/u/arshad_shaikh)\
**Post date:** [July 5, 2016, 1:25pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/1 "2016-07-05T13:25:08Z")

</div>

Hi,

Recently I came to know that for live migration of VMs, shared storage(e.g. nfs) is necessary. So I tried to configure my **/var/lib/one** directory on my Frontend as shared using nfs but I am not able to do it. Can anybody please help me with a good documentation for configuring nfs for Opennebula. I have already tried multiple approaches to achieve it but I have been unsuccessful.

Thanks and Regards,  
Arshad

---

<div class="post-metadata">

**Author:** ![jojo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jojo/32/4953_2.png) [@jojo](https://forum.opennebula.io/u/jojo)\
**Post date:** [July 6, 2016, 3:38pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/2 "2016-07-06T15:38:40Z")

</div>

Hi Arshad,

monitor your log file like this

`tail -f /var/log/one/oned.log | grep -iv -e "monitor" -e "poolinfo"`

while you are trying to migrate the vm. Then post what is being logged here.

But maybe I misunderstood your question, what exactely do you mean by stating: " So I tried to configure my /var/lib/one directory on my Frontend as shared using nfs but I am not able to do it"

if you have configured nfs server and client parts like in the quickstart guide it should work:  
[http://docs.opennebula.org/4.14/design\_and\_installation/quick\_starts/qs\_ubuntu\_kvm.html](http://docs.opennebula.org/4.14/design_and_installation/quick_starts/qs_ubuntu_kvm.html)

hope that helps  
Jojo

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [July 6, 2016, 9:49pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/3 "2016-07-06T21:49:54Z")

</div>

Hi Arshad,

The official info is not step-by-step setup but it is giving a lot of hints how to set-up NFS as shared system datastore.  
[http://docs.opennebula.org/5.0/deployment/open\_cloud\_storage\_setup/fs\_ds.html](http://docs.opennebula.org/5.0/deployment/open_cloud_storage_setup/fs_ds.html)

Please keep in mind that once you have the NFS set-up you must change the TM\_MAD of the default SYSTEM datastore from SSH to SHARED or create new SYSTEM datastore with TM\_MAD=shared.

Kind Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![arshad\_shaikh](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@arshad\_shaikh](https://forum.opennebula.io/u/arshad_shaikh)\
**Post date:** [July 7, 2016, 3:01pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/4 "2016-07-07T15:01:42Z")

</div>

Hi Jojo,

I tried the quickstart guide approach but it didn’t work for me. After configuring on nfs server, I tried the **showmount -e command** on server but it always gives **RPC timed out** error which is the same case when I try to mount on clients.

Regards,  
Arshad

---

<div class="post-metadata">

**Author:** ![silbogg](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@silbogg](https://forum.opennebula.io/u/silbogg)\
**Post date:** [July 8, 2016, 10:44am UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/5 "2016-07-08T10:44:23Z")

</div>

Hi Arshad,

After a clean install first delete your datastores through sunstone. Then remove your datastore directory on your nodes i.e. /var/lib/one/datastores. And recreate them, mount your nfs share on each of them and then chown to oneadmin:oneadmin. So on each node your datastore path (/var/lib/one/datastores) should point to your nfs mount (make sure it mounts after reboot)

Then create system and images datastores as follows:  
su - oneadmin  
vi images.txt  
NAME = nfs\_images  
DS\_MAD = fs  
TM\_MAD = qcow2

vi system.txt  
NAME = nfs\_system  
TM\_MAD = shared  
TYPE = SYSTEM\_DS

onedatastore create system.txt  
onedatastore create images.txt

Now you should be able to see you datastores through sunstone & cli:  
[oneadmin@node01 ~]$ onedatastore list  
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT  
100 nfs\_system 5.1T 96% 0 0 sys - shared on  
101 nfs\_images 5.1T 96% 0 16 img fs qcow2 on

Hope this helps,  
Orhan

---

<div class="post-metadata">

**Author:** ![Ben\_McGuire](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ben_mcguire/32/5544_2.png) [@Ben\_McGuire](https://forum.opennebula.io/u/Ben_McGuire)\
**Post date:** [January 9, 2018, 9:49pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/6 "2018-01-09T21:49:07Z")

</div>

Hello

Did you ever manage to get this working ?  
I followed the guide and also the links but just like a previous post I made our NFS datastore has a zero size

oneadmin@host1:~$ onedatastore list  
ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT  
100 nfs\_system 0M - 0 0 sys - shared on  
101 nfs\_images 0M - 0 0 img fs qcow2 on

This is a dev environment where the frontend and node is one the same server.  
I believe I have mounted the NFS correct as per the guidance from Anton

Filesystem Size Used Avail Use% Mounted on  
/dev/root 20G 2.0G 17G 11% /  
devtmpfs 63G 0 63G 0% /dev  
tmpfs 63G 0 63G 0% /dev/shm  
tmpfs 63G 17M 63G 1% /run  
tmpfs 5.0M 4.0K 5.0M 1% /run/lock  
tmpfs 63G 0 63G 0% /sys/fs/cgroup  
/dev/md2 487M 23M 436M 5% /boot  
/dev/sda1 510M 152K 510M 1% /boot/efi  
/dev/md4 860G 72M 816G 1% /home  
cgmfs 100K 0 100K 0% /run/cgmanager/fs  
XX.XX\>XX\>XX\>/zpool-125541/VeeamBackup 600G 0 600G 0% /var/lib/one/datastores  
oneadmin@host1:~$

---

<div class="post-metadata">

**Author:** ![wusel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/wusel/32/5076_2.png) [@wusel](https://forum.opennebula.io/u/wusel)\
**Post date:** [January 10, 2018, 3:43pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/7 "2018-01-10T15:43:50Z")

</div>

> [@Ben\_McGuire](#):
>
> ```
> Filesystem Size Used Avail Use% Mounted on
> /dev/root 20G 2.0G 17G 11% /
> devtmpfs 63G 0 63G 0% /dev
> tmpfs 63G 0 63G 0% /dev/shm
> tmpfs 63G 17M 63G 1% /run
> tmpfs 5.0M 4.0K 5.0M 1% /run/lock
> tmpfs 63G 0 63G 0% /sys/fs/cgroup
> /dev/md2 487M 23M 436M 5% /boot
> /dev/sda1 510M 152K 510M 1% /boot/efi
> /dev/md4 860G 72M 816G 1% /home
> cgmfs 100K 0 100K 0% /run/cgmanager/fs
> XX.XX.XX.XX:/zpool-125541/VeeamBackup 600G 0 600G 0% /var/lib/one/datastores
> oneadmin@host1:~$
> 
> ```

What’s inside `/var/lib/one/datastores` and do the permissions belong to `oneadmin` (note that its UID needs to be identical across your hosts)?

```
oneadmin@az:~$ df -h /nfs
Filesystem Size Used Avail Use% Mounted on
nfs-int:/nfs 204G 179G 25G 88% /nfs
oneadmin@az:~$ ls -la /var/lib/one/datastores/
total 8
drwxrwxr-x 2 oneadmin oneadmin 4096 Mar 5 2017 .
drwxr-xr-x 6 oneadmin root 4096 Jul 23 11:43 ..
lrwxrwxrwx 1 root root 17 Mar 5 2017 0 -> /nfs/datastores/0
lrwxrwxrwx 1 root root 17 Mar 5 2017 1 -> /nfs/datastores/1
lrwxrwxrwx 1 root root 17 Mar 5 2017 2 -> /nfs/datastores/2
oneadmin@az:~$ ls -la /nfs/datastores
total 28
drwxr-xr-x 7 oneadmin oneadmin 4096 Feb 23 2017 .
drwxr-xr-x 6 root root 4096 Feb 14 2017 ..
drwxr-xr-x 9 oneadmin oneadmin 4096 Sep 23 04:46 0
drwxr-xr-x 2 oneadmin oneadmin 4096 Mar 5 2017 1
drwxr-xr-x 2 oneadmin oneadmin 4096 Feb 14 2017 100
drwxr-xr-x 2 oneadmin oneadmin 4096 Feb 19 2017 2

```

---

<div class="post-metadata">

**Author:** ![Ben\_McGuire](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ben_mcguire/32/5544_2.png) [@Ben\_McGuire](https://forum.opennebula.io/u/Ben_McGuire)\
**Post date:** [January 10, 2018, 5:18pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/8 "2018-01-10T17:18:05Z")

</div>

Hello Again.

You hit the nail on the head. It was the ownership of the datastore mount that was the issue.  
A simple solution made difficult due to lack of sleep.

---

<div class="post-metadata">

**Author:** ![Florin\_Tanasache1](https://avatars.discourse-cdn.com/v4/letter/f/cdc98d/32.png) [@Florin\_Tanasache1](https://forum.opennebula.io/u/Florin_Tanasache1)\
**Post date:** [March 16, 2018, 11:06am UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/9 "2018-03-16T11:06:30Z")

</div>

Hi everyone, I have some problems with the use of GlusterFS. I have followed the official guide ([https://docs.gluster.org/en/latest/Quick-Start-Guide/Quickstart/#step-1-have-at-least-two-nodes](https://docs.gluster.org/en/latest/Quick-Start-Guide/Quickstart/#step-1-have-at-least-two-nodes)) and finally i have 2 nodes each one with the /data/brick1/gluster folder. I want to use the glusterfs only for the image datastore for both the nodes but i don’t know how to do this correctly.  
I tried to mount the gluster on a new datastore (/var/lib/one/datastores/101) and with this solution when i create a new image opennebula save it on the gluster. But on the secondo node ( not the frontend) what have i to do? I think that a solution can be this -\> [http://docs.opennebula.org/5.4/deployment/open\_cloud\_storage\_setup/fs\_ds.html](http://docs.opennebula.org/5.4/deployment/open_cloud_storage_setup/fs_ds.html)  
Any solution for achievement this procedure will be very useful for me.  
Thanks everyone!

---

<div class="post-metadata">

**Author:** ![Florin\_Tanasache1](https://avatars.discourse-cdn.com/v4/letter/f/cdc98d/32.png) [@Florin\_Tanasache1](https://forum.opennebula.io/u/Florin_Tanasache1)\
**Post date:** [March 16, 2018, 3:33pm UTC](https://forum.opennebula.io/t/creating-a-nfs-shared-storage-of-opennebula-one-directory/2501/10 "2018-03-16T15:33:11Z")

</div>

Hi, after I have read some posts about this, i have another doubt! Some topics say that I have to mount the gluster on the datastore (for instance: mount -f glusterfs frontend:/gluster /var/lib/one/datastore/101 for both nodes) and some topics about the use of symlink after a i mount the gluster in /mnt/images for example (ln s /mnt/images /var/lib/one/datastore/101). Actually, i want to save my images from susntone on this shared gluster so that when a node instantiate the vm it take the image from it. Sorry for my confusion about this concept.  
I have created the datastore 101 from sunstone specifing the shared mode. Many thanks!
