VM creation failed: "No such file or directory"

Hello guys.:smiley:

I have a problem with the implementation of opennebula (6.4.0.1) in CentOS 7.5. When I started my virtual machine c75-1, the LCM State stays in “PROLOG_FAILURE” state. This is the error:

The error log:
image

This may be the problem:
** failed: cp: cannot stat ‘/var/lib/one//datastores/108/7daaa92551d7be6cbf94c24aeef98818’: No such file or directory**

I can ssh from “master” to “store2” as oneadmin, but it still report this error.

Looking forward to your reply!

It looks like the file backing the image is not present on the image datastore.

Check the image you are using to deploy the VM with oneimage show <image_ID> then there should be a SOURCE attribute for that image which should be what the storage driver is complaining about it missing, namely /var/lib/one//datastores/108/7daaa92551d7be6cbf94c24aeef98818. Then just to be sure the oneadmin user can access the file, issue a file /var/lib/one//datastores/108/7daaa92551d7be6cbf94c24aeef98818 as the oneadmin user in the frontend.

Thanks for your reply.

Check the image:
oneimage show 5:
`[root@master ~]# oneimage show 5
IMAGE 5 INFORMATION
ID : 5
NAME : c75
USER : oneadmin
GROUP : oneadmin
LOCK : None
DATASTORE : image
TYPE : OS
REGISTER TIME : 11/30 15:46:14
PERSISTENT : No
SOURCE : /var/lib/one//datastores/108/7daaa92551d7be6cbf94c24aeef98818
PATH : /var/lib/one/CentOS-7-x86_64-Minimal-1804.iso
FORMAT : raw
SIZE : 906M
STATE : used
RUNNING_VMS : 1

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

IMAGE TEMPLATE
DEV_PREFIX=“sd”

VIRTUAL MACHINES

ID USER GROUP NAME STAT CPU MEM HOST TIME
10 oneadmin oneadmin c75-1 fail 1 2G store2 0d 18h25`

I try to copy /var/lib/one//datastores/108/7daaa92551d7be6cbf94c24aeef98818 to /var/lib/one/datastores/107/10/disk.0 as oneadmin user, but this is the error:
cp: cannot create regular file ‘/var/lib/one/datastores/107/10/disk.0’: No such file or directory

File 10 isn’t in /var/lib/one/datastores/107. Then I create file /var/lib/one/datastores/107/10 manually. After that, I can copy image to /var/lib/one/datastores/107/10:

Looks like for some reason the directory 10 which maps to a VM with ID 10 wasn’t created. This directory is supposed to be created in the system datastore when the VM is created as it will hold every file required for the VM creation including disks, the context ISO and the hypervisor level VM description.