Installing Nano server on Phisical computer

Many of us are testing Nano servers, but as creating VHD is well documented and you can find step-by-step instruction anywhere, deploying Nano server on a host computer is not well documented. I will try to make a step-by-step deployment for deploying a Nano server on a physical server and disk in this post.
All files that you need for deploying a Nano server are located in NanoServer folder on the installation DVD.
For begin deployment you have few possibilities; you can start from Win PE environment, WDS or installation DVD. If you start from DVD or WDS, you have to launch a setup program and then in the first step (where you can choose the language) press Shift + F10 to open command prompt. Actually we do not need installation, but we use it only to access to the command prompt.
Now, we will use diskpart.exe for preparing and partitioning the disk. Here you have to know some limitations: Nano server will start if disk is in formatted GPT mode and here we will prepare the disk to start from UEFI. So, let start and prepare our disk:

Diskpart With this command you will enter in the diskpart mode
List disk Use to locate the disk where you want to install the Nano server. (in my case is number 2)
Select disk 2 Select the right disk
Detail disk Optional – with this command you will receive detailed info about the selected disk
Clean If there are some partition on disk, you have to delete them
Convert GPT This command will convert your disk to GPT

The next step is creating partitions that we need. As we want to use UEFI boot, we need three partitions.

Create Partition MSR Size=128 Create MSR (Microsoft reserved) partition
Create Partition EFI Size=128 Create System partition
Format FS=FAT32 Quick Label=EFI Format System partition
Assign Letter=S Assign letter to System partition
Create Partition Primary Create primary partition
Format FS=NTFS Ouick Label=System Format primary partition
Assign letter=W Assign drive letter to primary partition
Exit Exit from diskpart

With these steps we prepared the disk for deploying server. Now we have all partitions ready, but we still need to deploy the server image and create this disk as bootable.
For deploying the image, we will use DISM. Deploying image with DISM is exactly the same as in previous versions, but you have to remember that when you will log in to Nano server, you will not be able to add or remove functionalities or manage server directly from server – this must be done remotely. For this reason, it is better to deploy packages we need in this step. Of course OEM drivers package is mandatory as we are deploying server to physical server.

For deploing server image on the disk you have to use DISM in this way:

dism /Apply-image /Imagefile:C:\nanoserver\nanoserver.wim /Index:1 /Applydir:W:\

You may have to change the file destination and apply directory based on your configuration.
Now the server image is deployed on the disk, but it is only a basic image and we still have to deploy drivers and functionalities that we need. All of this can be done by deploying packages and drivers. In some cases, you will need to deploy additional drivers (for example RAID drivers). This deployment is also done with DISM, but is not covered in this article.
Packages that are available for Nano server are located in Packages folder on DVD and you can choose which to install. DISM command for installing the package is:

dism /Add-Package /PackagePath:C:\NanoServer\packages\Microsoft-NanoServer-DSC-Package.cab /Image:w:\

Once again you have to change the package location and name and where to deploy it (image parameter), based on your configuration. In this way you have to deploy all packages you need; one by one. This are packages that are available for Nano server:

Compute = Hyper-V Server
OEM-Drivers = Standard OEM Drivers (required if server is host)
Storage = Storage Server
FailoverCluster = FailOver Cluster Server
ReverseForwarders = ReverseForwarders to allow some older App Servers to run
Guest = Hyper-V Guest Tools (reqired if server is virtualized)
Containers = Support for Hyper-V and Windows containers
Defender = Windows Defender
DCB = Data Center Bridging
DNS = DNS Server
DSC = PowerShell Desired State Configuration Support
IIS = Internet Information Server (Web Server)
NPDS = Network Performance Diagnostics Service
SCVMM = System Center VMM
SCVMM-Compute = Sysmte Center VMM Compute

Now remains only to make the disk bootable and we will use BCDBOOT:

bcdboot w:\windows /s s: /f UEFI

Don’t forget that some switches may have to be different and they depend on your configuration. W:\Windows is the folder where you have the deployed server image and S: is the letter of EFI partition.

Finally, we have all done, just reboot the server and use it.
As in all other server installations, on first logon you have to change the Administrator password. Don’t be afraid how, just try to logon with blank password and you will be asked for a new one..

How to compact VHD or VHDX

When we try to compact dynamically expanding VHD or VHDX we have to do few things if we want reach good results.
First we need to know how file system is working. It is important to know that when we delete a file or just a part of the file, those data are not really deleted, you just remove a pointer to that sector. This is important because the compact operation will just remove the free space and simply deleting the file will not free the space on VHD file.
For this reasons you have to prepare VHD before you can compact it. To prepare virtual disk for this operation, three steps are important:

  • Empty Recycle bin – if you have files in Recycle bin it is best practice to delete them before compacting disk as they need space like any other file.
  • Defrag VHD – it is recommended also to defrag the disk for getting best results. This will also speed up your work with VHD.
  • Write zeros to free space – writing zeros on free space you will remove all “deleted” data, so this is a really important step that will free your space.

To write down zeros you need external application as there is no build in application to do it. I am using Rusinovich’s SDELETE (https://support.microsoft.com/en-us/kb/2786067). The usage is very simple; you have just to run sdelete from administrative command prompt with Z switch. For example, if you want to free space on D drive you have to run a command in this way:

Sdelete.exe -z d:

With this command you will free space and now you are ready to compact VHD form Hyper-V manager or PowerShell. Using this steps, you will really decrease a space used by VHD. .

Calculating RAID IOPs

Many times my colleagues ask me how to determinate IOPs on their RAID or storage. There are a lot of posts on internet and for this reason I don’t want to create another copy of the same content.
Of course you have to calculate IOPs based on disks that you have. Not all the disks are the same and real IOPs can vary, based on the model of the disk. How to calculate IOPs of the disk is well explained in this link http://www.techrepublic.com/blog/the-enterprise-cloud/calculate-iops-in-a-storage-array/. But if you want just an approximate calculation of your RAID field, you will like this link http://www.thecloudcalculator.com/calculators/disk-raid-and-iops.html. It is approximatively as IOPs depend on actual mark and model of disks, RAID controller or NAS, but it can be used as a guideline to determinate your configuration..

Create Virtual network in Azure

I decided to publish few articles where I will document how to create a hybrid network between your local network and Azure (using some chip routers) and finaly how to create a VM in Azure as a part of your network. This is the Part 1 of whole proces and here is covered how to create Virtual network in Microsoft Azure.

In this article I will explain the complete step-by-step guideline how to create a network in Azure, site to site VPN from your local network to Azure and finally how to create an Azure VM connected to your local domain.
There are few things that you have to know:

  • local subnet,
  • IP of local router,
  • IP of local DNS server (in your AD domain).

First we need to create virtual network in Azure. This will be a part of our network, but as we will connect to this network via VPN, it must be on a different subnet.
To create a Virtual network, you have to login into an Azure portal, select Networks and then Create a virtual network.

Screen1

This will launch a wizard for creating network and this are the steps that you have to perform. First just give a name to network and chose a location and subscription. Be careful with choosing a location. Later you will be able to use VPN only to virtual machines, in the same location where the network is.

Screen 2

On the second screen you have to enter some data about connectivity. As we said at the beginning, the VPN will be site to site, so you have to select this one. DNS servers will be used to resolve names in this network and as we want to add a virtual machine, which is a part of our Active directory, we should be able to resolve it in our AD. This is the reason why specified DNS servers have to be our local DNS servers from local AD (not public DNS!).

Screen 3Next step is to specify our local network. You have to specify the name of the network.
VPN device IP address is a public address of your router, from which you will establish the connection to Azure.
In address space you have to specify all of your private networks, from which you want to establish connections to Azure.
All of this data are needed by Azure for determination of routes and connectivity.

Screen 4

In the last step, you have to define the address space used in Azure. This is a private IP address space and has to be different from your local IP address space.

Screen 5

The rules to define are the same as those you have when you create VPN between two local sites, but there are some more settings:

  • Address space defines the whole address space that you can use as a part of Azure virtual network. Any subnet, which is a part of this network, must be created as a part of this space.
  • Gateway subnet: this subnet is responsible to have connectivity outside of Azure. In this subnet will be located a router, which will act as endpoint of VPN tunnel. Do not use this subnet to create virtual machines in it.
  • Subnet: you have to create at least one subnet. This will be the address space where you will create virtual machines. In many cases will be enough one subnet, but if you have to build a larger deployment, isolations of VM or similar things, maybe you will need more than one.

Screen 6

With this steps you created a set of network settings that include Azure virtual network, local network and DNS setting. When you finish this steps, your Azure network is ready to use, but don’t forget to create a gateway. This one is necessary to establish a VPN connection.

Screen 7

If you want to use this network in a combination with your local network, you have to create a gateway. This is an IP which will act as an end point of VPN Tunnel. For creating the gateway, you have another wizard; it is not complicated, but it could take time (30 minutes or more).

Screen 8

Click on create gateway on the bottom of the page, and use Static routing if you have a static IP address. After the creation of the gateway is complete, you will have an IP address of the gateway. This is the IP address that you will have to write into your local router as the endpoint of VPN. The only thing that is missing now, is a shared key. You can read it by clicking Manage Key button on the bottom of the page. Write down this key, because you will need it later in the router configuration.

If you have a router model (like Cisco…) that is supported by Azure, you can export data to configure it directly from the portal with clicking “Export” button. In all other cases, you will need to estabilish VPN manually – here you will need to press the Manage Key button.

AzN9

 For establishing the connection to Azure network successfully, you will need a preshared key and a gateway IP address (showed at previous and next picture). I recommend, to write them down into some file or on a paper.

AzN10.

Many free tools for administrators

For any administrator, who want to use any kind of free tools to have better access or monitor some functionalities in Windows environments, here we have a list of many free tools. Just look which is usable for you and use it:
https://4sysops.com/best-free-windows-admin-tools/
And please, test it in test environment prior you use it in production. Many times tolls are not exactly the same as you expect..