Windows provisioning

> Hey Greg,
>
> Thanks for the response.
>
> Unfortunately there is a spanner in the works for the workflow and it
> behaves more like this:
>
> Host is put in build mode by an admin
> Host is rebooted and starts installation
> Host gets provision script and notes the token in the url (even if it
> doesn't use the url direct at this stage)
> Host uses token to hit /unattended/built (which removes the build flag
> and permits a normal reboot)
> Host reboots to continue installation.
> Host reboots again to finish installation.
> Host uses token to get finish script
>
> I'm still exploring ways of downloading the finish script and attempting to
> write it to the disk before the first reboot, however Windows setup runs
> scripts before the installation process occurs, so disks are not formatted
> and partitioned yet.
>
> Our current build process for Windows is
>
> Server setup manually using the Foreman UI (currently testing pushing hosts
> in from our Portal system via API)
> Replaced TFTP server included with Foreman with more recent version that
> allows chaining to Windows Deployment Services WDS)
> Server boots, gets punted from Foreman TFTP to WDS.
> WDS provides boot.wim that has some Foreman hooks baked into it.
> boot.wim loads the Windows setup utility.
> Windows setup download the unattended.xml from Foreman and tells Foreman
> that it is built (assumes success, need to work on this)
> Server downloads the correct image from WDS. Windows image also has some
> foreman hooks baked into it.
> Windows is build according to the generated unattended.xml and reboots.
> Server reboots and downloads finish script to run. Finish script installs
> puppet agent and configures public network.
> Server should now be marked as built but not working due to step 6 and 8.

Oh that's a bummer. So, if I grok you, the issue is that you need to
boot twice before telling Foreman the build is complete? If so, one
option might be to do something with iPXE. It's possible to do
something like:

  • Server placed in build mode
  • TFTP file is written containing instructions to boot iPXE
  • Server boots iPXE, which is configured to retrieve an iPXE script
    from Foreman (/unattended/iPXE)
  • iPXE script determines this is first build (TBD how it does this,
    maybe via a parameter in Foreman?)
  • iPXE punts to WDS and proceeds
  • WIM image has hook to perform some kind of update so that iPXE will
    know about the second boot
  • Server reboots
  • iPXE script determines it's now the second boot, punts to localboot
  • Finish script is applied
  • Finish script sends built notification, iPXE TFTP file is replaced
    with localboot

Would that work? The nice thing here is that iPXE is an arbitrary
script, so pretty much anythng goes as to what it queries and how it
determines the boot state.

> I have got the ok from my employer to write up some Windows documentation.
> Where would be the most appropriate place to write it?

Awesome! I'd start with a page on the wiki[1], and then link to it
from the Tips & Trics page. Once it's polished, we can consider
moving it to the manual.

Greg

ยทยทยท On 18 November 2014 23:58, Chris Gibbs wrote: