Thursday, February 11, 2016

Nano Servers - MS answer to VMware ESxi

Good day All,

Welcome back!!!

Windows 2008 gave birth to Server core a small footprint of Windows 2008 OS and with Windows 2012 we where able to move from Server Core to Minimal Server Interface to Full GUI Windows 2012.
With Windows 2016 MS gave birth to Nano Servers a small footprint of a Windows OS,VM guys can say it as similar to ESXi but we all will be surprised to see a Windows OS just about 700MB, so hard to believe it right? :)

see the below screen shot to believe it - Probably the max size i would say.. i have included almost all Roles and Features. If this Nano Server serve has only DNS or Hyperv or Clustering probably image size would be around 600 MB





Lets go over the steps to setup you first Nano Servers:

1. Mount your Windows 2016 Technical Preview 4 ISO
2.Copy the contents from folder named NanoServer on to some drive , Lets say C:\Nanoserver

3. Open Powershell in Administrator Mode and run the following Commands


Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Confirm:$false

Change the Path to the foler you copied that nanoserver scripts from ISO.

Import-Module .\nanoServerImageGenerator.psm1 -verbose


New-NanoServerImage -MediaPath H:\ -BasePath .\Base -TargetPath C:\NanoServer\NANO2016A.vhd -ComputerName NANO2016A -OEMDrivers –Compute -Clustering -Storage

Note: The below screen shot taken from MS article tells in detail what are the various Roles and Features you can add to a Nano Server.




Note: H drive is where my Windows 2016 ISO mounted.



when done you will see a vhd in the location targetpath you specified, in my case its c:\NanoServer

update the vhd with Guest drivers too for Hyper v

Edit-NanoServerImage -BasePath .\Base -TargetPath C:\NanoServer\NANO2016A.vhd -GuestDrivers


4. Create a Virtual machine and attach the vhd you just created and boot it up..

well this was easy :)



Type your username and password and press Enter




Assign a static IP:

Edit-NanoServerImage -BasePath .\Base -TargetPath C:\NanoServer\NANO2016A.vhd -InterfaceNameOrIndex Ethernet -Ipv4Address 192.168.1.42 -Ipv4SubnetMask 255.255.255.0 -Ipv4Gateway 192.168.1.1

Now try pinging your First Nano Server



5.
We have couple of way to manage the Nano Server, i will show you how to access the Nano Server using pssession

Open the Power Shell as Administrator and run the following commands

net start winrm
Set-Item WSMan:\localhost\client\trustedhosts "192.168.1.42"


Enter-PSSession -ComputerName 192.168.1.42 -Credential nano2016a\Administrator



If you see the below error when trying to connect pssession for a nano Server then that mens that you have not added that IP of nano server to trusted hosts for Windows Remote Management.
run Set-item command for that IP and then try the pssession.
The example below i had a Nano Server named nano2016b IP: 192.168.1.43 not added to trusted.



So we have successfully logged in to Nano Server using PSSESSION

6.
To disable Windows firewall you can run the following commands in pssession

NetSh Advfirewall set allprofiles state off
net stop mpssvc
set-service -name "MpsSvc" -ComputerName -Status stopped -startuptype disabled



7.
Adding a DNS IP :


Get-DnsclientServeraddress - will list all the NIc's Server address
Set-dnsclientserveraddress -InterfaceIndex 3 -Serveraddress ("192.168.1.20")
or
Set-dnsclientserveraddress -InterfaceAlias "Ethernet" -ServerAddress '192.168.1.20'

8. Adding Nano Server to Domain:

Follow the below steps if you don't have any Hyper V Server already in Domain:

a. login to any Windows 2012 R2 domain join Server
b. Run the below command
djoin /provision /domain vlab.com /machine nano2016a /savefile c:\nano2016b.txt
you will see a text file been created



If you see the AD now there will be Computer object with nano2016b pre-created.


c.
Map a drive to your Nano Server and copy the nano2016b,txt file

d.
Now enter the Nano Server using PS-Session and verify that txt file exists


run the following command:

djoin /requestODJ /loadfile c:\nano2016b.txt /windowspath c:\windows /localos



We have successfully add the Nano Server to domain, before you test make sure to reboot the Server.





Note:
If you don't update DNS details before joining to domain then DNS A record will not be created , then you will be to run the set-dns command and then do flush and register dns.


9.Follow the below steps to add Nano Server to domain  if you have any Hyper V Server already in Domain

New-NanoServerImage -MediaPath D:\ -BasePath .\Base2 -TargetPath C:\NanoServer\Test3 -ComputerName Test3 -GuestDrivers -Compute -Clustering -InterfaceNameOrIndex Ethernet -Ipv4Address 192.168.1.53 -Ipv4SubnetMask 255.255.255.0 -Ipv4Gateway 192.168.1.1 -DomainName vlab.com

So this will create a New VHD, assign IP and then add to domain as well...














Note: Please make sure to Set the DNS IP Address and do the registerdns to have a host record created in DNS.
10.
 Disable IP6 if you need so:

Disable-NetAdapterBinding -InterfaceAlias "Ethernet" -ComponentID ms_tcpip6

11. if you seeing this error after adding to domain but unable to login with domain ID then probably you would have forgot to update the DNS, so add the DNS using set-dns, then flushdns and registerdns. Make sure you doing it by logging to nano server using psssession.





















For more information you can take a look at this below MS article,

https://msdn.microsoft.com/en-us/library/mt126167.aspx

After playing for sometime it was easy to setup and move around.. but we should start brushing our Powershell knowledge if not done already as this is will be a must if you have to support Nano Servers.
Hopefully this helps someone!!! and until next one all have a good day!!!!

Monday, February 8, 2016

Adding Hyper V 2016 Node to exsisting 2 Node Windows 2012 R2 Cluster - Part 3

Good day All,

Welcome back!!!

Before 2016 if you have to move to a new Hyper V Cluster or any other Cluster you will have to evict the Node, rebuild the Server.. create a brand new Cluster and move the resource or copy over the resource..
With Windows 2016 finally MS pulled it off and now we will be able to add a Node to existing cluster and now with No downtime we will be able to migrate to new Windows version of 2016.

As of Technical Preview 4, its possible only from Windows 2012 R2, will  be able to migrate from old versions like 2008,2012 is yet to be unknown but that looks very unlikely.


Some really exciting new Features in Window 2016, i encourage everyone to take a look at below link
https://technet.microsoft.com/en-in/library/dn765472.aspx


Recap of Part 1 and Part 2 Lab:

Scale out File Server:

FooFS1 - 192.168.1.27
FooFS2 - 192.168.1.28
FooFS - 192.168.1.29 - Client Access Point for Accessing the cluster
FOOSHAREVM - client Access Point for Scale out File Server.
\\foosharevm\VMSHARES - File share to store Virtual machines

Hyper V Cluster:

Hyperv2012A - 192.168.1.25
Hyperv2012B - 192.168.1.26
Hypervclus -     192.1681.24


New Node Windows 2016 to be added to existing Hyper V cluster:

Hyperv2016A - 192.168.1.23


As always make sure you have replicated the 2016 Server similar to 2012 R2 Servers in terms of
1. NIC Settings
2.Private Heartbeat
3.Permission to Window 2016 Computer object to access the Scale out File Server


4.If you have Windows Firewall disabled then do it as well
5.Internal Switch settings for VM


If anything mismatch Cluster Validation will tell us, so lets start with validation


Note:
 All Cluster Validation should be done only in the new Windows 2016 Node.
Also adding of Node to 2012 R2 cluster should be done from Windows 2016 Node. 



Note: If you going to pick Run all test remember to be cautious in production Environment, Storage will be tested as well.
Warnings i know why because i don't have redundancy on NIC's.

I got a failure, if you read through it clearly says that i forgot to create the Virtual switch on the new Windows 2016 Node.



So i fixed the Virtual switch and re-run the validation and this time it run fine.




Adding the Node to existing Cluster:

1. Login in to Windows 2016 Node
2.Make sure both Hyper V, Failover roles and feature is installed
3.Open Failover Manager and connect to Windows 2012 R2 cluster



4. Type the Windows 2012 R2 Cluster Name


5. Click Add Node



6. Add the new Windows 2016 Node and click Next



7. That's it you have add the Node to cluster.

Wow finally Rolling upgrades work's in Windows 2016 the feature we all have been waiting for.



8.That was easy!!!





9. Lets do the Live Migration now, worked faultlessly :)






Rolling upgrade is one of the best feature addition in Windows 2016 along with lot of features..

Hope this helps someone and until next one you all have a good day!!!

Wednesday, February 3, 2016

2 Node Hyper v connecting to Scale Out File Server to store Virtual Machines - Part 2

Good day All,

Welcome back!!!

Just to recap in part 1 of this series we created a 2 Node Windows 2012 R2 cluster with Scale out File Server.

In Lab the share Name is : \\foosharevm\VMSHARES

Today we will go over creating a two Node Windows 2012 R2 Hyper V cluster, create couple of Virtual Machines and we will place them on the above share.

Step by Step creating Cluster i have added on Part1 so will not do the same here, i will do the cluster creation on the background and during the adding of Hyper V role will go over step by step.

Lab:

Hyper V Cluster:

Hyperv2012A - 192.168.1.25
Hyperv2012B - 192.168.1.26
Hypervclus -     192.1681.24 - Cluster Client Access point.

Enabled Roles and Feature on both Nodes
Failover Clustering
Hyper V

Cluster validation report:




Why am i seeing warnings
1. No SAN storage attached as i want to store all the VM on share location
2. As i have only 1 NIC for all communication
3.My 2 desktops in lab are 2 different versions of Intel processor model, so warning saying Live Migration will not work.. but as along as its not like Intel to AMD migration it will just work fine.

As this is just a lab i skipped all the warnings and went ahead with Cluster creation




As i told before i don't have SAN storage attached to it so for Quorum formation it automatically configured as Node Majority.
We don't want to leave the Cluster on Node Majority because if 1 Node goes down the whole cluster will go down, so let configure Share Witness on Scale Out File Server

More info on right way of setting up the file share for Witness :

https://blogs.msdn.microsoft.com/clustering/2014/03/31/configuring-a-file-share-witness-on-a-scale-out-file-server/










We have successfully created the cluster, so lets add the Hyper V Role in Cluster












As there are no Virtual machines on either of the Nodes that needs to be made as High Available i really don't need to run the Configure Role wizard as we have already enabled Hyper V Role on both the Nodes.So cancel the wizard.

Let's create our First VM on the File Share:



Select the Node you want to have the VM reside and click OK


Important Step is to make sure you enable check box and point the Virtual Machine location to Share location.

Virtual disk also should be placed in the shared location


When i clicked Finished , i got this error...



Well the reason i got this error is because the File Share doesn't have permission so go edit the Permission of file share and add the following users and give them Full Control
1. All the Nodes part of Hyper V cluster
2.Hyper V Administrator




After giving permission wait for sometime for permission to take affect and try it...

So i went ahead and add 2 VM's on each Node and tested the Live Migration..


Tested even the quick migration or unexpected shutdown and both VM's state was saved and moved to other Node and restored.



So far, my take is Installing Hyper V cluster is not that bad experience.. i know if anyone from VMware might struggle but with cost effectiveness and lot of Windows Admins knowledge with Powershell this whole process should be mush easier.

With Nano Servers in 2016 Technical preview and  still have some time for Windows 2016 RTM version to come out MS is in right direction and probably lot of Customers may starting looking with Hyper V.


In Next Part i will go over how to migrate the VM from Window 2012 R2 to Windows 2016 TP 4 with No downtime.

Hope this was fun and helps someone!!! until next one all have a good day!!!