How to add an iSCSI target dynamically without restarting the service
Written by Mike Young on March 12, 2009 – 6:40 pm -Sometimes it’s necessary to add a new target but without interrupting other running targets, which happens when you run /etc/init.d/iscsitarget restart.
To do this, you’ll need to first add the new iSCSI target using UI or commandline tools. Using the UI should add the target to the /etc/ietd.conf configuration file.
Let’s say you add a configuration as follows:
To create a new iSCSI target with a LUN, first update your configuration file. The additional entry could be:
Target iqn.2006-02.com.example.iserv:system2
Lun 0 Path=/dev/mapper/system-swap2
To set up this configuration dynamically, proceed as follows:
-
Create a new target with the command ietadm –op new –tid=2 –params Name=iqn.2006-02.com.example.iserv:system2.
-
Add a logical unit with ietadm –op new –tid=2 –lun=0 –params Path=/dev/mapper/system-swap2.
-
Check the configuration with cat /proc/net/iet/volume.
-
| Posted in »