Hyper-V Playbook

So you just got a Nutanix cluster and want to install Hyper-V?  This guide goes over the steps 
you need to do and how to manage this new cluster.  We also cover some normal operations such as patching.

Requirements

  • 3 or more Nutanix Nodes with a 64GB DOM (the 16GB DOM is too small)
  • Active Directory
  • A Management computer.  This can be any machine (or VM) running Windows 8.1 or Windows Server 2012 R2 with the GUI joined to the same domain as the Nutanix nodes will be (or any domain with a trust relationship with the Nutanix Domain, however that is outside the scope of this document)

Imaging the Nodes and Creating the Cluster


With Foundation 2.0 you can image the nodes with Windows 2012 R2 (Standard or Datacenter) or with Hyper-V Server.  What are the differences?

Hyper-V Server is free, but cannot run any roles or features besides Hyper-V and Hyper-V related ones such as Failover Clustering

Windows 2012 R2 Standard is a full version of Windows that you need to license.  It can run any role including Hyper-V.  Best practice is to only run Hyper-V (to limit the systems vulnerability and reduce the number of patches it needs).  Standard also comes with 2 instances of virtualization rights.  This means if you use the server as Hyper-V server you can install 2 full copies of Windows on VMs running on this machine.  This allows you to separate out your services and follow best practices.

Windows 2012 R2 Datacenter is the exact same as Standard feature-wise.  The only difference is that it comes with unlimited virtualization rights.  This means that a host licensed with datacenter licensing can have as many windows VMs running on it using the same key as you need.

Nutanix only supports server core (or server without a GUI - all management done remotely or though powershell).  Best practice for a Hyper-V server is to not run any other roles on the base Windows installation (or Parent Partition).  This simplifies the question of which version to install to “how many Windows Server 2012 R2 VMs are you going to install on this cluster?”

  • 0 (or licensing from another source) - Hyper-V Server
  • 1-2: 2012 R2 standard
  • 2+:  2012 R2 Datacenter

This is neglecting license cost, which could change the break points here, so make sure to do your own calculations!

NOTE: Hyper-V Server (the free version) doesn't support RemoteFX which is needed to use the GPUs in the NX-7000.  If you are using this configuration you will need to use the full Server 2012.

Running Foundation itself (or installing Windows otherwise) is outside the scope of this document, but Foundation is straight forward and will install, image, and create the cluster for you.

Adding Hosts to the Domain


After Foundation has finished, your nodes will be imaged with a CVM on each one and the CVMs will be clustered.  The next step will be added them to the domain

  1. SSH to any one of the CVMs
  2. Run the command “setup_hyperv.py setup_hosts”
  3. Answer all the prompts


This will go through, add each node to the domain, and reboot.  If this command fails, run ‘cat /home/nutanix/data/logs/setup_hyperv.log’ to see why it failed.  For example:

2015-01-06 07:17:42 INFO setup_hyperv.py:324 Received command from master: {"command": "status"}
2015-01-06 07:17:44 CRITICAL setup_hyperv.py:648 Could not join the domain. cmd = 
        $password = "<password_hidden>" | ConvertTo-SecureString -asPlainText -Force
        $credential = New-Object System.Management.Automation.PSCredential(
          "sre.local\cbrown", $password)
        Add-Computer -DomainName "sre.local" -Credential $credential -Force `
          -Options JoinWithNewName,AccountCreate
, rv = 1, stderr = Add-Computer : Computer 'NTNX-11837' failed to join domain 'sre.local' from 
its current workgroup 'WORKGROUP' with following error message: The specified 
domain either does not exist or could not be contacted.
At line:5 char:9
+         Add-Computer -DomainName "sre.local" -Credential $credential -Force `
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (NTNX-11837:String) [Add-Compu 
   ter], InvalidOperationException
    + FullyQualifiedErrorId : FailToJoinDomainFromWorkgroup,Microsoft.PowerShe 
   ll.Commands.AddComputerCommand

As you can see here, powershell errors can be hard to read.  I’ve highlighted the interesting portion.  In this case my cluster failed to join the domain because it couldn’t find “sre.local”.  I had my DNS server set incorrectly so I re-ran the script with the correct settings and was able to join without issue.

Non-Nutanix (so no setup_hyperv.py script)

In that case simply use sconfig to join to the domain.  You can also use the add-computer powershell command

Remotely Managing a Hyper-V Host

Now that you have joined the domain, you have established a trust between your management machine and the Nutanix cluster.  You can now use the management tools on that machine to manage these hosts.  This section goes over how to install these tools on the 2 supported OSes (Windows Server 2012 R2 and Windows 8.1)

Windows 8.1

Installing the management tools is done in 2 parts - Hyper-V manager and RSAT.

Hyper-V Manager

Hyper-V manager can be installed using the “Turn Windows Features on or off” wizard.  Hit Start and type “Add Features to Windows”



In the window that pops up scroll down to Hyper-V and install the management tools.  You now have Hyper-V manager!
  

Remote Server Administration Tools (RSAT)

Installing RSAT will install all the other management tools you need to manage any Windows installation remotely (including Server Manager and Failover Cluster Manager which we will use).

Simply download RSAT from Microsoft and install.  You will now have all the tools you need.

Windows Server 2012 R2

Windows Server already has Server Manager installed.  Using this you can add the management tools for the applications you need.  In our case there are 2 we need - Hyper-V Manager and Failover Cluster Manager.

Open Server Manager and Click Manage -> Add Roles/Features



Choose the management server and go next until you are at the ‘features’ page.  Once here scroll down to Remote Server Administration Tools and choose Hyper-V Manager and Failover Cluster Manager.  These are the two tools we’ll be using (in conjunction with Server Manager) to manage the system. 

SCVMM

SCVMM is another tool you may choose to use in your environment.  It’s similar to vCenter mixed with vCloud Director.  It’s not needed to get some basic virtualization features (for example, you can do HA, clusters, Live migration, and replication all without it), but it does provide some other interesting features.  If you are using SCVMM in your environment it’s important to make sure that Hyper-V manager and Failover Cluster Manager both work for situations where SCVMM fails. 

To install the SCVMM console simply insert the disk SCVMM came with into the machine and install the console from the autoplay wizard

Using the tools

These three tools provide 3 very different views into the system:

Hyper-V Manager provides a per-host view of the virtual machines.  This would be equivalent to pointing the vSphere client directly at an ESXi host with some additional features (such as Live Migration).  You will use this to manage non-HA VMs

Failover Cluster Manager provides a cluster-wide view of HA VMs.  Non-HA VMs will not show up here.  This will be used to manage your HA VMs (or to make non-HA VMs HA)

Server Manager allows you to do basic computer configuration such as installing roles, changing the NIC teams, rebooting the server and monitoring process states.  We mainly use this to configure NIC teaming.

SCVMM is special in that it provides tools to do all of these things in it’s own way.  If you use SCVMM you may never use the other tools, however it’s important to have all the options available to you.  

As time goes on you will find that a particular tool will fit a task better then others.

Creating the Failover Cluster


Now that we’ve got the management tools needed and the hosts joined to the domain, it’s time to create a failover cluster.  There are 2 ways to do this:

  1. If you’re not using SCVMM, run “setup_hyperv.py create_failover_cluster” from any of the CVMs
  2. If you are using SCVMM, run “setup_hyperv.py setup_scvmm” from any of the CVMs

In either case this will run though the basic setup and get the cluster created for you.  You can then manage the cluster from SCVMM (if you’re using it) or from Failover Cluster manager (in either case).  Simply connect it to the cluster using the name you assigned it during creation.

Updating Hyper-V Settings

There are 2 settings you need to change in Hyper-V Manager at this point:

  1. Live Migration
  2. Default VM location

Setting the Default VM Location


In Hyper-V Manager go to “Hyper-V Settings” for the host



In here change Virtual Hard Disk Location and the Virtual Machine Location to “\\[cluster-name]\[container-name] 



Now by default VMs will be saved on Nutanix Storage rather then the local SataDOM!

SCVMM Does it slightly differently, so if that is your management tool of choice it’ll handle the file share storage.  Simply run “setup_hyperv.py register_shares” to register new containers with the cluster!

Creating VMs


Use Hyper-V Manager or SCVMM to create VMs.  Connect to the host you want to create the VM on and right-click -> New VM to create a new VM.  Run through the wizard and you’ve got your first VM!


Create HA VMs

There are 2 ways to create HA VMs:

Create the VM from Failover Cluster Manager
Add a “VM” role to the cluster and tie it to the VM you want to be HA

Create the VM From Scratch to be HA

From Failover Cluster Manager connect to the cluster.  Right click on Roles and navigate to  Virtual Machines -> New Virtual Machine




This will launch the VM creation wizard and make it HA after creation if completed

Making an existing VM HA

If you’ve already got running VMs that you want to be HA, simply connect to the the Failover Cluster in Failover Cluster Manager, right click on Roles and choose “Configure Role” 

Choose “Virtual Machine”



Next chose the VMs you’d like to be HA


Once you’ve done this Failover Clustering will protect these VMs.

If you want to move these VMs now you can simply use the Move -> Live Migration wizard.

If you want to move these VMs now you can simply use the Move -> Live Migration wizard.  See my Live Migration post for more info

Networking

Networking is a bit of a mess in both Hyper-V and SCVMM, check out this Tech TopX for a video and this post for a cheat sheet

Patching

See my new post for a more detailed overview of CAU