Bug #3097

volume hot attach stops working after first attach and detach

Added by Jan Horacek over 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:07/25/2014
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - Storage
Target version:Release 4.8
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.6

Description

after first succesful attach and detach of volume to running vm, next attach does not work with error:

Fri Jul 25 16:42:17 2014 [VMM][I]: Command execution fail: /var/lib/one/remotes/tm/lvm/ln xxx.cz:vg-one.lv-one-485 xxx.xxx.xxx.xxx:/var/lib/one//datastores/0/1182/disk.2 1182 1
Fri Jul 25 16:42:17 2014 [VMM][E]: ln: Command " set -e
Fri Jul 25 16:42:17 2014 [VMM][I]: mkdir -p /var/lib/one/datastores/0/1182
Fri Jul 25 16:42:17 2014 [VMM][I]: ln -s "/dev/vg-one/lv-one-485" "/var/lib/one/datastores/0/1182/disk.2"" failed: ln: creating symbolic link `/var/lib/one/datastores/0/1182/disk.2': File exists
Fri Jul 25 16:42:17 2014 [VMM][E]: Error linking /dev/vg-one/lv-one-485
Fri Jul 25 16:42:17 2014 [VMM][I]: ExitCode: 1
Fri Jul 25 16:42:17 2014 [VMM][I]: Failed to execute transfer manager driver operation: tm_attach.
Fri Jul 25 16:42:17 2014 [VMM][E]: Error attaching new VM Disk: Error linking /dev/vg-one/lv-one-485

this is due the symlink disk.2 remains in the datastore.

here is fix for the tm_mad/lvm/mvds that int the end removes the symlink (it looks that this is missing in 4.8 beta sourcecode too)

--- mvds.orig 2014-07-25 19:10:36.072073973 0200
+
+ mvds.fix 2014-07-25 19:10:28.114076119 +0200
@ -70,4 +70,7 @
log "Dumping $SRC to $DST"
ssh_exec_and_log "$SRC_HOST" "$DUMP_CMD" "Error dumping $SRC to $DST"

log "Removing volume symlink $SRC_PATH"
+ssh_exec_and_log "$SRC_HOST" "test -L '$SRC_PATH' && rm '$SRC_PATH'" "Error removing $SRC_PATH"

exit 0

Associated revisions

Revision 4ad798b1
Added by Jaime Melis about 6 years ago

Bug #3097: remove target symlink before creating it in the LN and CLONE actions

Revision 6a8cf3b8
Added by Jaime Melis about 6 years ago

Bug #3097: remove target symlink before creating it in the LN and CLONE actions

History

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

  • Assignee set to Jaime Melis
  • Target version set to Release 4.8

#2 Updated by Jaime Melis about 6 years ago

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

Also available in: Atom PDF