[Ovirt-devel] [Patch] Make iscsi targets for the developer versions

Chris Lalancette clalance at redhat.com
Mon Mar 24 14:09:05 UTC 2008


A few things about this patch:

mark wagner wrote:
> Please review the attached patch. It should make some small iscsi targets for the developer versions 
> of the wui.
> 
> It is not anticipated that these devices will actually be used to hold any data so they are really 
> small, although they are set to "grow" if there is a need for space.
> 
> I also append the commands to the rc.local file in order to properly configure and share them on 
> startup.  tgtadm does not use a config file so things are hardcoded for now.
> 
> Note that these patches *should* be based on the release branch that Chris is working on.

<snip>

>  %include common-lvm.ks
>  
> +# Create some fake iSCSI partitions
> +logvol /iscsi1 --name=iSCSI1 --vgname=VolGroup00 --size=64 --grow
> +logvol /iscsi2 --name=iSCSI2 --vgname=VolGroup00 --size=64 --grow
> +logvol /iscsi3 --name=iSCSI3 --vgname=VolGroup00 --size=64 --grow
> +

The above stuff should go into "common-lvm.ks"; that way, you don't have to
repeat this information for i386 and x86_64 kickstarts.

<snip>

>  %include common-lvm.ks
> +# Create some fake iSCSI partitions
> +logvol /iscsi1 --name=iSCSI1 --vgname=VolGroup00 --size=64 --grow
> +logvol /iscsi2 --name=iSCSI2 --vgname=VolGroup00 --size=64 --grow
> +logvol /iscsi3 --name=iSCSI3 --vgname=VolGroup00 --size=64 --grow

This goes with the above comment of common-lvm.ks

<snip>

> +# Setup the iscsi stuff to be ready on each boot.  Since tgtadm does not use a config file
> +# append what we need to the rc.local file.  Note that this for the developers version only. 
> +
> +cat >> /etc/rc.d/rc.local << \EOF
> +#
> +# Set up the fake iscsi targets
> +tgtadm --lld iscsi --op new --mode target --tid 1 -T node3:disk1
> +tgtadm --lld iscsi --op new --mode target --tid 1 -T node4:disk1
> +tgtadm --lld iscsi --op new --mode target --tid 1 -T node5:disk1
> +#
> +# Now associate them to the LVs
> +# 
> +tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/VolGroup00/iSCSI1
> +tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 -b /dev/VolGroup00/iSCSI2
> +tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 -b /dev/VolGroup00/iSCSI3
> +# 
> +# Now make them available
> +#

My understanding of the iscsi target is admittedly weak, but I'm not sure this
is what you want to do.  As I understand it, this will actually only create one
 target (node5:disk1), with 3 LUN's, because you are overriding the tid in the
top 3 lines.  I think what you probably want is one target per host, and then
one LUN per target, so your commands would look something like:

tgtadm --lld iscsi --op new --mode target --tid 1 -T node3:disk1
tgtadm --lld iscsi --op new --mode target --tid 2 -T node4:disk1
tgtadm --lld iscsi --op new --mode target --tid 3 -T node5:disk1

tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b
/dev/VolGroup00/iSCSI1
tgtadm --lld iscsi --op new --mode logicalunit --tid 2 --lun 1 -b
/dev/VolGroup00/iSCSI2
tgtadm --lld iscsi --op new --mode logicalunit --tid 3 --lun 1 -b
/dev/VolGroup00/iSCSI3

That is, have a different tid per target, and then have each of the
/dev/VolGroup00/iSCSI? be LUN 1 on each target.  If you do it that way, then,
you might want to change the name of the logical volumes to "iSCSI3", "iSCSI4",
"iSCSI5", so that they match up with their target names.

Chris Lalancette




More information about the ovirt-devel mailing list