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..

Forgot ILO Password?

No problem. You can reset it via software from your operating system. It is possible to do it from almost any Windows server system and from Linux (from Linux I didn’t try).
To do this, you have to install HP Lights-Out Online Configuration Utility for the system that you are using. You can download it form HP web page, where the drivers are located.
After you have installed this software, you will need a XML file with this content:

<ribcl VERSION=”2.0″>
 <login USER_LOGIN=”Administrator” PASSWORD=”boguspassword”>
   <user_INFO MODE=”write”>
    <mod_USER USER_LOGIN=”Administrator”>
     <password value=”YourNewPassword”/>
    </mod_USER>
   </user_INFO>
 </login>
 </ribcl>

I know, that the login password (the old one) is not correct, but you don’t need to know it (scary…), it will work.
Save this file into the folder C:\Progam Files\HP\hponcfg and launch the command prompt as Administrator. Navigate to the folder and type:
Hponcfg /f YourFile.xml /l YourLogFile.txt
You will be noticed that script worked correctly. Now you have just to login into ILO with the new password.
Easy to do it. Maybe too easy.

More reading:
Export ILO configuration

ILO Scripting guide.

Not able to backup Generation 2 VM

I was very disappointed when I tried to backup my Generation 2 VM with the last version of DPM and I saw that DPM is not able to make a backup. Of course the next step was to backup the same machine (bare metal) from Windows backup, because a lot of times you can see more detailed error in this step. In this case it was exactly as I hoped. From the Windows backup I received an explanation of error – there is not a enough free space of volume \\?\Volume{7ab7a499-9013-4f22-90a7-f8fb2f70e349}\.
What is this volume? I checked it from Administrator command prompt and I saw that this is the 300MB boot partition and of course there is not enough space.
To solve the problem we will execute all commands from the elevated command prompt.

The first step you have to take is to find the volume label. To do this, we have to use the command mountvol. You have to look in the results and there you will find a non mapped volume:
    \\?\Volume{7ab7a499-9013-4f22-90a7-f8fb2f70e349}\
        *** NO MOUNT POINTS ***
At this point we have to move the location of shadow copies with this command:
vssadmin add shadowstorage /for=\\?\Volume{7ab7a499-9013-4f22-90a7-f8fb2f70e349}\ /on=c: /maxsize=500MB
This will move the location of shadow copies to drive C:. Of course, you can choice any other drive where you have enough free space. You can test if the location has really changed with vssadmin list shadowstorage.
After this change, the Windows backup was successful, but I still had problems to perform backup with DPM but it is simple to make it work. Just delete the current protection (Stop protection of the member…), remove the data from the storage and recreate the protection. It will work..