[Solved] Import OVA as ONE template

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.

Morning oscar!
there’s no official procedure in the docs for that but you may start reading this section in the docs 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). If you want to import a Windows VMDK file you may find this post useful..

Once you have the qcow2 file you can upload it to the image datastore as explained in the Managing Images section. Then you should create a template which uses that image and instantiate the template to launch the VM.

Cheers!

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.

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

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!

1 Like

Hi oscar!
you’re absolutely right you can use onevm create to launch a VM from a template file. It’s documented here 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!

1 Like

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!

Oh! thanks then I’ll edit the post :smile: