Bug #312

useless fix_paths

Added by Martin Kopta over 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:08/11/2010
Priority:NormalDue date:
Assignee:Javi Fontan% Done:

0%

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

Description

Fetched one-2.0 branch, compiled, installed into $HOME/local. Deploying didn't work. Log oned.log says

# following two lines are mine debug messages
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 ONE_LOCATION: /var/lib/one/local/
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 TMCOMMON: /var/lib/one/local//lib/mads/tm_common.sh
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: censored:/storage/images/ubuntu/ubuntu.raw censored:/storage/vms/3/images/disk.0
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: DST: /var/lib/one/local//var/3/images/disk.0
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Creating directory /var/lib/one/local//var/3/images
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Executed "mkdir -p /var/lib/one/local//var/3/images".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Executed "chmod a+w /var/lib/one/local//var/3/images".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Cloning /storage/images/ubuntu/ubuntu.raw
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Executed "cp /storage/images/ubuntu/ubuntu.raw /var/lib/one/local//var/3/images/disk.0".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_clone.sh: Executed "chmod a+w /var/lib/one/local//var/3/images/disk.0".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "mkdir -p /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "cp -R /var/lib/one/local/var/3/context.sh  /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "cp -R /storage/context/ubuntu/init.sh /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "cp -R /storage/context/id_rsa.pub /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "mkisofs -o /var/lib/one/local//var/3/images/disk.1 -J -R /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: LOG - 3 tm_context.sh: Executed "rm -rf /var/lib/one/local//var/3/images/isofiles".
Wed Aug 11 15:01:00 2010 [TM][D]: Message received: TRANSFER SUCCESS 3 -
Wed Aug 11 15:01:01 2010 [VMM][D]: Message received: LOG - 3 Command execution fail: 'mkdir -p /storage/vms/3/images && cat > /storage/vms/3/images/deployment.0 && virsh --connect qemu:///system create /storage/vms/3/images/deployment.0'
Wed Aug 11 15:01:01 2010 [VMM][D]: Message received: LOG - 3 STDERR follows.
Wed Aug 11 15:01:01 2010 [VMM][D]: Message received: LOG - 3 error: Failed to create domain from /storage/vms/3/images/deployment.0
Wed Aug 11 15:01:01 2010 [VMM][D]: Message received: LOG - 3 error: cannot set ownership on /storage/vms/3/images/disk.0: No such file or directory

I commented out fix_* function calls from $ONELOCATION/lib/tm_commands/nfs/*. Works now. Are fix_* functions from tm_common.sh still needed for something?

Associated revisions

Revision 9af844e5
Added by Javi Fontan over 9 years ago

bug #312: changes to fix_path in nfs tm commands

Revision fd8b1db0
Added by Javi Fontan over 9 years ago

Bug #312: fix_paths is only run if VMDIR and VAR dir are different

Revision c931f643
Added by Javi Fontan over 2 years ago

Merge pull request #312 from vholer/bug-5144

Bug 5144 - fs/snap_* BRIDGE_LIST, fixes

History

#1 Updated by Jaime Melis over 9 years ago

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

The fix_* functions are essential. I think it's not working for you because a wrong configuration of the VM_DIR file.

#2 Updated by Martin Kopta over 9 years ago

My VM_DIR path is set to

VM_DIR=/storage/vms

Can somebody explain me please, why is this code so essential?

function fix_paths
{
    if [ -n "$VMDIR" ]; then
        SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
        DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
    fi
}

It does replace VMDIR with something ONE var directory. What for is VM_DIR then, when it is replaced like that. I just don't get it.

#3 Updated by Martin Kopta over 9 years ago

I compiled latest checkout of one-2.0 from git and I was confused by some errors like

/var/oned.log:230:Mon Aug 30 11:13:27 2010 [VMM][D]: Message received: LOG - 31 error: monitor socket did not show up.: Connection refused

After looking into the log of /var/log/libvirt/qemu/one-30.log I found

qemu: could not open disk image /storage/vms/31/images/disk.0: No such file or directory

Of course, the problem was AGAIN those fix_* function. After removing them from tm_commands/nfs/tm_*., my VM runs flawlessly. I am sorry, but I am unable to see those fix_* functions useful. They are just causing trouble to me.

#4 Updated by Javi Fontan over 9 years ago

When VM_DIR is defined the core refers to VM directories using that directory instead of $ONE_LOCATION. That dir is where the files are or are going to be in the physical host. When using SSH drivers that paths are correct, there is the path where we want to clone the image, or where is the image we want to delete, for example. When we are using NFS shared directory we want to do all those actions locally as they will be faster and will be automatically reflected in the remote hosts (supposing the frontend is the NFS server).

I think your case is something like this:

FRONTEND
[/var/lib/one/local/var]
|
| NFS
|
NODE
[/storage/vms]

Paths in brackets is where the images are going to be stored and are share using NFS, that is, the node will have mounted the directory that the frontend sees as /var/lib/one/local/var in /storage/vms.

To clone the machine the TM (transfer manager) will get a command similar to this:

CLONE from censored:/storage/images/ubuntu/ubuntu.raw to censored:/storage/vms/3/images/disk.0

fix_paths command changes $VM_DIR to $ONE_LOCATION as the copy will be done locally. First parameter (the one for ubuntu.raw) will not be changed as it does not contain $VM_DIR (/storage/vms) but the second one (disk.0) will be changed to /var/lib/one/local//var/3/images/disk.0. Now that we have paths translated to frontend paths we can do the copy locally.

If everything is configured correctly all files in the frontend path /var/lib/one/local//var will be accessible at /storage/vms in the nodes and everything should work nicelly.

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

  • Status changed from Closed to Assigned
  • Resolution deleted (worksforme)

OpenNebula 2.0 writes its configuration under $ONE_LOCATION/var/config. Whether a custom VMDIR is defined or not, now the TM scripts always will find a VMDIR variable. This makes TM scripts not to properly "fix" the paths. Example:

/srv/cloud/one/var/25/disk.0

is "fixed" as

/srv/cloud/one/var25/disk.0

#6 Updated by Javi Fontan over 9 years ago

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

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

  • Status changed from 3 to Closed

Also available in: Atom PDF