System datastores are always created in default path /var/lib/one


(Frederic Leist) #1

Hi,

I got a problem with OpenNebula 4.14. If I create a datastore via the dashboard (sunstone) wizard (not tested CLI) it ignores the BASE_PATH and instead creates the datastore in /var/lib/one/datastores/.

I checked sched.log and oned.log for permission errors but didn’t find anything. User oneadmin is also the owner of those folders.

hosts are h0, h1 and controller and h0 and h1 are in one cluster.

I want to create a datastore in /srv/datastores/ on h0.
I mounted /srv/datastores/ from h0 on h1 and controller via NFS.

Now, if i create a datastore with BASE_PATH set to /srv/datstores/ it creates the datastore in /var/lib/one/datastores/ on the controller instead of /srv/datastores/ on h0.

/var/lib/one/ is physically on the controller but mounted on both h0 and h1 via NFS.

tested both shared and ssh as transfer driver.


(Daniel Dehennin) #2

Frederic Leist forum@opennebula.org writes:

Hi,

Hello,

I got a problem with OpenNebula 4.14. If I create a datastore via the
dashboard (sunstone) wizard (not tested CLI) it ignores the BASE_PATH
and instead creates the datastore in /var/lib/one/datastores/.

I checked sched.log and oned.log for permission errors but didn’t
find anything. User oneadmin is also the owner of those folders.

hosts are h0, h1 and controller and h0 and h1 are in one cluster.

I want to create a datastore in /srv/datastores/ on h0.
I mounted /srv/datastores/ from h0 on h1 and controller via NFS.

Now, if i create a datastore with BASE_PATH set to /srv/datstores/
it creates the datastore in /var/lib/one/datastores/ on the
controller instead of /srv/datastores/ on h0.

/var/lib/one/ is physically on the controller but mounted on both h0 and h1 via NFS.

tested both shared and ssh as transfer driver.

It may be related to our bug report[1].

Regards.

Footnotes:
[1] https://dev.opennebula.org/issues/4316

Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF


(Frederic Leist) #3

Thanks!

I will try that out tomorrow and report back if it works!


(Daniel Dehennin) #4

Should I conclude it did not work? :wink:


(Frederic Leist) #5

Sorry I didn’t reply earlier. It did work :slight_smile:


(Abdul) #6

Hi Frederic (or anyone else),

How do I create the datastore with BASE_PATH set to say, ‘/mnt/datastores/’?

Thanks.


(Anton Todorov) #7

Hi,

You should take a thorough read of the documentation:

DATASTORE_LOCATION : Path for Datastores. It IS the same for all the hosts and front-end. It defaults to /var/lib/one/datastores (in self-contained mode defaults to $ONE_LOCATION/var/datastores). Each datastore has its own directory (called BASE_PATH) in the form: $DATASTORE_LOCATION/<datastore_id> . You can symlink this directory to any other path if needed. BASE_PATH is generated from this attribute each time oned is started.

In short - the BASE_PATH is a generated variable and you should use symlinks instead. I’d recommend to use separate symlink for each BASE_PATH.

Following your question you should create directories with the datastore_ids and symlinks to them in the DATASTORE_LOCATION. Lets say for example you have a SYSTEM datastore with ID 100 and an IMAGE datastore with ID 101 both with TM_MAD set to shared.

mkdir /srv/datastores/100
mkdir /srv/datastores/101
ln -s /src/datastores/100 /var/lib/one/datastores/100
ln -s /src/datastores/101 /var/lib/one/datastores/101

You should take care for the mermissions of the folders and the files inside too.

Hope this helps.

Best Regards,
Anton Todorov