# Second drive on separate datastore

**URL:** <https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584>\
**Category:** Product Support\
**Created:** [January 19, 2018, 8:41pm UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584 "2018-01-19T20:41:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [January 19, 2018, 8:41pm UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584/1 "2018-01-19T20:41:40Z")

</div>

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 ?

---

<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:** [January 20, 2018, 8:38am UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584/2 "2018-01-20T08:38:42Z")

</div>

what is the driver/storage that you are using?

---

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [January 20, 2018, 4:53pm UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584/3 "2018-01-20T16:53:24Z")

</div>

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”

---

<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:** [January 22, 2018, 8:31am UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584/4 "2018-01-22T08:31:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [January 23, 2018, 4:12pm UTC](https://forum.opennebula.io/t/second-drive-on-separate-datastore/5584/5 "2018-01-23T16:12:57Z")

</div>

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

![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/2/2485d26919316b1d80aa60f5ca8e2cb5bc0275fe.jpg)
