[one-ecosystem] VM_DIR and tm_nfs clone disconnected ? Part II

gary mazzaferro garym at oedata.com
Thu Jun 3 19:11:07 PDT 2010


I have made some progress tracking down the root cause of this issue.

In tm_common.sh, function fix_paths significantly alters the image file
source and destination path strings. I would make the changes, but I'd like
to know the intent of the code.

In the tm_commom.sh script below, variables ONE_CONF and ONE_LOCAL_VAR are
setup depending on whether environment variable ONE_LOCATION is configured.
If the location variable is not set, the default system install path is
used. When the location variable is set, the string has either a
"/etc/oned.conf" and a "/var" appended to it.

In my configuration, I would have:
ONE_CONF: /opt/one/etc/oned.conf
ONE_LOCAL_VAR= /opt/one/var

>From tm_common.sh:

if [ -z "$ONE_LOCATION" ]; then
    ONE_CONF=/etc/one/oned.conf
    ONE_LOCAL_VAR=/var/lib/one
else
    ONE_CONF=$ONE_LOCATION/etc/oned.conf
    ONE_LOCAL_VAR=$ONE_LOCATION/var
fi

Below,  function "get_vmdir" sets variable VMDIR to the path. In my case its
"/vm-images"

function get_vmdir
{
    VMDIR=`cat $ONE_CONF | grep ^VM_DIR= | cut -d= -f2`
}


If the VMDIR is set,  function fix_paths attempts to adjust the source and
destination. I'm not sure what they are trying to achieve here,
concatenating the existing path, the VMDIR and local var path or a
substitution ?

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





On Thu, Jun 3, 2010 at 2:22 PM, gary mazzaferro <garym at oedata.com> wrote:

> Hi,
>
> I'm deploying on xen with shared disk for cluster nodes. I have the VM_DIR
> set to /vm-images. This configuration seems to be causing a deployment
> failure.
>
> When I attempt to clone disk image
> /vm-images/install/Demo-Target-Baseline.img, the clone script attempts to
> source it from /opt/one/var/install/Demo-Target-Baseline.img. I was
> expecting to see it sourced from the location defined in the template.
> During the clone operation, the clone script places the destination file in
> /opt/one/var/<VM_ID>/images instead of /vm-images/<VM_ID>. The iso file for
> the context, other context scripts and deployment.0 file are also placed in
> directory /opt/one/var/<VM_ID>/images.
>
> This where I run into the failure;  the ssh call to the xen utilities
> specifies the deployment.0 file in the /vm-images/<VM_ID>/images directory,
> not in /opt/one/var/<VM_ID>/images.
>
> I'm assuming its another config issue on my end.  How do I fix this ?
>
> cheers,
> gary
>
>
> oned.log
>
> Thu Jun  3 13:33:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> occi-server:/vm-images/install/Demo-Target-Baseline.img 10.1.254.117:
> /vm-images/13/images/disk.0
> Thu Jun  3 13:33:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> DST: /opt/one/var/13/images/disk.0
> Thu Jun  3 13:33:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> Creating directory /opt/one/var/13/images
> Thu Jun  3 13:33:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> Executed "mkdir -p /opt/one/var/13/images".
> Thu Jun  3 13:33:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> Executed "chmod a+w /opt/one/var/13/images".
> Thu Jun  3 13:3 3:52 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> Cloning /opt/one/var/install/Demo-Target-Baseline.img
> Thu Jun  3 13:33:53 2010 [TM][D]: Message received: LOG - 13 tm_clone.sh:
> Executed "chmod a+w /opt/one/var/13/images/disk.0".
> Thu Jun  3 13:33:53 2010 [TM][D]: Message received: LOG - 13 tm_context.sh:
> Executed "mkisofs -o /opt/one/var/13/images/disk.1 -J -R
> /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:53 2010 [TM][D]: Message received: LOG - 13 tm_context.sh:
> Executed "rm -rf /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:54 2010 [TM][D]: Message received: TRANSFER SUCCESS 13 -
> Thu Jun  3 13:33:54 2010 [VMM][D]: Message received: LOG - 13 Command
> execution fail: 'cat > /vm-images/13/images/deployment.0 && sudo
> /usr/sbin/xm create /vm-images/13/images/deployment.0 && sudo /usr/sbin/xm
> sched-cred -d one-13 -w 128'
> Thu Jun  3 13:33:54 2010 [VMM][D]: Message received: LOG - 13 STDERR
> follows.
> Thu Jun  3 13:33:54 2010 [VMM][D]: Message received: LOG - 13 bash:
> /vm-images/13/images/deployment.0: No such file or directory
> Thu Jun  3 13:33:54 2010 [VMM][D]: Message received: LOG - 13 ExitCode: 1
> Thu Jun  3 13:33:55 2010 [VMM][D]: Message received: DEPLOY FAILURE 13 -
> Thu Jun  3 13:33:58 2010 [TM][D]: Message received: LOG - 13 tm_delete.sh:
> Deleting /opt/one/var/13/images
>
>
>
> <VM_ID>vm.log
> Thu Jun  3 12:51:51 2010 [DiM][I]: New VM state is ACTIVE.
> Thu Jun  3 12:51:53 2010 [LCM][I]: New VM state is PROLOG.
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh:
> occi-server:/vm-images/install/Demo-Target-Baseline.img 10.1.254.117:
> /vm-images/13/images/disk.0
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh: DST:
> /opt/one/var/13/images/disk.0
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh: Creating directory
> /opt/one/var/13/images
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh: Executed "mkdir -p
> /opt/one/var/13/images".
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh: Executed "chmod a+w
> /opt/one/var/13/images".
> Thu Jun  3 13:33:52 2010 [TM][I]: tm_clone.sh: Cloning
> /opt/one/var/install/Demo-Target-Baseline.img
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_clone.sh: Executed "cp
> /opt/one/var/install/Demo-Target-Baseline.img
> /opt/one/var/13/images/disk.0".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_clone.sh: Executed "chmod a+w
> /opt/one/var/13/images/disk.0".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_context.sh: Executed "mkdir -p
> /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_context.sh: Executed "cp -R
> /opt/one/var/13/context.sh /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_context.sh: Executed "cp -R
> /vm-images/VMs/init.sh /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_context.sh: Executed "mkisofs -o
> /opt/one/var/13/images/disk.1 -J -R /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:53 2010 [TM][I]: tm_context.sh: Executed "rm -rf
> /opt/one/var/13/images/isofiles".
> Thu Jun  3 13:33:54 2010 [LCM][I]: New VM state is BOOT
> Thu Jun  3 13:33:54 2010 [VMM][I]: Generating deployment file:
> /opt/one/var/13/deployment.0
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/ecosystem-opennebula.org/attachments/20100603/a3ec4c83/attachment-0002.htm>


More information about the Ecosystem mailing list