Bug #1421

Relative paths in tm drivers cause deployment failures

Added by Bill Cole almost 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:08/17/2012
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:-
Target version:Release 3.8
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.6

Description

Log example:

Fri Aug 17 00:23:28 2012 [TM][I]: Command execution fail: /var/lib/one/remotes/tm/shared/clone ONE341:/var/lib/one/datastores/102/214fe21493566dc5237d799be7e54b3d openvz.sndnb.cipherspace.net:/vmfs/volumes/0/153/disk.0
Fri Aug 17 00:23:28 2012 [TM][I]: clone: Cloning ../../102/214fe21493566dc5237d799be7e54b3d in openvz.sndnb.cipherspace.net:/vmfs/volumes/0/153/disk.0
Fri Aug 17 00:23:28 2012 [TM][E]: clone: Command "cd /vmfs/volumes/0/153; cp -r ../../102/214fe21493566dc5237d799be7e54b3d /vmfs/volumes/0/153/disk.0" failed: cp: cannot stat `../../102/214fe21493566dc5237d799be7e54b3d': No such file or directory
Fri Aug 17 00:23:28 2012 [TM][E]: Error copying ONE341:/var/lib/one/datastores/102/214fe21493566dc5237d799be7e54b3d to openvz.sndnb.cipherspace.net:/vmfs/volumes/0/153/disk.0
Fri Aug 17 00:23:28 2012 [TM][I]: ExitCode: 1
Fri Aug 17 00:23:28 2012 [TM][E]: Error executing image transfer script: Error copying ONE341:/var/lib/one/datastores/102/214fe21493566dc5237d799be7e54b3d to openvz.sndnb.cipherspace.net:/vmfs/volumes/0/153/disk.0

This specific case failed due to the fact that the datastore roots under /vmfs/volumes/ were symlinks to NFS mounts. Unexpected results from walking up a directory tree with '..' across symlinked mount points are to be expected.

The best way to avoid those problems is to not use ".." to get to a directory that you can easily use a name for. Specifically, the /var/lib/one/remotes/tm/{shared,vmware,qcow2}/{ln,clone} scripts all have this line:

SRC_PATH="../../${SRC_PATH##"$DS_DIR/"}"

I think these all should be replaced with a less fragile construction:

SRC_PATH="$RMT_DS_DIR/${SRC_PATH##"$DS_DIR/"}"

This change would match the way DST_PATH is being set in the neighboring 'mvds' scripts.

Associated revisions

Revision 841120b6
Added by Jaime Melis almost 9 years ago

Bug #1421: Relative paths in tm drivers cause deployment failures

Revision 5712f56a
Added by Jaime Melis almost 9 years ago

Bug #1421: remove set_ds_location function

History

#1 Updated by Bill Cole almost 9 years ago

Addition change needed for those files is to add a call to "set_ds_location" (which sets $RMT_DS_DIR) at line 36 as with the mvds scripts.

#2 Updated by Ruben S. Montero almost 9 years ago

  • Target version set to Release 3.8

#3 Updated by Ruben S. Montero almost 9 years ago

  • Assignee set to Jaime Melis

#4 Updated by Ruben S. Montero almost 9 years ago

  • Status changed from New to Assigned

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

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Now the TM drivers do not use relative paths. THANKS for the feedback!

Also available in: Atom PDF