[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Boot from iSCSI


I'm interested in getting iSCSI boot to work.  There is one challenge:
multipath should also work during boot phase.  After some research and
development, a prototype in my sandbox is working.  Maybe some ideas
and source code are of general use:

=== Multiple Network Adapters

To implement multipath over iSCSI, there is a need to setup multiple
network devices during boot phase.  AFAIK the current implementation
of initramfs-tools only supports exactly one network device - which
can be configured in the 'initramfs.conf' under 'DEVICE'.

The maybe easiest way to implement multiple network devices is to
allow the DEVICE variable to hold a list instead of only one value.
In my opinion, this is a little bit ugly to name a list in singular.

My proposal is to rename the configuration parameter to somewhat more
speaking like 'NETWORK_DEVICES'.  One drawback: I do not know which
other packages depend on and use the variable 'DEVICE'. (I checked
udev and multipath which do not use it.)

One issue when using multiple network interfaces is, how the last lines
in the 'configure_networking()' function should be handled:

        # source relevant ipconfig output
        . /tmp/net-${DEVICE}.conf

This only makes sense (when looking at the ipconfig output) when there
is only one network device.  My proposal is, to move the sourcing of
the ipconfig output to the modules that really need it.  NFS will then
source it, because it depends on ROOTSERVER and ROOTPATH; iSCSI will
not source it, because there is no need.

The proposed configuration only works when using some automatic ip
configuration like DHCP.  Using the ip= parameter only allows to
supply exactly one ip configuration for one network device.

=== Additional Boot Parameter

To handle the connection to the iSCSI target an additional boot
parameter is needed.  The proposed name is "iscsitarget=".  The value
itself has two parts, separated by a coma.  The first part is the IQN,
the second the IP address of the iSCSI target port.  Example:


=== iSCSI Boot Script

The iSCSI boot script itself is executed during the local-top script
phase (iSCSI is handled here the mostly the same way as e.g. FC
storage).  This was done, because the local and iSCSI boot share most
things, except the iSCSI specific network setup and detection.  The
advantage of this is, that also the other parts - like
multipath-tools-boot - can be used without any change.

The script is straight forward: it sets up the initiatorname, starts
the iscsid and logs in with the help of iscsiadm.

The iscsid / iscsiadm was chosen over iscsistart (which is used
e.g. in CentOS), because iscsistart cannot handle multiple connections
to an iSCSI storage very well / at all (???) and it is even not part
of the Debian open-iscsi package.

The tricky part is switching to new root file system.  The iscsid must
be restarted when system boots up.  This must be done, because the new
iscsid should use the new environment with syslog and other things.
In the local-bottom phase, also the iscsi environment is copied over
to the new root disk.

=== Package architecture

I think, it makes sense to have an own package, where the special
iSCSI scripts should be put in - like 'multipath-tools-boot' it can be
named 'open-iscsi-boot'.


What do you think of adding iSCSI boot to initramfs-tools and adding a
package 'open-iscsi-boot'?

Do you see any problems with the patches?  Any hints, remarks?

When you think the direction and general idea is ok, I'll can spend
some time cleaning up everything (especially the open-iscsi-boot rc.d
script) and do some documentation.


Andreas Florath

Reference: The patches can be found in

Reply to: