First thought, figure out how to make the FOG Server return the storage node you want.
Take a look at this function:
I think if you can figure out how to pass in an IP address (and maybe subnet mask) to this, you can add logic to select the storage node you want.
The hard part will be figuring out how to pass in the IP address / subnet mask all the way from the unregistered host to the FOG Server and into this function. The easy part is adding a bunch of logic in here to return the node you want.
This link below is for USB devices, but it shows how the request is made and parameters are passed back. You could modify this to pass your IP, subnet, and whatever else to the fog server:
Notice that it writes to this file: /tmp/hinfo.txt
You would add lines somewhere in here to get the IP / subnets from the request that the host makes:
And you would pass that IP / subnet information into that optimal storage node function here somewhere:
Second thought, hack the storage node selection into a custom FOS build
Checkout this spot, it may have potential:
Another thought here is to look at how the Capone plugin sets this stuff. The script is called here:
And this is the file that gets executed, you see it sets a storage node IP, among other things:
https://github.com/FOGProject/fos/blob/c0238723ce381b5cd0340932086b10d47e79e26b/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.capone#L108
Third thought, postinit scripts
The method @george1421 suggested seems promising, but I am unsure how the postinit script would make changes to environment variables that will persist after the postinit script ends. If you could solve that somehow, this seems like the easy path.