How to deploy Nano server (Part 1)

Source: Ed Baker's How to deploy Nano server. (Part 1) nano2

So, if you are an IT Pro you will have heard that Microsoft is releasing a new Server operating System in the Autumn of 2016. Cunningly branded as Microsoft Windows Server 2016. No waste in marketing creative brand design $’s there then, which is a very good thing. Why?

Well, it leaves the whole budget for creating what is, in my opinion the biggest thing to hit the Server operating system world in 20 years. To see what is new in Windows Server 2016 check out this link on TechNet and if you have more time available there are a series of really good Microsoft Virtual Academy resources here.

Currently the Technical Preview of the new Server OS is at TP release 5. This post will concentrate exclusively on this release.

Over the last few years the feedback about Operating systems in general and server operating systems specifically has been very direct and vocal.

Why do we need to install everything if I only want to run a file server?

Why do I have to reboot so often?

Why is the image so big that it becomes hard to store, move about and install?

The first attempt to resolve these issues was in Server Core released as an installation option in Windows Server 2008. A command line only version of the Server OS that can be managed remotely and to a limited degree from a direct console This ‘server core’ did away with a lot of extraneous ‘stuff’ and meant fewer updates, smaller images and smaller, quicker installations.

But this was not enough and so the Server Product team in Microsoft went back to the drawing board and produced a deployment option now known as Nano server. This cannot be installed from the DVD or ISO, it has to be installed using PowerShell and each individual image built up to only contain the roles and services that are required for that particular server.

If you fancy trying it now and don’t want to step through it in this post with me, then head off to https://aka.ms/nanoserver this is the landing page for the Getting Started with Nano Server walkthroughs. You could also do worse than to head over to Channel 9 here for the Nano server channel. or here for the Windows Server channel

If however you would like to step through how to deploy this innovative new server that can sit in as much as 150MB or RAM and on a VHD of as little as 450MB in size, then read on.

Deploying a Nano Server

There are several ways to deploy a Nano Server. You can deploy a bare metal bootable image, a boot to VHD physical host and a VM image. All three require different tasks and commands. This post will concentrate on the VM method as this is the easiest for a new user to get up to speed with. Future posts will cover the other scenarios.

The first step is to download the Windows Server 2016 TP5 ISO. If you have an MSDN subscription you know where to get it from, if not you can sign up to evaluate the Preview here. Just sign in with a Microsoft Account and download the ISO.

image

You can also see that a pre created Nano VHD has been uploaded for you. I would recommend downloading both. This post will not use that VHD but will show you the steps to go through to create your own. It is, however, useful to have one sitting there ready to use.

The final way to evaluate a Nano server is by deploying one to Microsoft Azure, the Microsoft Public cloud infrastructure. You can sign up for a free trial here. But it is a much better idea to take advantage of the new IT Pro cloud essentials offer here, which gives a longer trial with more money to spend.

So to be able to follow these steps, the minimum you require is.

  1. ISO for Windows Server 2016 TP5
  2. A  PC or server with an operating system and a hypervisor.
    1. Windows 8 or 8.1 or 10 with Hyper V installed.
    2. Windows Server 2008,2012 or 2016 TP5 with the Hyper V role installed

The instructions I will use will show screenshots from Hyper V running on Windows 10. Hyper V does not come installed by default so you can follow  these instructions on Windows 10.

The first step is to mount the TP5 ISO, to do this copy the ISO to a folder and right click on the file. then click MOUNT (alternatively double clicking the file mounts and opens the ISO, in my case on a Drive Letter R:).

You will see a folder named NanoServer image

Double click that folder to see the contents

image

The next step is to copy the NanoServerImageGenerator folder to your hard disk.

The result is shown below

image

Now for the good stuff. We need to run PowerShell to be able to create a VHD containing a NanoServer deployment image. Make sure you run PowerShell as an administrator (right click the icon and run as administrator.

image

I would always run the PowerShell ISE (Integrated Scripting Environment) as it provides a better environment to learn and understand the magic that is PowerShell.

If you do not use PowerShell often, you may well have to set the system to allow you to run local scripts that are not secure or signed.

Do that with this command.

Set-ExecutionPolicy RemoteSigned , type that in the white script area (if you only see blue then click the View Menu and make sure view script pane has a tick by it. image

The click the Green Play symbol or press F5 to run the script pane (to run a single line, select that line and click the play selection icon, one to the right or press F8), accept any warnings or offers to save.

You will not get a result just a new prompt line (PowerShell does not give any feedback unless it is asked to or unless there are errors or warnings)

It is good practice to type all your commands in the white script pane on a separate line and run them line by line. This means you can save the commands as a script when you are done. Saving you retyping next time and even learning.

Now change directory (folder) to where you placed the ImageGenerator folder in my case that is the L: drive root folder. then type

import-module .NanoServerImageGenerator –verbose

I have added the verbose switch so that you can see the commands (or cmdlets that are imported)

image

You are now able to use the CmdLets above to create your Nano Server VHD. There is an awful lot of work that goes in to create this VHD but you can do it with one very simple command.

Type (all on one line)

New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath R: -BasePath .Base -TargetPath .NanoServerVMNanoServerVM.vhd -ComputerName Nano1 – compute –storage –clustering

To break this command down would help, I am sure

New-NanoServerImage (This calls the CmdLet you imported) -Edition Standard (This switch sets either standard or datacenter edition (new in TP5)) -DeploymentType Guest (This switch defines whether the VHD is for a physical host or a guest VM) -MediaPath R: (This is where you mounted your Server TP5 ISO file)-BasePath .Base (This is where you are going to copy the installation files and packages, . signifies the current folder)-TargetPath .NanoServerVMNanoServerVM.vhd (This is the full path including filename to your output VHD or VHDX) -ComputerName Nano1 (This is the internal computer name) There are many many more switches, these allow you to install roles and features into your image. This can be done at creation or by using PowerShell or DISM after the image has been built.I want this VHD to be a file server, a failover cluster node and a hyper v host, so I need to add the following switches to the end of the command.–Storage –Clustering –ComputeThen run that command by selecting it all and pressing F8. This will take some time and will take longer the first time you run it as the CmdLet copies the media files to your hard disk and creates a base Nano VHD as well. Not all these tasks are required for future image creations.The script will run and will ask you to enter an Administrator password. I recommend P@ssword! so that you don’t forget it (as I have written it down) This will be the local administrator password. You can join a Nano to an Active Directory Domain (although Group Policy will not be applicable to Nano Servers). image

When finished, you will have two new folders as shown image

Vase contains all the NanoServer software, a .wim file and the packages to install inside and the NanoServerVM folder contains your new VHD.

This one is 674MB in size, not bad for a Hyper-V host, file server and failover cluster node.

image

Now that we have the VHD we need to use Hyper-V (or PowerShell to create a VM) – I will use PowerShell

I am going to assume that you already have a Virtual switch in your Hyper-V manager (if not use this link to do that now)

The PowerShell to create a VM for my circumstances is below, change it to suit your drive letters and paths.

New-VM -Name EdsNANO -SwitchName Internet -Path L:NanoServerVM -VHDPath L:NanoServerVMNanoServerVM.vhd

Once this has completed with a result as shown image

You can then head on over to Hyper V Manager and start the VM and connect to it.

The VM takes about 6 seconds to start and connect and will show this screen

image

Enter the Administrator username and password and you see the Nano Server Recovery console as below

image

The Nano Server is not designed to be administered locally but uses any r all of the traditional server management tools (and can also be managed from Azure – more of that in a different post)

From this point I suggest you explore the local configuration possibilities.

To connect to the Nano Server remotely we need to get back to PowerShell, we can either use the new Windows 10 PowerShell direct feature or connect to the IP address of the server.

So from PowerShell use this command

Enter-PSSession -VMName EdsNANO

resulting in this output

image

You can see from the revised command prompt, that we are now working directly in the EdsNANO VM.

Check this by typing a number of commands to see what you have

IPCONFIG

hostname

get-process .

You can also look at the Hyper V manager in the Memory tab of the VM image

a total of 220MB for a running server

And then inspect the virtual disk from the VM settings menu. image

A full running server in a hard disk of 606MB

All pretty staggering.

Future posts will show what we can do with this great new technology, but it is only part of the full plan. Nano Server will NOT run all workloads and anything that won’t run in Nano will run in Server Core.

Happy practicing

Source: How to deploy Nano server. (Part 1)