# How can I create a new template from a virtual machine to clone?

**URL:** <https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937>\
**Category:** Product Support\
**Created:** [June 26, 2015, 5:44pm UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937 "2015-06-26T17:44:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![francisco](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@francisco](https://forum.opennebula.io/u/francisco)\
**Post date:** [June 26, 2015, 5:44pm UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937/1 "2015-06-26T17:44:57Z")

</div>

Dear forum,

I am trying to create a new template for deploying later on virtual machines clone. For example:

1- Create a new machine, modify and convert to template.  
2- Clone this template in new virtuals machines to use.

Is this possible?

Regards.

---

<div class="post-metadata">

**Author:** ![hsanjuan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/hsanjuan/32/4372_2.png) [@hsanjuan](https://forum.opennebula.io/u/hsanjuan)\
**Post date:** [June 28, 2015, 3:59pm UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937/2 "2015-06-28T15:59:52Z")

</div>

You can only clone and modify templates. To my knowledge, there is no way to turn a VM back into a template.

---

<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:** [June 28, 2015, 10:35pm UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937/3 "2015-06-28T22:35:23Z")

</div>

We are working on it for one 4.14. Right now you need to do this manually:

1.- Create VM and customize it  
2.- Save the target disks back to the snapshots (or alternatively shutdown  
the VM if not needed)  
3.- Set image as non-persistent  
4.- Create a template using the image  
5.- Create new virtual machines using this new template

Cheers

---

<div class="post-metadata">

**Author:** ![Paul\_Batchelor](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/paul_batchelor/32/4193_2.png) [@Paul\_Batchelor](https://forum.opennebula.io/u/Paul_Batchelor)\
**Post date:** [June 29, 2015, 9:51am UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937/4 "2015-06-29T09:51:30Z")

</div>

I have a ruby script which can generate a template from a VM. It’s intended to capture changes that were made to a running VM. (e.g. hot-added disks/network adapters). I’ll see what I can do about getting it open-sourced.

---

<div class="post-metadata">

**Author:** ![francisco](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@francisco](https://forum.opennebula.io/u/francisco)\
**Post date:** [July 2, 2015, 4:24pm UTC](https://forum.opennebula.io/t/how-can-i-create-a-new-template-from-a-virtual-machine-to-clone/937/5 "2015-07-02T16:24:05Z")

</div>

Thank you.

I will carry out this tip.
