<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'>Hi,<br><br><b>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.<br></b><br>Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 mkdir -p /var/lib/one/var/datastores/0/13<br><br>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<br><br>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<br><br>Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 sleep 2<br><br>T<b><font color="rgb(255, 0, 0)">ue 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)<br><br>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<br></font></b><br>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<br><br>Tue Jul 24 06:03:03 2012 [TM][D]: Message received: LOG I 13 ExitCode: 1<br><br>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<br><br><br><b>I checked the code of the<font color="rgb(255, 0, 119)"> <span style="background-color: rgb(254, 255, 51);">/var/lib/one/var/remotes/tm/iscsi/clone</span></font> script and suspect some problem there: Especially in the portion highlighted below.<br></b><br>DISCOVERY_CMD=$(cat <<EOF<br> set -e<br> mkdir -p $DST_DIR<br> $SUDO $(iscsiadm_discovery "$TARGET_HOST")<br> $SUDO $(iscsiadm_login "$NEW_IQN" "$TARGET_HOST")<br> sleep 2<br> DISK_BY_PATH=\$(ls /<b style="background-color: rgb(254, 255, 0);">dev/disk/by-path</b>/*$NEW_IQN-lun-1)<br> echo "$DISK_BY_PATH"<br> <span style="background-color: rgb(255, 0, 0);"> ln -s "\$DISK_BY_PATH" "$DST_PATH"</span><br>EOF<br>)<br><br>ssh_exec_and_log "$DST_HOST" "$DISCOVERY_CMD" \<br> "Error discovering $NEW_IQN in $DST_HOST"<br><br><br>Can someone have a look at it and provide a update soon?<br><br><br>Also,<br><br><b>The way ISCSI target login is done is also to be looked in to :<br>As per existing clone script, a discover command looks like below</b><br><br>sudo iscsiadm -m node --targetname<span style="background-color: rgb(254, 255, 51);"> i</span><font style="background-color: rgb(254, 255, 51);" color="rgb(255, 0, 238)">qn.2012-02.org.opennebula:192.168.1.7.vg-one.lv-one-14-12</font> -p 192.168.1.7 --login<br><b style="background-color: rgb(255, 51, 51);">iscsiadm: No records found</b><br><br>This command returns "iscsiadm: No records found" error<br><br><b>But if I execute the below modified one, login happens sucessfully<br></b><br>root@centoshost ~]# sudo iscsiadm --mode node --targetname <font color="rgb(34, 34, 34)"><span style="background-color: rgb(51, 255, 51);">iqn.2012-02.org.opennebula:target0</span></font> --portal 192.168.1.7:3260 --login<br>Logging in to [iface: default, target: iqn.2012-02.org.opennebula:target0, portal: 192.168.1.7,3260] (multiple)<br>Login to [iface: default, target: iqn.2012-02.org.opennebula:target0, portal: 192.168.1.7,3260]<span style="background-color: rgb(0, 255, 0);"> successful.</span><br><br><b>That means the output of the below command to be used as an input for the Target --login command</b><br>[root@centoshost ~]# sudo iscsiadm -m discovery -t st -p 192.168.1.7<br>192.168.1.7:3260,1<font style="background-color: rgb(0, 204, 0);" color="rgb(34, 34, 34)"> iqn.2012-02.org.opennebula:target0</font><br><br><br><br>Regards,<br>Anil Kumar.<br><br><br><br></div></body></html>