Bug #2496

Images with SOURCE outside from datastores path are broken on usage

Added by Rolandas Naujikas over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:11/25/2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Core & System
Target version:-
Resolution:worksforme Pull request:
Affected Versions:OpenNebula 4.4

Description

We have some images registered from directory outside of usual ../datastores/.. path.
When I trie to deploy them they fail to copy (clone).

Mon Nov 25 14:55:25 2013 [DiM][I]: New VM state is ACTIVE.
Mon Nov 25 14:55:25 2013 [LCM][I]: New VM state is PROLOG.
Mon Nov 25 14:55:25 2013 [TM][I]: Command execution fail: /var/lib/one/4.3.90/var/remotes/tm/qcow2/clone cloud2:/scratch/lustre/one/images/debian7.qcow2 lxsun21:/scratch/lustre/one/cloud2/101/625/disk.0 625 103
Mon Nov 25 14:55:25 2013 [TM][I]: clone: Cloning /scratch/lustre/one/cloud2/images/debian7.qcow2 in lxsun21:/scratch/lustre/one/cloud2/101/625/disk.0
Mon Nov 25 14:55:25 2013 [TM][E]: Error copying cloud2:/scratch/lustre/one/images/debian7.qcow2 to lxsun21:/scratch/lustre/one/cloud2/101/625/disk.0
Mon Nov 25 14:55:25 2013 [TM][I]: ExitCode: 1
Mon Nov 25 14:55:25 2013 [TM][E]: Error executing image transfer script: Error copying cloud2:/scratch/lustre/one/images/debian7.qcow2 to lxsun21:/scratch/lustre/one/cloud2/101/625/disk.0
Mon Nov 25 14:55:25 2013 [DiM][I]: New VM state is FAILED

/scratch/lustre/one/images/debian7.qcow2 is existing file, but in qcow2/clone SRC_PATH is changed to /scratch/lustre/one/cloud2/images/debian7.qcow2.
Our DATASTORE_LOCATION = /scratch/lustre/one/cloud2 in oned.conf (DATASTORE_BASE_PATH is the same).
The last commit on qcow2/clone is fixing bug #1421.

History

#1 Updated by Ruben S. Montero over 7 years ago

DATASTORE_LOCATION is for the nodes
DATASTORE_BASE_PATH is for the front-end, used to generate SOURCE attributes. It seems that in yout case:

DATASTORE_LOCATION=/scratch/lustre/one/cloud2
DATASTORE_BASE_PATH=/scratch/lustre/one/images

#2 Updated by Rolandas Naujikas over 7 years ago

The problem is with images like

NAME = "debian7" 
DESCRIPTION = "Debian 7 image" 
TYPE = "OS" 
DEV_PREFIX = "vd" 
DRIVER = "qcow2" 
SOURCE = "/scratch/lustre/one/images/debian7.qcow2" 
SIZE = 2048

#3 Updated by Ruben S. Montero over 7 years ago

  • Status changed from Pending to Closed
  • Resolution set to worksforme

It is a requirement that Datastores are mounted under the same path (DATASTORE_LOCATION). The path manipulations in clone are based in this requirement.

This is a "worksforme", just adapt the behavior of the clone operation to your installation as needed.

#4 Updated by Rolandas Naujikas over 7 years ago

Why all those manipulations on source path are required when original

SRC_PATH=`arg_path $SRC`
should be enough for most configurations ? Do SOURCE property usage is broken and should not be used at all ?

#5 Updated by Ruben S. Montero over 7 years ago

Rolandas Naujikas wrote:

Why all those manipulations on source path are required when original [...] should be enough for most configurations ? Do SOURCE property usage is broken and should not be used at all ?

The idea is to have a common schema, independent of the TM driver. So having all the datastores under the same path, and being able to move from a DS to other one just getting the suffix simplifies the management when dealing with other hypervisors, specially VMware.

SOURCE is supported but, it is an attribute to be interpreted by the TM driver. So it is fine to use a SOURCE and adapt your TM. But, if you want to use the stock TM shared drivers, then you need to generate a "compatible" SOURCE attribute. Either linking the image to a path under DATASTORE_LOCATION (in the hosts) and DATASTOTRE_BASE_PATH (in the front-end, where clone operations occur for the FS Datastore); or copying the file there.

#6 Updated by Rolandas Naujikas over 7 years ago

It would be better describe DATASTORE_BASE_PATH in oned.conf similary to DATASTORE_LOCATION:

DATASTORE_BASE_PATH IS ONLY FOR THE FRONT-END AND *NOT* HOSTS

In TM actions SRC or DST could be in DATASTORE_BASE_PATH, another in DATASTORE_LOCATION.

Also available in: Atom PDF