Alan Pevec
2008-Oct-21 13:34 UTC
[Ovirt-devel] [PATCH] change iscsi target id to something else than 1
to avoid serial# collision, see http://git.kernel.org/?p=linux/kernel/git/tomo/tgt.git;a=blob;f=usr/spc.c;h=ac5c3deacd14e94e15d9b0fcf136bd85b9362ed7;hb=HEAD#l1033 Signed-off-by: Alan Pevec <apevec at redhat.com> --- appliances/ovirt/files/ovirt-server-appliance | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/appliances/ovirt/files/ovirt-server-appliance b/appliances/ovirt/files/ovirt-server-appliance index 778d0ce..e7ba7bd 100644 --- a/appliances/ovirt/files/ovirt-server-appliance +++ b/appliances/ovirt/files/ovirt-server-appliance @@ -8,6 +8,7 @@ # Source functions library . /etc/init.d/functions +TARGET_ID=32101 start() { echo -n "Starting ovirt-server-appliance: " @@ -27,23 +28,23 @@ start() { -R --local /priv.ovirt.org/ --server 192.168.122.1 # Set up the fake iscsi target - tgtadm --lld iscsi --op new --mode target --tid 1 \ + tgtadm --lld iscsi --op new --mode target --tid $TARGET_ID \ -T ovirtpriv:storage # # Now associate them to the LVs # - tgtadm --lld iscsi --op new --mode logicalunit --tid 1 \ + tgtadm --lld iscsi --op new --mode logicalunit --tid $TARGET_ID \ --lun 1 -b /ovirtiscsi/iSCSI3 - tgtadm --lld iscsi --op new --mode logicalunit --tid 1 \ + tgtadm --lld iscsi --op new --mode logicalunit --tid $TARGET_ID \ --lun 2 -b /ovirtiscsi/iSCSI4 - tgtadm --lld iscsi --op new --mode logicalunit --tid 1 \ + tgtadm --lld iscsi --op new --mode logicalunit --tid $TARGET_ID \ --lun 3 -b /ovirtiscsi/iSCSI5 # # Now make them available # - tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL + tgtadm --lld iscsi --op bind --mode target --tid $TARGET_ID -I ALL echo_success echo @@ -53,15 +54,15 @@ stop() { echo -n "Stopping ovirt-server-appliance: " # stop access to the iscsi target - tgtadm --lld iscsi --op unbind --mode target --tid 1 -I ALL + tgtadm --lld iscsi --op unbind --mode target --tid $TARGET_ID -I ALL # unbind the LUNs - tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 3 - tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 2 - tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1 + tgtadm --lld iscsi --op delete --mode logicalunit --tid $TARGET_ID --lun 3 + tgtadm --lld iscsi --op delete --mode logicalunit --tid $TARGET_ID --lun 2 + tgtadm --lld iscsi --op delete --mode logicalunit --tid $TARGET_ID --lun 1 # shutdown the target - tgtadm --lld iscsi --op delete --mode target --tid 1 + tgtadm --lld iscsi --op delete --mode target --tid $TARGET_ID kill $(cat /var/run/dnsmasq.pid) -- 1.5.5.1
Chris Lalancette
2008-Oct-21 14:01 UTC
[Ovirt-devel] [PATCH] change iscsi target id to something else than 1
Alan Pevec wrote:> to avoid serial# collision, see > http://git.kernel.org/?p=linux/kernel/git/tomo/tgt.git;a=blob;f=usr/spc.c;h=ac5c3deacd14e94e15d9b0fcf136bd85b9362ed7;hb=HEAD#l1033I could have sworn tgtd use to do something sane here, but I could be wrong. In any case, this should eliminate a common collision where people use TID 1, and collide with us. If people use two external tgtd target's with TID 1, there's nothing we can do at the moment; they are going to collide. But at least this is a little bit better. ACK Chris Lalancette