Second drive on separate datastore

I have a mongo database VM that is deployed on a system datastore. The potential storage needs for this VM will most likely exceed the capacity of that datastore. I know how to add a second drive but that would be deployed on the same datastore. Instead I would like to add a second drive to this VM that would be deployed on a separate datastore that has much more capacity.

Is that possible?

If not could I alternatively move the second disk (i.e. disk.2) to another drive on my server and create a symlink to disk.2 ?

what is the driver/storage that you are using?

Here is my datastore definition:

DATASTORE 122 INFORMATION

ID : 122
NAME : VG_FIO_data
USER : b******
GROUP : oneadmin
CLUSTERS : 0
TYPE : SYSTEM
DS_MAD : -
TM_MAD : ssh
BASE PATH : /var/lib/one//datastores/122
DISK_TYPE : FILE
STATE : READY

DATASTORE TEMPLATE
ALLOW_ORPHANS=“NO”
DISK_TYPE=“FILE”
DS_MIGRATE=“YES”
RESTRICTED_DIRS=“/”
SAFE_DIRS=“/var/tmp”
SHARED=“NO”
SPEED=“10”
TM_MAD=“ssh”
TYPE=“SYSTEM_DS”

And here is my image definition:

IMAGE 70 INFORMATION

ID : 70
NAME : data drive
USER : b******
GROUP : oneadmin
DATASTORE : KVM images
TYPE : DATABLOCK
REGISTER TIME : 01/19 14:04:41
PERSISTENT : No
SOURCE : /var/lib/one//datastores/122/0e82b539d9ba6e89032112f2b603e429
PATH : /var/lib/one//datastores/122/25f9772ebecded745ea8651a61038eb4
FSTYPE : qcow2
SIZE : 10G
STATE : used
RUNNING_VMS : 1

IMAGE TEMPLATE
DEV_PREFIX=“hd”
DRIVER=“qcow2”
FSTYPE=“qcow2”

Hi,

It looks like you are using OpenNebula(front-end and HV) on a single server?

If this is the case you could try converting the setup to use shared TM_MAD for IMAGE and SYSTEM datastores. But most probably you’ll need to reinit the VM or copy/replace the VM disks after the change…

This way OpenNebula ill keep the files in the IMAGE datastore and create symlinks to them in the SYSTEM datastore. You can define an additional IMAGE datastore and mount the additional disk on the datastores home (usually /var/lib/one/datastores/$DATASTORE_ID)

if it is not your case or it is looking too complicated to do - creating a symlink to disk.X sounds ok.

Best Regards,
Anton Todorov

Hi Anton . . . I ended up successfully migrating the entire database VM to the larger datastore and then adding a second disk to isolate my data. I believe this was the cleanest solution since I ultimately thought maintaining disks in different datastores and relying on symlinks would be disorganized.

That said I appreciate your feedback!

Thanks