# Template for persistent VMs

**URL:** <https://forum.opennebula.io/t/template-for-persistent-vms/1030>\
**Category:** Product Support\
**Created:** [July 23, 2015, 11:06am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030 "2015-07-23T11:06:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanjose\_fuentes](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@juanjose\_fuentes](https://forum.opennebula.io/u/juanjose_fuentes)\
**Post date:** [July 23, 2015, 11:06am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/1 "2015-07-23T11:06:11Z")

</div>

Hi,

Is there some way to create templates to instantiate persistent VM’s?

Thank you,

Juanjo.

---

<div class="post-metadata">

**Author:** ![DaD](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dad/32/8466_2.png) [@DaD](https://forum.opennebula.io/u/DaD)\
**Post date:** [July 23, 2015, 11:26am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/2 "2015-07-23T11:26:42Z")

</div>

juanjose\_fuentes [forum@opennebula.org](mailto:forum@opennebula.org) writes:

> Hi,

Hello,

> Is there some way to create templates to instantiate persistent VM’s?

Just make the image persistent[1] and use it in a template.

Regards.

Footnotes:  
[1] [Managing Images — OpenNebula 4.12.1 documentation](http://docs.opennebula.org/4.12/user/virtual_resource_management/img_guide.html#making-images-persistent)  
[signature.asc](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/e/e80d87c298efa6bfbe5a771e44a7ccb4c0c2848a.asc) (342 Bytes)

---

<div class="post-metadata">

**Author:** ![juanjose\_fuentes](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@juanjose\_fuentes](https://forum.opennebula.io/u/juanjose_fuentes)\
**Post date:** [July 23, 2015, 11:46am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/3 "2015-07-23T11:46:52Z")

</div>

Sorry, I think I didn’t explained myself correctly. I mean if it could be possible to instantiate a persistent templante n-times.

---

<div class="post-metadata">

**Author:** ![splash](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@splash](https://forum.opennebula.io/u/splash)\
**Post date:** [July 23, 2015, 11:52am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/4 "2015-07-23T11:52:58Z")

</div>

Unfortunately no.  
You could clone a persistent Image + Template and instantiate a new VM from this Template.

src:  
[http://lists.opennebula.org/pipermail/users-opennebula.org/2013-February/039465.html](http://lists.opennebula.org/pipermail/users-opennebula.org/2013-February/039465.html)

---

<div class="post-metadata">

**Author:** ![juanjose\_fuentes](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@juanjose\_fuentes](https://forum.opennebula.io/u/juanjose_fuentes)\
**Post date:** [July 23, 2015, 12:02pm UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/5 "2015-07-23T12:02:02Z")

</div>

Someone knows why is that? I mean philosophically Opennebula is against this behaviour? or just is not implemented yet? and in this case is planned for near-future versions?

---

<div class="post-metadata">

**Author:** ![splash](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@splash](https://forum.opennebula.io/u/splash)\
**Post date:** [August 5, 2015, 9:52am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/6 "2015-08-05T09:52:02Z")

</div>

I don`t think that this feature will be implemented. If you search the old Mailing List you will find Mails from 2013 or later where different people complained about this “feature”. And nothing was done.  
Which is really sad, because this is the main reason, why we not use Opennebula.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ruben/32/19_2.png) [@ruben](https://forum.opennebula.io/u/ruben)\
**Post date:** [August 5, 2015, 10:14am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/7 "2015-08-05T10:14:13Z")

</div>

The problem here is a consistency problem, two VMs cannot modify the same  
disk without a synchronization layer. Typically this is done through a  
shared/distributed FS.

Let say that you have two VMs using the same disk, and both VMs writes the  
disk, which change should persists? what coherence is presented to the VMs?  
So if you want to share a disk between VMs expose it through NFS, GlusterFS  
or any other method.

Could you explain your use case?

---

<div class="post-metadata">

**Author:** ![splash](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@splash](https://forum.opennebula.io/u/splash)\
**Post date:** [August 5, 2015, 11:32am UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/8 "2015-08-05T11:32:33Z")

</div>

@ruben  
I think you want to reply to this thread [Shareable disk image between VMs](https://forum.opennebula.io/t/shareable-disk-image-between-vms/538) ?

Because what we want is a simple workflow, to create a new VM from an Template with a persistent disk.  
The current Workflow for a new VM is:

1. Clone the Template
2. Create a new persistent image and attach it to the new Template.
3. Instantiate a new VM from this Template.

This would be really annoying for us. We are now running an old VMware Installation with ~50 VMs. Every VM is based on an VMware Template but with different Settings, Services etc (a typical Snowflake Server). So in Opennebula we would need 50 different Templates.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/ruben/32/19_2.png) [@ruben](https://forum.opennebula.io/u/ruben)\
**Post date:** [August 6, 2015, 8:16pm UTC](https://forum.opennebula.io/t/template-for-persistent-vms/1030/9 "2015-08-06T20:16:45Z")

</div>

Hi this is totally aligned with out roadmap. In fact the cloud view now  
have a save VM feature which is basically what you are describing, this has  
been generalized for 4.14 and exposed in the admin view.

The process is as follows.

1.- A running VM with the target configuration  
2.- Clone VM, it will copy the disks and create a new template for it  
3.- Instantiate the VM.

However if you want to instantiate a template and make the copy on the fly  
it is slightly different and something we could implement. If you are  
intetested we can reopen:

[http://dev.opennebula.org/issues/2048](http://dev.opennebula.org/issues/2048)

and evaluate its implementation for the next version.

Note also that we are including in 4.14 a flexible instantiate dialog,  
where the user can select vnets and vm capacity without creating a new  
template for the admin view; just as it is exposed in the cloud view.
