| 1 |
|
| 2 |
These notes are split into three parts; |
| 3 |
|
| 4 |
a) How to set up a iSCSI target |
| 5 |
|
| 6 |
b) Some thoughts on how to integrate iSCSI into DeviceKit-disks, |
| 7 |
Palimpsest and the GNOME desktop |
| 8 |
|
| 9 |
Keep in mind that a) and b) are merely my research notes used for |
| 10 |
investigating iSCSI. All of this stuff is preliminary. |
| 11 |
|
| 12 |
------------------------------------------------------------------------ |
| 13 |
iSCSI target bits (the machine exporting a device) |
| 14 |
------------------------------------------------------------------------ |
| 15 |
|
| 16 |
This is using scsi-target-utils-0.0-4.20071227snap.fc9.x86_64 |
| 17 |
|
| 18 |
killall -9 tgtd |
| 19 |
service tgtd restart |
| 20 |
tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz |
| 21 |
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sdc |
| 22 |
tgtadm --lld iscsi --op new --mode account --user davidz --password iscsi123 |
| 23 |
tgtadm --lld iscsi --op bind --mode account --tid 1 --user davidz |
| 24 |
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL |
| 25 |
tgtadm --lld iscsi --op show --mode target |
| 26 |
|
| 27 |
This exports the device /dev/sdc as an iSCSI target; will have to use |
| 28 |
username 'davidz' and 'iscsi123' when initiating a connection. This |
| 29 |
iSCSI target implementation doesn't seem capable of pass-through, e.g. |
| 30 |
you can't share an optical drive and expect the initiator side to use |
| 31 |
it for burning/dvd viewing. |
| 32 |
|
| 33 |
There's also another iSCSI target implemetation in Livna, called |
| 34 |
iscsitarget. See http://sourceforge.net/projects/iscsitarget/. This |
| 35 |
one appeared to be able to export the cdrom drive (at least I could |
| 36 |
mount the UDF file system); yet the initiator side didn't see it as a |
| 37 |
cdrom drive. E.g. probably no pass-through support. |
| 38 |
|
| 39 |
TODO: Need to find a good iSCSI target implementation. |
| 40 |
|
| 41 |
------------------------------------------------------------------------ |
| 42 |
Teaching DeviceKit-disks / Palimpsest / GNOME about iSCSI devices |
| 43 |
------------------------------------------------------------------------ |
| 44 |
|
| 45 |
First the 'why': there's a couple of reasons why iSCSI is interesting |
| 46 |
to integrate with the desktop stack and disk management graphical |
| 47 |
tools: |
| 48 |
|
| 49 |
- It's generally a good idea to have graphical UI for OS |
| 50 |
configuration bits in addition to configuration files and command |
| 51 |
line tools. It's also not sufficient to just have UI tools |
| 52 |
available at install time; people need to be able to tweak things |
| 53 |
at run time as well. |
| 54 |
|
| 55 |
- Both high-end laptops (e.g. Macbook Air, Lenovo X61, etc.) and |
| 56 |
cheap sub-notebooks (e.g. Eee) doesn't come with optical |
| 57 |
drives. Yet, users still need to be able to access storage media on |
| 58 |
CD/DVD/Blu-Ray for both entertainment (e.g. watching DVD's) and |
| 59 |
work (e.g. burning files to optical discs). It would be useful |
| 60 |
to just use the optical drive from a desktop machine for this. |
| 61 |
|
| 62 |
Now to the 'how' part. First of all any integration being done should |
| 63 |
not render existing uses of iSCSI non-working and it shouldn't, as far |
| 64 |
as possible, be a parallel configuration stack to what people are |
| 65 |
currently using. The latter point means that if people use e.g. |
| 66 |
iscsiadm(1) on the command line, the results of their changes should |
| 67 |
appear in the UI as well. |
| 68 |
|
| 69 |
------------------------------------------------------------------------ |
| 70 |
Changes needed on the initiator side: |
| 71 |
------------------------------------------------------------------------ |
| 72 |
|
| 73 |
DeviceKit-disks changes: |
| 74 |
|
| 75 |
- add 'iscsi' as valid value for drive-connection-interface |
| 76 |
- and add new properties in the drive-iscsi-* namespace, e.g. |
| 77 |
- name |
| 78 |
- portal |
| 79 |
- portal-port |
| 80 |
- portal-group |
| 81 |
- possibly information about current connection state |
| 82 |
- may need to patch/fix the kernel to emit 'change' uevents |
| 83 |
when this changes |
| 84 |
- with this we can show notifications when there are |
| 85 |
connection problems |
| 86 |
|
| 87 |
- provide a way to enumerate iSCSI devices already setup; on |
| 88 |
the org.freedesktop.DeviceKit.Disks interface add |
| 89 |
- IScsiEnumerateEntries() that returns |
| 90 |
{ s: name |
| 91 |
s: portal |
| 92 |
i: portal-port |
| 93 |
i: portal-group |
| 94 |
b: autostart |
| 95 |
<possible more, including auth details> } |
| 96 |
- IScsiAddEntry(), IScsiRemoveEntry(), IScsiConfigureEntry() |
| 97 |
- to add, remove and configure iSCSI associations |
| 98 |
- might need changes to iscsiadm(1) so we can pipe |
| 99 |
the password instead of including it on the command line |
| 100 |
- signal IScsiEntriesChanged() |
| 101 |
- may need to watch the iscsiadm(1) config files to listen |
| 102 |
to changes |
| 103 |
- IScsiEntryStart(), IScsiEntryStop() |
| 104 |
- to login resp. logout to an iSCSI device |
| 105 |
|
| 106 |
libgdu / palimpsest changes: |
| 107 |
|
| 108 |
- Like we do with Linux MD, make iSCSI drives implement the |
| 109 |
GduActivableDrive interface. That way the user can start/stop |
| 110 |
iSCSI drives. E.g. associated but non-connected iSCSI drives |
| 111 |
should show up in the UI. |
| 112 |
|
| 113 |
- When an iSCSI drive is selected, provide a GduSection with |
| 114 |
widgets to change auth details etc. Similar to e.g. |
| 115 |
GduSectionLinuxMd. |
| 116 |
|
| 117 |
- Provide a way to create new iSCSI associations; probably just |
| 118 |
an entry in the "File" menu in Palimpsest. Probably needs some |
| 119 |
method on DeviceKit-disks to probe a portal for targets. |
| 120 |
|
| 121 |
Nautilus / gvfs / desktop shell changes: |
| 122 |
|
| 123 |
- With a gvfs volume monitor based on libgdu (I'm working on it!) |
| 124 |
that supports un-activated GduActivatableDrive instances, all |
| 125 |
iSCSI associations will show up in the file manager and one |
| 126 |
can double click the entry to activate it. Once logged into |
| 127 |
the iSCSI target, it just appears as a normal local device. |
| 128 |
Meaning it's accessible to any application |
| 129 |
|
| 130 |
- Ideally iSCSI targets that one can connect to would show up |
| 131 |
in network:///. There's a couple of protocols available for |
| 132 |
iSCSI discovery but none of them seems to support mDNS. Need |
| 133 |
some research here. |
| 134 |
|
| 135 |
- Desktop notifications when a iSCSI connection is broken; user |
| 136 |
should be able to disconnect / disassociate from the iSCSI |
| 137 |
device |
| 138 |
|
| 139 |
- For end user UI, should integrate with the "Personal File Sharing" |
| 140 |
capplet; Bastien wants to rename it to e.g. "Sharing" since it |
| 141 |
will also do other things like swallow the screen sharing bits. |
| 142 |
|
| 143 |
------------------------------------------------------------------------ |
| 144 |
Changes needed on the target side |
| 145 |
------------------------------------------------------------------------ |
| 146 |
|
| 147 |
TODO: this is probably simple UI wise (e.g. have "Share this drive" |
| 148 |
checkbox etc.) but need to figure out what iSCSI target implementation |
| 149 |
to depend on. |