iPXE discussion forum
undionly, ipxe, and dhcp - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: undionly, ipxe, and dhcp (/showthread.php?tid=7964)



undionly, ipxe, and dhcp - mshoemaker - 2016-02-18 16:37

I am having an issue with undionly, ipxe, and microsoft's dhcp server and wondered if anyone here had a suggestion.

I recently had to build up Windows Server 2008 on one machine, which also acts as an iSCSI target for a diskless Windows 7 machine. I finally managed to get everything working, however I still have one issue which is now causing more problems.

The issue is that when the diskless machine first attempts the network boot it requests an IP address from the DHCP server, and the microsoft dhcp server happily gives it one. Then ipxe starts and it requests an IP, this time however the microsoft dhcp server thinks this is a new device and attempts to give it a different address, but since our pool is limited to one, the correct one, the dhcp fails. I got around this to make everything boot by just adding an additional IP to the beginning of our pool. This appears to work, however if undionly gets the second address, then ipxe gets the new address I added and then once windows starts for some reason that is the address that sticks even though windows is configured with a static IP. At this time our scripts can not communicate with the diskless machine. So if our pool is 192.168.0.1 and .2, everything works fine when undionly gets .1 and ipxe gets .2, because windows has a static address of .2.

Looking in the dchp server it looks like the device id had a bunch of leading zeros when undionly is requesting an address, and when ipxe fetches an address it is just the mac address. I have checked the configuration against the old hardware and everything looks the same, however the old system only used one IP and it all worked.

Any thoughts?

Thanks,
Matthew


RE: undionly, ipxe, and dhcp - NiKiZe - 2016-02-18 16:45

If this is the only machine and it uses a static IP (currently assigned from DHCP), you could embed a script into ipxe which configures ipxe with static IP instead.

To debug this it might be good to get a packet dump of all involved dhcp packets, but it is likely a BIOS/NIC ROM or MS DHCP server bug.


RE: undionly, ipxe, and dhcp - mshoemaker - 2016-02-18 21:39

Well after a little more work I am no farther, but I do have more information. The issue actually resides in the undionly.kpxe step. So the nic gets an IP from the dhcp server, and then fetches undionly.kpxe from the tftp server, undionly starts and attempts to grab an ip from the dhcp server itself but fails since there is only one address and the dhcp server thinks it is taken by a different device.

I tried generating a new undionly.kpxe file and embedding a script to set the ip address, followed by the same sanboot command that was in my ipxe file, however I get an error there too. Not sure what is going on, it is as if I am not getting the network configured or brought up correctly with the static IP. The script I am using is this:

#!ipxe

echo Configuring IP..
set net0/ip 141.141.207.201
set net0/netmask 255.255.255.0

set san-keep 1
show net0/ip
show net0/netmask


RE: undionly, ipxe, and dhcp - NiKiZe - 2016-02-18 22:06

What is the error you get?

Could it be that uou are missinf ifopen eth0 ?
But see the ipxe error url that is shown if the problem occurs in ipxe, and also post that error.


RE: undionly, ipxe, and dhcp - mshoemaker - 2016-02-19 14:15

(2016-02-18 22:06)NiKiZe Wrote:  What is the error you get?

Could it be that uou are missinf ifopen eth0 ?
But see the ipxe error url that is shown if the problem occurs in ipxe, and also post that error.

The error message I am getting is:
Booting from SAN device 0x80 failed: Exec format error (http://ipxe.org/2e852001)

This is using Rom-o-matic to generate a kpxe file with my script embedded in it as follows.

#!ipxe
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||
ifopen net0
echo Configuring IP..
set net0/ip 141.141.207.201
set net0/netmask 255.255.255.0
set net0/gateway 141.141.207.225
set san-keep 1
show net0/ip
show net0/netmask
echo Attempting to boot to iSCSI device..
sanboot -k iscsi:141.141.207.225::::sim

Now, if I go back to just a basic undionly.kpxe file, and put the above script into my iscsi-boot.ipxe file on my tftp server, then change my dhcp server to hand out two IP addresses, then the intel boot agent gets its IP address, undionly gets its IP address, then my script changes the ip over to the correct address and windows boots happily. I wish there were a way to embed this script into the undionly so that I can do away with the second IP address requirement.


RE: undionly, ipxe, and dhcp - NiKiZe - 2016-02-19 14:31

When you run ifopen in a pxebooted undionly.kpxe it uses the cached dhcp response from the pxe stack.

I think ifopen should otherwise be done after config of ip

see http://ipxe.org/embed for how to embed the script.

Also read that error url for known reasons for that error.


RE: undionly, ipxe, and dhcp - mshoemaker - 2016-02-19 15:08

(2016-02-19 14:31)NiKiZe Wrote:  When you run ifopen in a pxebooted undionly.kpxe it uses the cached dhcp response from the pxe stack.

I think ifopen should otherwise be done after config of ip

see http://ipxe.org/embed for how to embed the script.

Also read that error url for known reasons for that error.

Well I have tried setting the ip before running ifopen and after, and I received the same error message. As for embedding the script I have that working, it is just that when using the embedded script my system will not boot to the SAN, yet when not using the script embedded it boots fine. I did check that page for that error, it says to try using the latest ipxe, which I am, then to ask for help, which I am, and additional note says the drive might be blank, which it isn't.

For right now at least I might have my system working, yes it still requires two IP addresses from the DHCP server, but once ipxe grabs my script and runs it, it changes the ip address over to the static address it needs to be, then kicks off the iscsi boot and windows starts. I just need to get it tested to make sure our software can run on it now.

Thanks,
Matthew


RE: undionly, ipxe, and dhcp - NiKiZe - 2016-02-19 19:08

How are you booting ipxe when not having embeded script? just pressing ctrl+B when PXE booting undionly.kpxe, or any other difference?

(2016-02-19 15:08)mshoemaker Wrote:  and additional note says the drive might be blank, which it isn't.

Also says
Quote:This also happened when iSCSI target's block size was set to 4096 instead of 512.

But i guess this is due to something else.

Have you tried with unsetting the gateway? (which is kind of a known issue for iSCSI booting, the details I'm fuzzy on.)


Happy you have a solution that works atleast even if it sounds a bit weird and not optimal Wink