Bug #3287

Wrong DATASTORE_ID when cloning to another datastore

Added by Laurent Grawet over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:11/02/2014
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - Storage
Target version:Release 4.10.1
Resolution:worksforme Pull request:
Affected Versions:OpenNebula 4.8

Description

Hi,

I have to manage a special case when cloning to another datastore in my own drivers.
I compare the target DS ID
/DS_DRIVER_ACTION_DATA/DATASTORE/ID

with the source DS ID
/DS_DRIVER_ACTION_DATA/IMAGE/DATASTORE_ID

but they are both set to source datastore ID !
I have not yet checked values of all other parameters.

Thank you,

Laurent

History

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

  • Target version changed from Release 4.10 to Release 4.12

#2 Updated by Ruben S. Montero over 6 years ago

  • Target version changed from Release 4.12 to Release 4.10.1

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

  • Assignee set to Jaime Melis

#4 Updated by Jaime Melis over 6 years ago

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

I've doubled checked this and I'm not able to replicate this error. As far as I can see in my tests /DS_DRIVER_ACTION_DATA/DATASTORE/ID does hold the target ds id.

I'm going to close it for the time being. Feel free to reopen it, but please attach the following info:

Attach Datastore info for both the source and target datastores:

$ onedatastore show -x <id>

Attach Image info

$ oneimage show -x <id>

Edit /var/lib/one/remotes/datastore/fs/clone and temporarily add this to the second line: echo $@ > /tmp/args@

Clone the image:

$ oneimage clone <image_id> test -d <target_ds_id>

Attach the contents of /tmp/args after running the previous command

#5 Updated by Laurent Grawet over 6 years ago

Hi,

You're right, /DS_DRIVER_ACTION_DATA/DATASTORE/ID holds the target ds id and /DS_DRIVER_ACTION_DATA/IMAGE is the new target image, not the source one. Sorry but the documentation is not accurate about it.

So I found the source DATASTORE_ID thanks to /DS_DRIVER_ACTION_DATA/IMAGE/CLONING_ID and

# Get source image properties
XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" 

unset i XPATH_ELEMENTS

while IFS= read -r -d '' element; do
    XPATH_ELEMENTS[i++]="$element" 
done < <(oneimage show -x $CLONING_ID| $XPATH \
                    /IMAGE/DATASTORE_ID)

SRC_DSID="${XPATH_ELEMENTS[0]}" 

Also available in: Atom PDF