Monday, November 28, 2011

iPXE: iSCSI for Microsoft Windows

Prepare environment to install and boot from iSCSI target

  1. Syslinux 3.86 is the last known working version that may work with gpxe/ipxe.  Prepare a TFTP boot folder as following:
    # tree
    .
    ├── pxelinux.cfg
    │   └── default
    ├── syslinux -> syslinux.386
    ├── syslinux.386
    │   ├── advdump.c32
    │   ├── c32echo.c32
    │   ├── cat.c32
    │   ├── chain.c32
    │   ├── cmd.c32
    │   ├── comecho.com
    │   ├── complex.c32
    │   ├── config.c32
    │   ├── copybs.com
    │   ├── cpuid.c32
    │   ├── cpuidtest.c32
    │   ├── disk.c32
    │   ├── display.c32
    │   ├── dmitest.c32
    │   ├── elf.c32
    │   ├── entrydump.c32
    │   ├── ethersel.c32
    │   ├── fancyhello.c32
    │   ├── fd.c32
    │   ├── filetest.c32
    │   ├── gfxboot.c32
    │   ├── gfxboot.com
    │   ├── gpxecmd.c32
    │   ├── gpxelinux.0
    │   ├── hdt.c32
    │   ├── hello2.c32
    │   ├── hello.c32
    │   ├── ifcpu64.c32
    │   ├── ifcpu.c32
    │   ├── int18.com
    │   ├── kbdmap.c32
    │   ├── keytest.c32
    │   ├── linux.c32
    │   ├── localboot.c32
    │   ├── mboot.c32
    │   ├── mdiskchk.com
    │   ├── memdump.com
    │   ├── meminfo.c32
    │   ├── menu.c32
    │   ├── pcitest.c32
    │   ├── pmload.c32
    │   ├── poweroff.com
    │   ├── pxechain.com
    │   ├── pxelinux.0
    │   ├── reboot.c32
    │   ├── resolv.c32
    │   ├── rosh.c32
    │   ├── sanboot.c32
    │   ├── sdi.c32
    │   ├── serialinfo.c32
    │   ├── simple.c32
    │   ├── sysdump.c32
    │   ├── syslinux.com
    │   ├── test2.c32
    │   ├── test.c32
    │   ├── vesainfo.c32
    │   ├── vesamenu.c32
    │   └── vpdtest.c32
    ├── undionly.0 -> undionly.kpxe
    ├── undionly.kpxe
    └── windows.pe
        ├── BCD
        ├── bootmgr.exe
        ├── boot.sdi
        ├── fonts
        │   ├── chs_boot.ttf
        │   ├── cht_boot.ttf
        │   ├── jpn_boot.ttf
        │   ├── kor_boot.ttf
        │   └── wgl4_boot.ttf
        ├── pxeboot.0 -> pxeboot.n12
        ├── pxeboot.n12
        ├── vista_x64.wim
        ├── vista_x86.wim
        ├── win7_x64.wim
        └── win7_x86.wim
  2. Update /etc/dhcp/dhcpd.conf to use gpxelinux.0
    filename "gpxelinux.0";
  3. Restart dhcpd service
    # service dhcpd restart
    Shutting down dhcpd:                                       [  OK  ]
    Starting dhcpd:                                            [  OK  ]
  4. Update pxelinux.cfg/default:
    LABEL boot_san
            menu label Boot ^Storage Area Network
            menu indent 5
            com32 syslinux/gpxecmd.c32
            append chain tftp://boot.example.com/sanboot.gpxe
    
    label undionly
            menu label Boot iPXE UNDI
            menu indent 5
            kernel undionly.0
  5. Create a sanboot.gpxe script file:
    # cat sanboot.gpxe
    #!gpxe
    
    login
    chain tftp://boot.example.com/syslinux/menu.c32 http://${username}:${password}@boot.example.com/~${username}/menu.cfg
  6. A sample menu.cfg file:
    UI syslinux/vesamenu.c32
    
    LABEL Windows 7 x64
            com32 cmd.c32
            append sanboot iscsi:nas.example.com::::iqn.example.com:win7-x64
    
    LABEL Windows 8 x64
            com32 cmd.c32
            append sanboot iscsi:nas.example.com::::iqn.example.com:win8-x64

Install Windows 7 on iSCSI target

  1. Boot machine into iPXE kernel (Boot iPXE UNDI or undionly.0)
  2. Press Ctrl-B to start iPXE command line
    MS-DOS-2011-11-15-11-49-38
  3. Obtain an IP address from dhcp
    iPXE> dhcp net0
  4. Preserve SAN device
    iPXE> set keep-san 1
  5. Supply chap information if necessary:
    iPXE> login
  6. Initialize iSCSI target:
    iPXE> sanboot iscsi:nas.example.com::::iqn.2011-03.example.com:my-iscsi
    Registered SAN device 0x80
    Booting from SAN device 0x80
    Boot from SAN device 0x80 failed: Operation canceled (http://ipxe.org/0x8080a0)
    Preserving SAN device 0x80

  7. Chain boot to Windows PE:

    iPXE> chain tftp://boot.example.com/windows.pe/pxeboot.0
  8. Or chain boot to Windows PE ISO:
  9. iPXE> kernel syslinux/memdisk iso
    iPXE> initrd http://<ip-address>/winpe7_x64.iso
    iPXE> boot
    1. Once boot into Windows PE, you may use the iSCSI target just like your local storage.  You may install a Windows OS into the iSCSI target directly.

    Boot from iSCSI target using iPXE

    1. Boot machine into iPXE kernel
    2. Press Ctrl-B to start iPXE command line
    3. Obtain an IP address from DHCP

      iPXE> dhcp net0
    4. Supply chap information if necessary:

      iPXE> login
    5. Boot from iSCSI target:

      iPXE> sanboot iscsi:nas.example.com::::iqn.2011-03.example.com:my-iscsi

    Boot from iSCSI using PXE using HTTP

    1. Boot from PXE
    2. Use the pxe menu configuration to boot iSCSI target introduced in section “Prepare environment to install and boot from iSCSI target”

    Reference

    1. User-specific boot menus. URL: http://etherboot.org/wiki/appnotes/authmenus
    2. Installing Windows Server 2008 to an iSCSI target. URL: http://etherboot.org/wiki/sanboot/win2k8_iscsi_install

    No comments: