[one-users] Using iSCSI Targets- Cannot create a VM
cloud.b.lab
cloud.b.lab at zoho.com
Tue Jul 24 11:08:07 PDT 2012
Hi,
I am trying to create a VM using a Image created using iSCSI datastore. But getting the following errors, while executing the /var/lib/one/var/remotes/tm/iscsi/clone script.
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 mkdir -p /var/lib/one/var/datastores/0/13
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 sudo iscsiadm -m discovery -t st -p 192.168.1.7
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 sudo iscsiadm -m node --targetname iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-13 -p 192.168.1.7 --login
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 sleep 2
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 DISK_BY_PATH=$(ls /dev/disk/by-path/*iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-13-lun-1)
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 ln -s "$DISK_BY_PATH" "/var/lib/one/var/datastores/0/13/disk.0"" failed: sudo: sorry, you must have a tty to run sudo
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG E 13 Error discovering iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-13 in centosnode
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 ExitCode: 1
Tue Jul 24 06:03:03 2012 [TM][D]: Message received: TRANSFER FAILURE 13 Error discovering iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-13 in centosnode
I checked the code of the /var/lib/one/var/remotes/tm/iscsi/clone script and suspect some problem there: Especially in the portion highlighted below.
DISCOVERY_CMD=$(cat <<EOF
set -e
mkdir -p $DST_DIR
$SUDO $(iscsiadm_discovery "$TARGET_HOST")
$SUDO $(iscsiadm_login "$NEW_IQN" "$TARGET_HOST")
sleep 2
DISK_BY_PATH=\$(ls /dev/disk/by-path/*$NEW_IQN-lun-1)
echo "$DISK_BY_PATH"
ln -s "\$DISK_BY_PATH" "$DST_PATH"
EOF
)
ssh_exec_and_log "$DST_HOST" "$DISCOVERY_CMD" \
"Error discovering $NEW_IQN in $DST_HOST"
Can someone have a look at it and provide a update soon?
Also,
The way ISCSI target login is done is also to be looked in to :
As per existing clone script, a discover command looks like below
sudo iscsiadm -m node --targetname iqn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-12 -p 192.168.1.7 --login
iscsiadm: No records found
This command returns "iscsiadm: No records found" error
But if I execute the below modified one, login happens sucessfully
root at centoshost ~]# sudo iscsiadm --mode node --targetname iqn.2012-02.org.opennebula:target0 --portal 192.168.1.7:3260 --login
Logging in to [iface: default, target: iqn.2012-02.org.opennebula:target0, portal: 192.168.1.7,3260] (multiple)
Login to [iface: default, target: iqn.2012-02.org.opennebula:target0, portal: 192.168.1.7,3260] successful.
That means the output of the below command to be used as an input for the Target --login command
[root at centoshost ~]# sudo iscsiadm -m discovery -t st -p 192.168.1.7
192.168.1.7:3260,1 iqn.2012-02.org.opennebula:target0
Regards,
Anil Kumar.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120724/ea627abf/attachment-0002.htm>
More information about the Users
mailing list