Bug #3097
volume hot attach stops working after first attach and detach
Status: | Closed | Start date: | 07/25/2014 | |
---|---|---|---|---|
Priority: | Normal | Due 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
Bug #3097: remove target symlink before creating it in the LN and CLONE actions
Bug #3097: remove target symlink before creating it in the LN and CLONE actions
History
#1 Updated by Ruben S. Montero almost 7 years ago
- Assignee set to Jaime Melis
- Target version set to Release 4.8
#2 Updated by Jaime Melis almost 7 years ago
- Status changed from Pending to Closed
- Resolution set to fixed