# \[Solved\] Import OVA as ONE template

**URL:** <https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355>\
**Category:** Product Support\
**Created:** [November 27, 2016, 12:14am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355 "2016-11-27T00:14:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/oscar/32/5120_2.png) [@oscar](https://forum.opennebula.io/u/oscar)\
**Post date:** [November 27, 2016, 12:14am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/1 "2016-11-27T00:14:11Z")

</div>

Hi,

I’d like to know if there is any procedure to import a vmdk or ova virtual machine to images datastore and then register it as opennebula template.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [November 29, 2016, 7:44am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/2 "2016-11-29T07:44:37Z")

</div>

Morning oscar!  
there’s no official procedure in the docs for that but [you may start reading this section in the docs](http://docs.opennebula.org/5.2/operation/vm_setup/add_content.html) to know how you can add content to your cloud.

If you want to import a vmdk file and you want to use it for the KVM hypervisor I’d start converting the VMDK file to qcow2 using qemu-img ([you may find this information useful)](http://blog.bodhizazen.net/linux/convert-vmware-vmdk-to-kvm-qcow2-or-virtualbox-vdi/). If you want to import a Windows VMDK file [you may find this post useful.](https://forum.opennebula.io/t/migrating-windows-server-2012-from-vmdk-to-opennebula/3207).

Once you have the qcow2 file you can upload it to the image datastore as explained in the [Managing Images section](http://docs.opennebula.org/5.2/operation/vm_management/img_guide.html#id1). Then you should [create a template which uses that image](http://docs.opennebula.org/5.2/operation/vm_management/vm_templates.html#managing-virtual-machine-templates) and instantiate the template to launch the VM.

Cheers!

---

<div class="post-metadata">

**Author:** ![oscar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/oscar/32/5120_2.png) [@oscar](https://forum.opennebula.io/u/oscar)\
**Post date:** [November 29, 2016, 9:12pm UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/3 "2016-11-29T21:12:12Z")

</div>

Hi,

Have I to create a template? or can I instantiate directly a VM.

The idea is to deploy 2 servers, one for sunstone and the other one for mysql.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![jojo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jojo/32/4953_2.png) [@jojo](https://forum.opennebula.io/u/jojo)\
**Post date:** [November 30, 2016, 10:55am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/4 "2016-11-30T10:55:30Z")

</div>

Yes, as mcabrerizo already stated you’d have to create a template _that uses the images_ you converted and imported to your image store.

opennebula vms can only be instantiated if you have some combination of a template (some vm definition, basically some lines of text) plus an image (the vms disk, the actual data)

that’s basically how vms/instances in opennebula work.

HTH Jojo

---

<div class="post-metadata">

**Author:** ![oscar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/oscar/32/5120_2.png) [@oscar](https://forum.opennebula.io/u/oscar)\
**Post date:** [December 4, 2016, 7:11pm UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/5 "2016-12-04T19:11:14Z")

</div>

Hi, I think you can create a VM from image without using a template just with:

onevm create “file”

In my case the file looks like:

```
NAME = vdicdb01
CPU = 0.5
MEMORY = 512
VCPU = 2

DISK = [IMAGE = "vdicimage"]

NIC = [NETWORK = "public", IP = 192.168.2.3]
NIC = [NETWORK = "interconnect", IP = 192.168.100.3]

NIC_DEFAULT = [MODEL = "virtio"]

#SCHED_DS_REQUIREMENTS = "NAME=\"vidc-vm\""

GRAPHICS = [
  KEYMAP = es,
  type = spice,
  listen = 0.0.0.0]

```

Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [December 6, 2016, 8:28am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/6 "2016-12-06T08:28:32Z")

</div>

Hi oscar!  
you’re absolutely right you can use onevm create to launch a VM from a template file. It’s documented [here](http://docs.opennebula.org/5.2/operation/references/template.html#virtual-machine-definition-template) and I reproduce it here for any user visiting this post for reference:

> A template file consists of a set of attributes that defines a Virtual Machine. Using the command onetemplate create, a template can be registered in OpenNebula to be later instantiated. For compatibility with previous versions, you can also create a new Virtual Machine directly from a template file, using the onevm create command.

Cheers!

---

<div class="post-metadata">

**Author:** ![oscar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/oscar/32/5120_2.png) [@oscar](https://forum.opennebula.io/u/oscar)\
**Post date:** [December 6, 2016, 10:06am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/7 "2016-12-06T10:06:39Z")

</div>

In my case opennebula has not created the template XD

```
[oneadmin@vdicone01 ~]$ onevm list
    ID USER GROUP NAME STAT UCPU UMEM HOST TIME
    36 oneadmin oneadmin vdicdb01 fail 0 0K vdicone01 0d 00h00
[oneadmin@vdicone01 ~]$ onetemplate list
  ID USER GROUP NAME REGTIME

```

[oneadmin@vdicone01 ~]$

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [December 6, 2016, 10:10am UTC](https://forum.opennebula.io/t/solved-import-ova-as-one-template/3355/8 "2016-12-06T10:10:33Z")

</div>

Oh! thanks then I’ll edit the post 😄
