# Oneimage create not working

**URL:** <https://forum.opennebula.io/t/oneimage-create-not-working/5664>\
**Category:** Product Support\
**Created:** [February 1, 2018, 9:37am UTC](https://forum.opennebula.io/t/oneimage-create-not-working/5664 "2018-02-01T09:37:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobx](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tobx](https://forum.opennebula.io/u/tobx)\
**Post date:** [February 1, 2018, 9:37am UTC](https://forum.opennebula.io/t/oneimage-create-not-working/5664/1 "2018-02-01T09:37:22Z")

</div>

Hey,

I am trying to import an image to our ceph cluster via oneimage create. I use the following command:

`oneimage create -d 104 --name mailserver --path /home/one/image.qcow2`

also trying with /var/tmp

`oneimage create -d 104 --name mailserver --path /var/tmp/image.qcow2`

always leads to:

`[one.image.allocate] Cannot parse image SIZE:`

And in oned.log nothing special:

```
Thu Feb 1 10:36:07 2018 [Z0][ReM][D]: Req:1440 UID:0 one.image.allocate invoked , "NAME="mailserver"...", 102
Thu Feb 1 10:36:08 2018 [Z0][ReM][E]: Req:1440 UID:0 one.image.allocate result FAILURE [one.image.allocate] Cannot parse image SIZE:

```

Thank you for helping.

NOTE: For the first command I have added /home/one to the list of SAFE\_DIRS of datastore with 104.

---

<div class="post-metadata">

**Author:** ![VURoland](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vuroland/32/7682_2.png) [@VURoland](https://forum.opennebula.io/u/VURoland)\
**Post date:** [February 1, 2018, 8:25pm UTC](https://forum.opennebula.io/t/oneimage-create-not-working/5664/2 "2018-02-01T20:25:53Z")

</div>

hi,

The error message is just a notification that the produced result cannot be read, so size is unknown.  
I’m not sure if this helps, but in the docs they show you how to first create a template, with details like “path” in it. Then they create the image using that template, to the datastore.  
Seems you can’t create the image from a file straight into a datastore.

source: [https://docs.opennebula.org/5.4/operation/vm\_management/img\_guide.html](https://docs.opennebula.org/5.4/operation/vm_management/img_guide.html)

To register it from the command line you need to create a new image template, and submit it using the oneimage create command.

The complete reference for the image template is here. This is how a sample template looks like:

```
cat ubuntu_img.one
NAME = "Ubuntu"
PATH = "/home/cloud/images/ubuntu-desktop/disk.0"
TYPE = "OS"
DESCRIPTION = "Ubuntu desktop for students."

```

You need to choose the Datastore where to register the new Image. To know the available datastores, use the onedatastore list command. In a clean installation you will only have one datastores with type img, default.

```
onedatastore list
  ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT
   0 system 145.2G 56% 0 0 sys - shared on
   1 default 145.2G 56% 0 3 img fs shared on
   2 files 145.2G 56% 0 0 fil fs ssh on

```

To submit the template, you just have to issue the command

```
oneimage create ubuntu_img.one --datastore default
ID: 0
```
