Unable to create a new Datasource with LN_TARGET="SYSTEM"



I have 3 opennebula host nodes. Each of them has a shared nfs-mounted system datasource. When I create a new VM via sunstone and set it to use that system datasouce, I see that the VM file is a symlink to another file in a image datasource.
# ls -al /var/lib/one/datastores/106/45/disk.0
lrwxrwxrwx 1 oneadmin oneadmin 60 Apr 5 17:01 /var/lib/one/datastores/106/45/disk.0 -> /var/lib/one/datastores/107/bf5fe882b01bb329f664d8a282621c35

Due to the requirements I received, I am trying to set it up so that if I create a new VM via sunstone, and set that VM to use a system datastore, I would like the actual VM image (file) to remain on that system datastore and not be a symlink to the image datastore.

I searched around a bit, and I noticed this:

  • ln_target : determines how the persistent images will be cloned when a new VM is instantiated.
  • NONE : The image will be linked and no more storage capacity will be used
  • SELF : The image will be cloned in the Images datastore
  • SYSTEM : The image will be cloned in the System datastore

… so it looks like LN_TARGET=SYSTEM is what I need. Symlink or not, it’s still on the same system DS. However I am unable to update/edit the current datasource to set this parameter. I also tried creating a new DS template, with LN_TARGET set to what I want, but both sunstone and onedatastore simply ignore my request. I see no errors in any output, but the setting I want simply reverts back to “NONE”

Can someone please help out?



I believe it keeps reverting because this is set in /etc/one/oned.conf.



Apparently those settings have no effect. See:

If anyone is looking to keep VMs on shared storage, then the LVM method may be better for you.