Bug #55

tm_ln.sh does not make image directories

Added by Ruben S. Montero over 12 years ago. Updated over 12 years ago.

Status:ClosedStart date:
Priority:HighDue date:
Assignee:Javi Fontan% Done:

0%

Category:Drivers - Auth
Target version:Release 1.2
Resolution:fixed Pull request:
Affected Versions:

Description

This error was reported by Marcos Dias de Assuncao in the mailing list:

However, as we are using NFS and we are not cloning the virtual
machine images, we had another problem. When we submitted a VM, it
failed and the vm.log showed:

Sat Nov 22 11:39:04 2008 [DiM][I]: New VM state is ACTIVE.
Sat Nov 22 11:39:04 2008 [LCM][I]: New VM state is PROLOG.
Sat Nov 22 11:39:04 2008 [TM][I]: tm_ln.sh: Link /home/oneadmin/vm/
domains/opensuse11/OpenSuse11.img
Sat Nov 22 11:39:04 2008 [TM][I]: tm_ln.sh: ERROR: Command "ln -s /
home/oneadmin/vm/domains/opensuse11/OpenSuse11.img /home/oneadmin/
[[OpenNebula]]/var/7/images/disk.0" failed.
Sat Nov 22 11:39:04 2008 [TM][I]: tm_ln.sh: ERROR: ln: creating
symbolic link @/home/oneadmin/OpenNebula/var/7/images/disk.0': No
such file or directory
Sat Nov 22 11:39:04 2008 [TM][E]: Error excuting image transfer
script: ln: creating symbolic link @/home/oneadmin/OpenNebula/var/7/
images/disk.0': No such file or directory
Sat Nov 22 11:39:05 2008 [DiM][I]: New VM state is FAILED

We solved the issue by modifying ONE_LOCATION/lib/tm_commands/nfs/
tm_ln.sh from:

#!/bin/bash

 SRC=$1
 DST=$2

 . $ONE_LOCATION/libexec/tm_common.sh

 SRC_PATH=@arg_path $SRC@
 DST_PATH=@arg_path $DST@

 log "Link $SRC_PATH" 
 exec_and_log "ln -s $SRC_PATH $DST_PATH" 

to:

#!/bin/bash

 SRC=$1
 DST=$2

 . $ONE_LOCATION/libexec/tm_common.sh

 SRC_PATH=@arg_path $SRC@
 DST_PATH=@arg_path $DST@

 DST_DIR=@dirname $DST_PATH@

 log "Creating directory $DST_DIR" 
 exec_and_log "mkdir -p $DST_DIR" 
 exec_and_log "chmod a+w $DST_DIR" 

 case $SRC in
 http://*)
      log "Cannot link website $SRC" 
      exit -1
      ;;

 *)
      log "Link $SRC_PATH" 
      exec_and_log "ln -s $SRC_PATH $DST_PATH" 
      ;;
 esac

After this last change, our VM worked like a charm

History

#1 Updated by Javi Fontan over 12 years ago

  • Resolution set to fixed

Solved in r268

Also available in: Atom PDF