New Question

# MaaS Windows PE Boot Images

I need to create an image for use with MaaS. The only solution that seems to be working for various individuals is your solution located here: http://wiki.cloudbase.it/maas

I have so far had to modify many variables throughout the deployment of these scripts to even get it to work as far as it has... its a bit frustrating to be honest. However that being said I wasn't able to figure out a solution this time.

This is my setup... Additionally I have listed my changes to the scripts. And various things that are not mentioned during execution.

Windows 8.1 Pro

1. As you need to run these scripts in a powershell terminal you need to set up your computer to be able to do so. By default windows is set to a restricting policy and therefore the scripts will not run without changing this policy to allow the script to do so. This is because the scripts are unsigned.

Set-ExecutionPolicy RemoteSigned

2. Depending on your environment and the version's of software downloaded by the script you need to change variables in the first script by the name of BuildWinPE.ps1

[string]$ADKVersion = "8.1", [switch]$ForceADKInstall = $true 3. Once that is finished the next issue is this should all be run under an administrator powershell. 4. The$TFTPBlockSize variable did not seem to be passed correctly to the script bcdcreate.cmd and therefore needed to be set manually within the said script. Doing so however is tricky since the application creates that script when it runs. Which means you need to have the file opened/modified from a previous try and save it on top of the newly created file as soon as it appears.

Changed: set TFTPBLOCKSIZE=%1 --> 8192

5. If the script has already run and failed once you will need to clear out your old BCD configs manually as the command %BCDEDIT% -create {ramdiskoptions} -d "will fail (although likely harmlessly)

The following is where I am currently stuck at... How do I modify the current code, or if there is somewhere else I went wrong please let me know.

C:\winpe\bin>for /f "tokens=3" %%a in ('%BCDEDIT% -create -d "Windows PE" -appli cation osloader') do set GUID=%%a %%a の使い方が誤っています。 (The use of %%a is incorrect)

This is output from the set command showing what GUID was set to ... the meaning doesn't matter much its clearly set incorrectly which explains why my next commands failed.

GUID=は正常に作成されました。

C:\winpe\bin>%BCDEDIT% -set %GUID% systemroot \Windows 指定されたエントリを参照中にエラーが発生しました。 (Error occurred during reference to the specified entry.) 指定されたファイルが見つかりません。 (Specified file cannot be found (What file??))

I greatly appreciate the help in advance.

edit retag close merge delete

Sort by » oldest newest most voted

Hi Scott,

I am really sorry for all the frustration caused. The problems you are experiencing are probably due to the fact that we only tested our scripts with the EN_US version of windows. The good news is that with version 1.7 of MaaS generating PXE images is no longer required. Windows will be deployed using full disk images, already sysprepped.

The MaaS team is working on an image builder system that will allow you to just pass in an ISO and it will generate the image for you. Unfortunately, its not released yet. I will write up a quick document explaining how to manually generate it until the image-builder is released.

The procedure, consisting mostly of simply installing a new windows VM on top of KVM, copying over a few scripts, and doing a sysprep. The resulting image needs to be archived and uploaded to MaaS.

I will update this answer with a link to the document as soon as I have had a chance to write it up.

Again, I am sorry for any hard time you may have had.

Gabriel

Update:

We have updated the openstack imaging tools to allow MaaS image creation. Its not yet merged upstream, but you can take it for a spin if you would like. It can be downloaded from:

https://github.com/gabriel-samfira/windows-openstack-imaging-tools/tree/persist-driver-option

Usage info:

https://github.com/gabriel-samfira/windows-openstack-imaging-tools/tree/persist-driver-option#generate-maas-compatible-image

Please take note, that this only works on Windows. Also, in order to get a fully functional MaaS image, the commandlet will need to install the Hyper-V role on your Windows machine (if you do not have it already).

It will create an image from the desired ISO, it will boot up the image, run updates (if selected), install Cloudbase-init, sysprep and generate the required file.

Please note, that sysprep may take a long time depending on whether or not you selected to also run updates. The final image is a RAW disk image compressed into a tar.gz. If you still see a vhdx, wait for the commandlet to exit. You may follow the progress of the sysprep by starting up Hyper-V manager and double clicking on the MaaS-SysprepXXX machine.

 maas root boot-resources create name=windows/win2012hvr2 architecture=amd64/generic filetype=ddtgz content@=$HOME/win2012hvr2-dd  The name here is important. For Hyper-V server 2012 R2, the name must be windows/win2012hvr2. Please make sure you use the latest stable version of MaaS available here: https://launchpad.net/~maas-maintainers/+archive/ubuntu/stable After uploading the image to MaaS, you must wait for your cluster to finish syncing the image. MaaS will indicate that images are still syncing by displaying a yellow triangle with an exclamation mark in your clusters view. Once sync is done, you will have windows as an option in the edit node view, after you acquire it. Let me know if it works for you. more ## Comments Gabriel, Thanks for your reply, I have one question. When you say that MaaS doesn't need a generated PXE image for version 1.7, does this mean I can simply tar the .iso file in this case? or how would one go about doing it? Based on the later comment this feature seems not yet to be implemented? ( 2015-02-02 02:31:51 +0300 )edit Actually, in version 1.7 MaaS uses whole disk images. So to put it in simple terms: install a windows VM on top of KVM using RAW disk images, sysprep, add some finalize scripts and shutdown. That image gets tgz-ed and uploaded to MaaS. I will update the wiki tomorrow to reflect this. ( 2015-02-03 04:15:19 +0300 )edit Thanks Gabriel, good to know, I will look for your update on the wiki for further information. I am excited to work towards getting this up and running. ( 2015-02-03 09:41:01 +0300 )edit I have spoken with someone fom the MaaS team. They are preparing to release the image builder and documentation on their official MaaS wiki. It should become available soon. At that point, generating an image should be a matter of supplying the ISO and a serial key (if needed). ( 2015-02-05 20:37:21 +0300 )edit Hi there, I was hoping to be able to deploy physical servers as well as virtual ones. I got pretty far with the tutorial here: http://wiki.cloudbase.it/maas until i got to here : "maas root boot-resources create name=windows/win2012r2 architecture=amd64/generic filetype=ddtgz content@=/home/maasctrl/windows-win2012r2-amd64-root-dd" That file is missing, and not mentioned anywhere else in the tutorial Im confused how to get it from the adk-tools-maas. I figured the process from adk-tools-maas should have built an image, and I found a large 3.4 GB .wim image in a C:\winpe subfolder. I copied that onto MAAS and tried that command using the image. It aborted at 58 % with a postgres error. What would I need to do in order to get MAAS to be able to PXE boot a Windows host? Thank you for you guides so far, very helpful. more ## Comments 1 adk-tools-maas was designed for the old PXE installer. MaaS has moved to curtin fastpath installer. I have updated my previous answer to include info about how to create the image. Give it a try, and let me know if it works for you. ( 2015-03-30 17:55:38 +0300 )edit Hi Gabriel, thanks for providing additional info about how to create the image, some steps are still missing though, especially how to convert from qcow2 to dd then tar.gz. Long story short, i managed to create a hyper-v image in there under generated images, sized 1.5GB. Next challenge is i couldn't seem to be able to select that image from a MAAS node as the OS drop down list only shows "Default OS" and "Ubuntu". Do you know of a way around this? Thanks for all your guides thus far, very helpful indeed :) more ## Comments If you are using the latest stable PPA, the image should be uploaded as follows: maas root boot-resources create name=windows/win2012hvr2 architecture=amd64/generic filetype=ddtgz content@=$HOME/win2012hvr2-dd The name here is very important. It has to be windows/win2012hvr2. After which you will have to wait for your clusters to sync. The option will then appear in the drop-down list.

( 2015-04-07 00:06:21 +0300 )edit

( 2015-04-07 00:19:03 +0300 )edit