From Fedora Project Wiki

Initial setup

Test cases require at least two devices, iSCSI target (hw or sw) and machine fot test installations (physical or virtual).

iSCSI target is simply server in iSCSI terminology. If hardware iSCSI target device isn't available (however hw device is best choice), it is possible to create software iSCSI target on Linux system.

iSCSI initiator is name for client. iSCSI support in anaconda is tested, there is not desired to use hardware iSCSI initiator.

Network connectivity between iSCSI target and test machine is required, faster is always better, 1 Gb/s in best case.

All test cases describe, how to create sw target for particular action with Fedora 10 (iSCSI target is not object of this testing, let's use stable system). Before any testing prepare storage space and start target daemon with following commands (execute as root):

# truncate -s 8G /var/tmp/disk
# dnf -y install scsi-target-utils
# systemctl start tgtd
Note.png
The other iSCSI targets
This document describes, how to work with sw iSCSI target on Fedora with scsi-target-utils package. If you managed hw target for testing or if you are using different tools for sw targets, hopefully you are also able to control it.
Important.png
Firewall settings
Ensure, port 3260 is available for incoming connection and there is no blocking firewall in the way between target and test machine.

You can check any time what targets are provided by command:

# tgtadm --lld iscsi --op show --mode target

No authentication

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:for.all
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address and click Add target button,
  5. complete installation.

Expected Results

  1. iSCSI inititiator is properly started,
  2. new SCSI drive(s) is included in list of available drives,
  3. installation is completed without error,
  4. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1

CHAP authentication against iSCSI target

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:auth.chap
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
# tgtadm --lld iscsi --op new --mode account --user consumer --password Longsw0rd
# tgtadm --lld iscsi --op bind --mode account --tid 1 --user consumer

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address,
  5. into field CHAP Username put name consumer,
  6. into field CHAP Password put LongSw0rd and click Add target button,
  7. complete installation.

Expected Results

  1. iSCSI inititiator is properly started,
  2. authentication passes,
  3. new SCSI drive(s) is included in list of available drives,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1
# tgtadm --lld iscsi --op delete --mode account --user consumer

Reverese CHAP authentication

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:auth.rchap
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
# tgtadm --lld iscsi --op new --mode account --user consumer --password Longsw0rd
# tgtadm --lld iscsi --op bind --mode account --tid 1 --user consumer
# tgtadm --lld iscsi --op new --mode account --user provider --password Shortsw0rd
# tgtadm --lld iscsi --op bind --mode account --tid 1 --user provider --outgoing

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address,
  5. into field CHAP Username put name consumer,
  6. into field CHAP Password put LongSw0rd,
  7. into field Reverse CHAP Username put name provider,
  8. into field Reverse CHAP Password put ShortSw0rd and click Add target button,
  9. complete installation.

Expected Results

  1. iSCSI inititiator is properly started,
  2. authentication passes,
  3. new SCSI drive(s) is included in list of available drives,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1
# tgtadm --lld iscsi --op delete --mode account --user provider

Data partition on iSCSI target

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:for.all
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address and click Add target button,
  5. select Create custom layout option, advance to next screen,
  6. create raw partition on iSCSI target with /opt mount point,
  7. complete installation.

Expected results

  1. iSCSI inititiator is properly started,
  2. new SCSI drive(s) is included in list of available drives,
  3. custom partitioning is completed wihtout error,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1

Root partition on iSCSI target

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:for.all
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
Important.png
This is important
This test case requires network card with iBFT support, properly configured PXE environment or local /boot partition. Third option, local /boot is described.

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address and click Add target button,
  5. select Create custom layout option, advance to next screen,
  6. create raw partition on iSCSI target with / mount point,
  7. create /boot partition on local hard drive (alternatively use iBFT or PXE),
  8. complete installation.

Expected results

  1. iSCSI inititiator is properly started,
  2. new SCSI drive(s) is included in list of available drives,
  3. custom partitioning is completed wihtout error,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1

swap on iSCSI target

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:for.all
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address and click Add target button,
  5. select Create custom layout option, advance to next screen,
  6. create swap partition on iSCSI target,
  7. complete installation.

Expected results

  1. iSCSI inititiator is properly started,
  2. new SCSI drive(s) is included in list of available drives,
  3. custom partitioning is completed wihtout error,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted,
  6. swap is activated during boot.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1

iSCSI target is part of LVM vg

Status

Not tested

Setup

# tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2009-02.com.example:for.all
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /var/tmp/disk
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Action

  1. Start installation, advance to partitioning screen,
  2. click Advanced storage configuration button,
  3. select Add iSCSI target option and click Add drive button,
  4. specify Target IP Address and click Add target button,
  5. select Create custom layout option, advance to next screen,
  6. create LVM PV partition on iSCSI target,
  7. create volume group TestVG' with PV placed on iSCSI target,
  8. create some logical volumes in TestVG, assign them with mount points (/opt, etc.)
  9. complete installation.

Expected results

  1. iSCSI inititiator is properly started,
  2. new SCSI drive(s) is included in list of available drives,
  3. custom partitioning is completed wihtout error,
  4. installation is completed without error,
  5. new system will start with all filesystems mounted.

Teardown

  1. Shutdown test machine
  2. On target execute:
# tgtadm --lld iscsi --op delete --mode target --tid 1

Final teardown

  1. Shutdown test machine
  2. Execute following commands on target (alternatively reboot target, changes are not persistent):
# systemctl stop tgtd
# rm /var/tmp/disk