[one-users] Fwd: Re: Possible bug in /var/lib/one/lib/sh/scripts_common.sh , while having Ubuntu 12.4 as iSCSI target

cloud.b.lab cloud.b.lab at zoho.com
Wed Jul 25 05:53:15 PDT 2012


Thanks

============ Forwarded message ============
>From : Carlos Martín Sánchez<cmartin at opennebula.org>
To : "cloud.b.lab" <cloud.b.lab at zoho.com>
Cc : "users" <users at lists.opennebula.org>
Date : Wed, 25 Jul 2012 02:21:17 -0700
Subject : Re: [one-users] Possible bug in /var/lib/one/lib/sh/scripts_common.sh , while having Ubuntu 12.4 as iSCSI target
============ Forwarded message ============


Hi,

This is a known issue [1, 2], but thanks for the great feedback!


Cheers


[1] http://opennebula.org/documentation:rel3.6:known_issues
 [2] http://dev.opennebula.org/issues/1351
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open-source Solution for Data Center Virtualization www.OpenNebula.org | cmartin at opennebula.org | @OpenNebula
 
 

On Tue, Jul 24, 2012 at 5:19 PM, cloud.b.lab <cloud.b.lab at zoho.com> wrote:
 Hi,

With reference to:

File name :  /var/lib/one/lib/sh/scripts_common.sh
Function  :   function tgt_admin_dump_config
 Line #     : echo "$TGTADMIN --dump |sudo tee $FILE_PATH >/dev/null" 

Snippet from the code:
                                     function tgt_admin_dump_config {
                                     FILE_PATH="$1"
                                     echo "$TGTADMIN --dump |sudo tee $FILE_PATH >/dev/null"
                                      }
Scenario:
1. OpenNebula front-end       :       CentOS 6.3 server   
 2. OpenNebula node              :       Centos 6.3 Server
3. iSCSI Target in                    :       Ubuntu 12.04 server  [192.168.1.7]
4. iSCSI  Initiator in               :      OpenNebula Front end (CentOS 6.3 Server)
 
5. Create a iSCSI datastore in front end with following definition 
NAME = production
BASE_IQN="iqn.2012-02.org.opennebula"
DISK_TYPE="block"
DS_MAD="iscsi"
 HOST="192.168.1.7"
TM_MAD="iscsi"
VG_NAME="vg-one"

   ID NAME                      CLUSTER         IMAGES TYPE   TM
   0 system                     -                    0         -        shared
    1 default                     -                    1         fs       shared
 101 production               -                    2         iscsi    iscsi

6. Creates a new Image (ttylinux.img) with the below template contents in to the iSCSI datastore
 NAME = ttylinuxiscsi-3
PATH = "/var/lib/images/ttylinux.img"
TYPE = OS

Problem definition:
While copying the image to the iSCSI target, error  ">/dev/null" failed: sh: 12: Syntax error: Bad fd number" is reported.
 
Extract from oned.log:
Tue Jul 24 02:51:24 2012 [ImM][I]: sudo tgtadm --lld iscsi --op new --mode logicalunit --tid $TID  --lun 1 --backing-store /dev/vg-one/lv-one-13
Tue Jul 24 02:51:24 2012 [ImG][D]: Message received: LOG I 13 sudo tgt-admin --dump |sudo tee /etc/tgt/targets.conf >& /dev/null" failed: sh: 12: Syntax error: Bad fd number
 
Tue Jul 24 02:51:24 2012 [ImM][I]: sudo tgt-admin --dump |sudo tee /etc/tgt/targets.conf >& /dev/null" failed: sh: 12: Syntax error: Bad fd number
Tue Jul 24 02:51:24 2012 [ImG][D]: Message received: LOG E 13 Error registering 192.168.1.7:/dev/vg-one/lv-one-13
 
Tue Jul 24 02:51:24 2012 [ImM][E]: Error registering 192.168.1.7:/dev/vg-one/lv-one-13
Tue Jul 24 02:51:24 2012 [ImG][D]: Message received: LOG I 13 ExitCode: 2

Tue Jul 24 02:51:24 2012 [ImM][I]: ExitCode: 2
 Tue Jul 24 02:51:24 2012 [ImG][D]: Message received: CP FAILURE 13 Error registering 192.168.1.7:/dev/vg-one/lv-one-13

Reason : It happens Ubuntu 12.04 , because , Ubuntu has dash (/bin/sh) and not bash. 
 

If I change  ">& /dev/null" to   ">/dev/null 2>&1"" , the image copies smoothly to the iSCSI target with no FD number error.

Corrected version:
 
function tgt_admin_dump_config {
    FILE_PATH="$1"
    echo "$TGTADMIN --dump |sudo tee $FILE_PATH >/dev/null 2>&1"
}

Tue Jul 24 02:55:22 2012 [ImG][D]: Message received: STAT SUCCESS 2 40
 
Tue Jul 24 02:55:22 2012 [ImM][I]: Copying /var/lib/images/ttylinux.img to repository for image 14
Tue Jul 24 02:55:26 2012 [ImG][D]: Message received: LOG I 14 cp: Copying local image /var/lib/images/ttylinux.img to the image repository
 
Tue Jul 24 02:55:26 2012 [ImM][I]: cp: Copying local image /var/lib/images/ttylinux.img to the image repository
Tue Jul 24 02:55:26 2012 [ImG][D]: Message received: LOG I 14 ExitCode: 0

Tue Jul 24 02:55:26 2012 [ImM][I]: ExitCode: 0
 Tue Jul 24 02:55:26 2012 [ImG][D]: Message received: CP SUCCESS 14 iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14



Regards,
Anil.
cloud-b-lab

 

_______________________________________________
 Users mailing list
 Users at lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
 



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120725/610ef018/attachment-0003.htm>


More information about the Users mailing list