Bare metal Nano
Last time I went through the quick and easy way of creating and connecting to a Nano server VM using a VHD.
This is great for all your virtual needs, but with the ability of a Nano server deployment image to act as a hyper v host, a failover cluster node and a scale out file server using Storage spaces it make sense to deploy Nano to a bare metal device. This enables far more of the device resources to be used for services and not for infrastructure and enabling services.
It is a very different ball game deploying Nano on a Bare metal device, this post is designed to show the process from concept to reality.
Deploying Nano to bare metal
There are three stages
1. Build a Nano Server image
2. Build a WinPE boot device
3. Deploy the Image to the Bare metal machine
Build an image
The first stage, as before is to create a Nano image file. In this case since we are deploying an image and not booting from a VHD, we need to create a.WIM file (Windows Image File) the process is identical to that in the previous post. Below is a PowerShell command line that will create a .WIM file and add to the image the ability to act as a Hyper V host, a Failover cluster node and also the storage features.
New-NanoServerImage -Edition Datacenter –DeploymentType Host -MediaPath e:\ -BasePath c:\nanoserver\base -TargetPath C:\NanoServer\target\bootnano.wim -ComputerName baremetal -Compute -Storage -Defender -Clustering –OEMDrivers
The detailed breakdown is this
-Edition Datacenter (Options are Standard or Datacenter)
-DeploymentType Host (Options are Host or Guest)
-OEMDrivers (loads bare metal drivers rather than guest VM drivers)
Build a WinPE bootable USB device
Having obtained your .WIM file it is time to build a WinPE boot device (USB) to do that you should download the Windows Assessment and Deployment Kit (ADK) and then run the Deployment and Imaging Tools Environment this is essentially a command line environment where the Windows Preinstallation Environment runs and enable the installation of WinPE to other devices.
Note: This must be run as an administrator (indicated in the window title bar)
two commands are required, first copy the WinPE environment to a staging folder on your hard drive.
copype amd64 c:\WinPE_amd64
then to install that on a USB device
MakeWinPEMedia /UFD c:\WinPE_amd64 E:
(where E: is the drive letter of the USB device and this device is then reformatted and made bootable)
The next step is to copy the newly created.WIM file to the root of this new USB device so it is available for deploying to the hard disk of your new bare metal device.
Deploy to Bare metal
The final stage is to deploy this image to the hard disk on the bare metal device. I chose to do this on a Gigabyte BRiX i7 device. This makes screenshots quite difficult but I did video the process which will be posted here when it has been tidied up..
The steps to do this are also listed below.
I plugged the USB device in and booted the BRiX, to boot form USB (on my device this involves pressing the DEL key until the BIOS screen loads and setting the boot device to USB)
When the system boots into WinPE from the USB device, the WPEInit command runs and sets the system up for action (it can take a couple of minutes to do this). Once the command prompt appears there are a series of commands you need to run.
The utility which carries out most of the work is Diskpart.exe (the command line version of the Disk Management program in Windows)
The short version is
1 clean off the disk (wipe it and remove all partitions)
2 make it a GPT rather than MBR disk
3 create three partitions
EFI (S: FAT32 System volume 100MB)
MSR (recovery partition)
Primary (N: NTFS WIndows volume)
The next stage is to run DISM (Disk Imaging and Servicing Module) this allows all sorts of magic with online and offline images (WIM files). The DISM command simply installs the image on the Primary partition
The final stage is to update the Boot database to point to our image and reboot using WPEUtil into a brand spanking new Nano Server.
The Long version is.
The commands for all these are shown below
DISKPART
Diskpart.exe
Select disk 0
Clean
Convert GPT
Create partition efi size=100
Format quick FS=FAT32 label=”System”
Assign letter=”s”
Create partition msr size=128
Create partition primary
Format quick FS=NTFS label=”NanoServer”
Assign letter=”n”
List volume
Exit
DISM
Dism.exe /apply-image /imagefile:.\<yourimagefilename>.wim /index:1 /applydir:n:\
BCDBOOT
Bcdboot.exe n:\Windows /s s:
WPEUTIL
Wpeutil.exe reboot
This is obviously a manual process which could be automated using WDS and either a VHD or a WIM.
But for a one off setup it takes around 5 minutes. Not bad for a system capable of Hyper V , Clustering and Storage services.
Pingback:Bare metal Nano – TechNet UK Blog