Image datastore on LVM

Probably dumb question but I cannot find an answer.
I have 2 servers. One is front-end and host node, second one is pure host node.
I have a storage attached via SCSI and 2 LUNs.

OpenNebula 5.10.1
RHEL 7.8
I’m following this manual: http://docs.opennebula.io/5.10/deployment/open_cloud_storage_setup/lvm_drivers.html#

For the system datastore all fine: I create a volume, I can see that volume on both hosts and size is quite correct:

vgscan
Reading all physical volumes. This may take a while…
Found volume group “vg-one-104” using metadata type lvm2
Found volume group “vg-one-108” using metadata type lvm2


onedatastore show 104
DATASTORE 104 INFORMATION
ID : 104
NAME : lvm_system
USER : oneadmin
GROUP : oneadmin
CLUSTERS : 100
TYPE : SYSTEM
DS_MAD : -
TM_MAD : fs_lvm
BASE PATH : /var/lib/one//datastores/104
DISK_TYPE : FILE
STATE : READY

DATASTORE CAPACITY
TOTAL:         : 500G
FREE:          : 487.4G
USED:          : 12.6G
LIMIT:         : -

PERMISSIONS
OWNER          : um-
GROUP          : u--
OTHER          : ---

DATASTORE TEMPLATE
ALLOW_ORPHANS="NO"
BRIDGE_LIST="swmgmtsbx01.bdap swmgmtsbx02.bdap"
DISK_TYPE="FILE"
DS_MIGRATE="YES"
RESTRICTED_DIRS="/"
SAFE_DIRS="/var/tmp"
SHARED="YES"
TM_MAD="fs_lvm"
TYPE="SYSTEM_DS"

IMAGES

For the Image datastore I follow the procedure:
Config file:

cat image.conf
NAME = image
DS_MAD = fs
TM_MAD = fs_lvm
DISK_TYPE = “BLOCK”
TYPE = IMAGE_DS
SAFE_DIRS="/var/tmp /tmp"

Info:

onedatastore show 108
DATASTORE 108 INFORMATION
ID : 108
NAME : image
USER : oneadmin
GROUP : oneadmin
CLUSTERS : 100
TYPE : IMAGE
DS_MAD : fs
TM_MAD : fs_lvm
BASE PATH : /var/lib/one//datastores/108
DISK_TYPE : BLOCK
STATE : READY

DATASTORE CAPACITY
TOTAL: : 4G
FREE: : 1.2G
USED: : 2.8G
LIMIT: : -

PERMISSIONS
OWNER : um-
GROUP : u–
OTHER : —

DATASTORE TEMPLATE
ALLOW_ORPHANS=“NO”
CLONE_TARGET=“SYSTEM”
DISK_TYPE=“BLOCK”
DRIVER=“raw”
DS_MAD=“fs”
LN_TARGET=“SYSTEM”
SAFE_DIRS="/var/tmp /tmp"
TM_MAD=“fs_lvm”
TYPE=“IMAGE_DS”

IMAGES

But first of all instead of LUN size (10GB) I see actual file system size (4GB for /var).
And if I put any file to that datastore via Frontend this file is not available on Host2

It is mentioned that

The frontend needs to have access to the images datastore, mounting the associated directory.

But to mount something I need to create LVM with filesystem, and from that point it will be not available on host2.
As a solution I can use cLVM, but manual said I don’t need it.

What step did I miss?

Hello,

Images are stored as regular files (under the usual path: /var/lib/one/datastores/) in the Image Datastore, but they will be dumped into a Logical Volumes (LV) upon virtual machine creation. The virtual machines will run from Logical Volumes in the node.

http://docs.opennebula.io/5.0/deployment/open_cloud_storage_setup/lvm_drivers.html#datastore-layout

So IMAGE_DS can be just on frontend node and when VM is created, it is copied from frontend to compute node LVM volume. On termination, it is copied back to frontend to image_ds when it is a persistent disk.

Edit: When I am looking into source code I don’t see copy over ssh from frontend. So you can have it on frontend + install nfs server on it and export to compute nodes. Personaly, I think it is better to extend source code to copy via ssh and skip nfs server.