iPXE discussion forum
unique root path for each IP? - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: unique root path for each IP? (/showthread.php?tid=7403)



unique root path for each IP? - jrgruher - 2014-07-18 17:32

Hi folks. This is actually a ISC DHCP server question but I wonder if someone here may have dealt with the same issue and know the solution.

I have a bed of diskless clients which boot over iSCSI using iPXE. Each client receives an IP and root path from the DHCP server, the root path points to a unique iSCSI target. The way this is implemented in the DHCP server today is to statically pair the IP and root path with each client’s MAC address, for example:

host initiator1 {
hardware ethernet 00:0C:29:A8:93Big GrinF;
fixed-address 10.0.0.1;
filename "";
option root-path "iscsi:initiator1.example.com::::target00";
}

The downside of this is that I have to know the MAC of every client. I don’t actually care which client gets which IP or which target, all clients are identical, so as long as they all get a unique IP and target not given to any other client at the same time I’m good. Ideally I would just like to pair the IPs and targets, since the DHCP server already handles keeping IPs unique a 1:1 pairing with targets will also ensure targets are unique. Is it possible to set up dhcpd.conf to do something like this:

When issuing 10.0.0.10 issue root path "iscsi:initiator1.example.com::::target10"
When issuing 10.0.0.11 issue root path "iscsi:initiator1.example.com::::target11"

When issuing 10.0.0.95 issue root path "iscsi:initiator1.example.com::::target95"


Or even more compact, can we do something like this:

When issuing 10.0.0.X issue root path "iscsi:initiator1.example.com::::targetX"

Thanks,
Joe


RE: unique root path for each IP? - mcb30 - 2014-07-18 21:16

(2014-07-18 17:32)jrgruher Wrote:  Or even more compact, can we do something like this:

When issuing 10.0.0.X issue root path "iscsi:initiator1.example.com::::targetX"

Yes, ISC dhcpd can do this. You want something like:

Code:
option root-path =
        concat ( "iscsi:initiator1.example.com::::target",
                 binary-to-ascii ( 10, 8, "", suffix ( leased-address, 1 ) ) );

Michael


RE: unique root path for each IP? - jrgruher - 2014-07-18 22:19

Very cool, thanks for the pointer! I'll investigate along these lines.