Hyper-V Converged Fabric with System Center 2012 SP1 – Virtual Machine Manager

System Center Logo

This blog post is a part of a series of blog posts about System Center 2012 Virtual Machine Manager, I am writing together with Michel Luescher (Consultant from Microsoft Switzerland).

Hyper-V Converged Fabric

Last year I already wrote a blog post about Windows Server 2012 Hyper-V Converged Fabric or Converged Networking. Hyper-V Converged Fabric in a simple way allows you to use network adapters for different type of traffic. In Windows Server 2008 R2 Hyper-V we didn’t really had this capabilities because the network teaming relied on 3rd party software and Hyper-V itself didn’t offered a mature QoS solution. In other words, we had to go with what I now would call a traditional Hyper-V host design.

Traditional Design

traditional Hyper-V host

Each dedicated Hyper-V network such as CSV communication or the Live Migration network used an own dedicated physical network interface. These different network interfaces could also be teamed with third party software, example with the software from HP, Broadcom or Intel. This design is still a good design in Windows Server 2012 but there are other configurations which are a lot more flexible.

In Windows Server 2012 you can get much more out of your network configuration. First of all NIC Teaming is now integrated and therefor out-of-the-box supported in Windows Server 2012. Another cool feature is the use of virtual network adapters in the Management OS (a.k.a. Parent Partition). This allows you to create a Hyper-V Hosts with all the necessary networks (Management, Live Migration, Cluster,…) by teaming just two or more physical adapters for a virtual switch and then create the additional virtual network adapters (vNICs) for the Hyper-V Management OS.

Continue reading

Windows 8 Client Hyper-V

Windows 8 Client Hyper-V

Last year Microsoft announced that Hyper-V is included in the Windows 8 Pro and Windows 8 Enterprise. Hyper-V on Windows 8 is great if you want to run your demo environment on your client or you have special application which do not run on Windows 8.

It’s a great solution for me. Sure there were other solutions like Virtual PC, Virtual Box and VMware Workstation before, but using the built-in Hyper-V has some advantages which make my life a little easier.

  • PowerShell support – it lets me start up a whole lab environment within seconds. I can quick import Virtual Machines and start them up.
  • Performance – it offers great performance. (Same as Windows Server 2012 Hyper-V, Windows 8 Hyper-V allows you to create VMs with 64 virtual CPUs and much more)
  • VHD and VHDX – it’s great to work with one virtual disk format and not have to convert virtual disks and if you need you can native boot from VHD or VHDX
  • Dynamic Memory
  • Remote Management for Hyper-V Servers (like the RSAT)
  • Live Storage Migration – Move a running Virtual Machine from local disk to another local disk, USB or network share and back

To enable Hyper-V on your Windows 8 system you have some requirements.

  • Windows 8 Pro or Windows 8 Enterprise
  • CPU Virtualization Feature (Intel VT or AMD-V)
  • Hardware based Data Execution Prevention or DEP (AMD NX and Intel XD)
  • 64-bit system that has Second Level Address Translation (SLAT)

To check the hardware requirements of your system you can use the command line utility systeminfo:

systeminfo Hyper-V

To install Hyper-V on your Windows 8 you have two different ways to enable. First you could enable over the GUI.

Windows 8 Hyper-V Feature

or you could use my favorite way, Windows PowerShell:


Enable-WindowsOptionalFeature –FeatureName Microsoft-Hyper-V -All

Windows 8 Hyper-V Feature PowerShell

For more information about Hyper-V on Windows 8 checkout the Windows Client Hyper-V TechNet page.

Windows Server 2012 Hyper-V: VM Resource Metering via PowerShell

Windows Server 2012 Logo

With Windows Server 2012 Hyper-V Microsoft introduced a new feature in Hyper-V called Resource Metering which allows you to measure the usage of a virtual machine. This allows you to track CPU, Memory, Disk and network usage. This is a great feature especially if you need to do charge back or maybe even for trouble shooting.

Last week I had the chance to test and implement this feature for a customer.

First you can check the available PowerShell cmdlets for Hyper-V or for the the commands which include VMResourceMetering.


Get-Command -Module Hyper-V

Get-Command *VMResourceMetering*

Get-Command VMResourceMetering

The resource metering has to be enabled per Virtual Machine. This is great, so even if you move the virtual machine from one Hyper-V host to another you still have the usage data.

To enable the resource metering you can use the following cmdlet. In my case I enable VM Resource Metering for my VM called SQL2012.


Get-VM SQL2012 | Enable-VMResourceMetering

 

Enable-VMResourceMetering

With the cmdlet Measure-VM you can get the statistic for the VM.


Measure-VM -VMName SQL2012

Get-VM SQL2012 | Measure-VM | select *

Measure-VM

To get the network traffic use the properties of the NetworkMeteredTrafficReport.


(Measure-VM -VMName SQL2012).NetworkMeteredTrafficReport

Measure-VM NetworkMeteredTrafficReport

Here is another great thing, if you want to measure Network from or to a specific network you can use VM Network Adapter ACLs to do so. With ACLs you can not just allow or deny network traffic, you can also meter network traffic for a special subnet or IP address.


Add-VMNetworkAdapterAcl -VMName SQL2012 -Action Meter -RemoteIPAddress 10.10.0.0/16 -Direction Outbound

add-vmnetworkadapteracl measure-vm

Of course you can reset the statistics for the VM.


Get-VM SQL2012 | Reset-VMResourceMetering

reset-vmresourcemetering

And to disable resource metering for the VM use:


Get-VM SQL2012 | Disable-VMResourceMetering

 

I think this is one of the great new features of Windows Server 2012 Hyper-V which gets not a lot of attention but is really important.

If you want to know more about Resource Metering in Hyper-V, checkout the blog post from Lalithra Fernando on the TechNet Virtualization Blog.

PowerShell 3.0: Show-Command

Powershell

Just a simple note about a new cmdlet in PowerShell 3.0. Show-Command is something very useful if you try out a new PowerShell Command. It shows all the options and possible parameters you have with the cmdlet.

Show-Command Get-Childitem

Show-Command

 

Windows Management Framework 3.0 Community Technology Preview

 

Powershell

Some days ago the Microsoft Powershell Team released the Community Technology Preview of the Windows Management Framework 3.0 which includes Windows PowerShell v3. You can download the the CTP1 here and it requires Windows 7 SP1 or Windows Server 2008 R2 with SP1.

You can use very easy both PowerShell versions sie by site.

powershell.exe -Version 3.0

powershell.exe -Version 2.0

But the Windows Management Framework 3.0 CTP1 does not only includes PowerShell 3, it also contains new versions of WMI, WinRM and the new Windows PowerShell Webservice.

Windows PowerShell 3.0

  • Workflows
    Workflows that run long-running activities (in sequence or in parallel) to perform complex, larger management tasks, such as multi-machine application provisioning. Using the Windows Workflow Foundation at the command line, Windows PowerShell workflows are repeatable, parallelizable, interruptible, and recoverable.
  • Robust Sessions
    Robust sessions that automatically recover from network failures and interruptions and allow you to disconnect from the session, shut down the computer, and reconnect from a different computer without interrupting the task.
  • Scheduled Jobs
    Scheduled jobs that run regularly or in response to an event.
  • Delegated Administration
    Commands that can be executed with a delegated set of credentials so users with limited permissions can run critical jobs
  • Simplified Language Syntax
    Simplified language syntax that make commands and scripts look a lot less like code and a lot more like natural language.
  • Cmdlet Discovery
    Improved cmdlet discovery and automatic module loading that make it easier to find and run any of the cmdlets installed on your computer.
  • Show-Command
    Show-Command, a cmdlet and ISE Add-On that helps users find the right cmdlet, view its parameters in a dialog box, and run it.

WMI

  • A new provider development model
    This new model brings down the cost of provider development and removes the dependency on COM.
  • A new MI Client API to perform standard CIM operations.
    The API can be used to interact with any standard WsMan + CIMOM implementation, allowing management applications on Windows to manage non-Windows computers.
  • The ability to write Windows PowerShell cmdlets in native code
    The new WMI Provider APIs supports an extended Windows PowerShell semantics API allowing you to provide rich Windows PowerShell semantics. e.g., Verbose, Error, Warning, WhatIf, Confirm, Progress

WinRM

  • Connections are more robust
    Session disconnect and reconnect, with or without client session reconstruction, allows long-running tasks to continue even when the session in which they were started is closed and the client computer is shut down. This feature also allows administrators to reconnect from different computers to check the status of remote running tasks and get results.
  • Connections are more resilient
    In Windows PowerShell 3.0 CTP1, connections can survive short-term network failures; the client-server connection is not severed at the first sign of trouble. If network problems persist, the client is safely disconnected and can reconnect by using the Connect-PSSession or Receive-PSSession cmdlets.

Windows PowerShell Web Service

Windows PowerShell Web Service enables an administrator to expose a set of PowerShell cmdlets as a RESTful web endpoint accessible via the Open Data Protocol (OData). This provides remote access to invoke cmdlets from both Windows and non-Windows clients.

You can get more Information about the Windows Management Framework 3.0 Community Technology Preview on the Windows PowerShell Team Blog.

Hyper-V: “Version 3 kills them all”

Windows Server 8 Server Manager Dashboard

Microsoft showed the latest version of Hyper-V at build conference together with Windows 8 and Windows Server 8. Microsoft showed a lot of new Hyper-V features which turn Hyper-V in really powerful hypervisor.

Some days ago I posted a blog post about new features which Microsoft showed before the build conference, now it’s time to extend the list of new features. There are a lot of even more powerful features than the once I posted back then.

Windows Server 8 as Cloud OS

First let’s start with Windows Server 8 as the base of Microsoft Cloud strategy. Microsofts focus in Windows Server 8 was to make it easy for all to build public and private cloud solutions. There are a lot of improvements to manageability, security, scalability, extensibility, predictability and reliability which will also improve the possibilities with Hyper-V. In technical terms Microsoft made a lot of improvements how you can manage a lot of servers and services, Storage, Networking and Powershell. Of course there is a lot more, but this are the parts I think are the most important. And here are some keywords to the improvements in Windows Server 8:

  • Storage improvements – SMB 2.2, SMB transparent Failover, Data deduplication, Storage Spaces, online filesystem repairs, 64TB NTFS volume etc.
  • NIC Teaming
  • Powershell v3 – You can now just do everything in Powershell and even more with 23000 PowerShell cmdlets.
  • Server Dashboard – The new Dashboard lets you manage all servers, or even better, all Services from one place.
  • Multi-tenant – everything seems to be made for that
  • Performance Counters

Windows Server 8 Hyper-V Manager

Hyper-V Host improvements

Hyper-V gets not only a lot of improvements to Virtual Machine, also the Hyper-V Hosts get some new limit improvements.

  • up to 160 logical CPUs
  • supports up to 2TB RAM
  • no more vCPU:pCPU ration limit

Hyper-V Virtual Machine improvements

Microsoft did a lot to extend the existing Virtual Machine hardware to support even high workload Virtual Machines. I will not write a lot about this because the facts here will tell more that a lot of words.

  • VHDX Format – supports up to 64TB Virtual Disks
  • 32 CPUs per VM
  • 512GB RAM per VM
  • Support for Fibre Channel Adapters
  • Supporting Virtual Active Directory Servers

Hyper-V Networking improvements

Hyper-V got a lot of improvements in terms of networking. Microsoft realized that networking features are really important if you start to create private and public cloud scenarios and now even create a mix of public and private cloud scenarios without creating a lot of work for the IT teams to reconfigure Virtual Machines.

  • QoS and flexible bandwidth allocation
  • Support for SR-IOV (Direct Access to the physical Network adapter)
  • Network Virtualization
  • PVLAN support
  • Dynamic Virtual Machine Queue (D-VMQ)
  • Receive Side Coalescing (RSC)
  • DHCP Guard
  • Extensible virtual switch
  • IPsec Task offload

Hyper-V Clustering improvements

Hyper-V gets also a lot of Cluster improvements. But you have to be aware that Clusters are for really high availability and this adds a lot of costs to projects and solutions. Microsoft is working on Cloud solutions which will give great availability to low cost. For example Hyper-V Replica or Live Migration to another host over the Ethernet without the need for a shared storage. But if you need real HA you will need the Failover Cluster.

  • supporting up to 4000 VMs per cluster
  • supporting up to 64 Cluster nodes
  • improved Cluster Manager Console
  • VM Monitoring – Application health detection inside the virtual machine
  • New Placement policies – Virtual Machine Priority and enhanced placement
  • Storage Live Migration
  • Hyper-V Replica supporting clustering
  • No need for Block Storage – you can use SMB Shares
  • Support for Storage Spaces
  • Automated Node Draining – like Maintenance mode in SCVMM
  • Cluster Aware Updating (CAU)
  • Cluster Shared Volume Improvements – BitLocker support, a lot of performance improvements, Self-Healing
  • Live Migration Queing
  • Migrate multiple Virtual Machine at the same time

Windows Server 8 Hyper-V VM Move

Hyper-V Storage improvements

A I mentioned earlier Microsoft made a lot of improvements in terms of storage in Windows Server 8 and Hyper-V can take advantage of those which are quiet impressive. For example with the new features in SMB 2.2 you can now use SMB file shares to store your Virtual Machines.

  • VHDX
  • ODX
  • RDMA
  • SMB 2.2 – Transparent Failover
  • 4K native disk support
  • Data Deduplication
  • Virtual Fiber Channel
  • VM boot from SAN

Hyper-V Management Improvements

As everywhere in Windows Server 8 PowerShell is the key. And the new Server Manager Dashboard Microsoft enable to create Server Groups to manage multiple servers from a single console.

  • Powershell for Hyper-V
  • Powershell Workflows – Commands and Tasks across servers
  • Hyper-V Extensible Switch – lets vendors to create “plugins”. Could be very interesting for Cisco UCS installations.
  • Server Manager Dashboard – lets you manage multiple Hyper-V host from a single console.
  • SCVMM 2012 – not a part of Windows Server 8 but will add great management solutions

Windows Server 8 Hyper-V Powershell

Hyper-V HA and Data Protection

Now I think this is maybe the greatest new feature. You can now live migrate a Virtual Machine from one Hyper-V Host to another without Shared Storage or Cluster configuration. And with this option Microsoft also included a new feature called Hyper-V Replica which includes the option to replicate Virtual Machine to another host which can be hosted in the same network or even in the cloud.

  • Live Migration
  • Live Storage Migration
  • Live Migration to another Hosts (Not clustered) over the Ethernet
  • Hyper-V Replica – Replicated Virtual Machines to another Hyper-V host on-premise or public cloud
  • BitLocker support for CSV

This are not all of the new features Windows Server 8 Hyper-V has to offer but I tried to list the important ones. And if Microsoft sticks with their licensing model, it will be a really strong competitor to the VMWare vShpere 5.

 

SCVMM Snapshot Reminder with Powershell

Hyper-V

I have created a small Powershell Script which will you remind of existing VM Snapshots. You can use this and create a scheduled task for example each morning and it will send you an email with all existing VM snapshots or checkpoints. The Script uses the Powershell Commands of System Center Virtual Machine Manager 2008 R2 but should also work with System Center Virtual Machine Manager 2012.


# Check for Virtual Machine Manager Snapin
$PSSnapin = Get-PSSnapin | Where-Object { $_.Name -eq "Microsoft.SystemCenter.VirtualMachineManager" }
if($PSSnapin -eq $null)
{
	Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager
}

# Connect to SCVMM Server
Get-VMMServer localhost

# Get Snapshots
$snapshots = Get-VMCheckpoint

# Check for existing Snapshots
if ($snapshots.count -gt 0){
	
	# Create the List of Snapshots
	$info = $snapshots | Format-Table VM, AddedTime, Name -auto | Out-String 

	# Mail Configuration
	# ==================

 	# Configuration
	$emailFrom = "user@mydomain.com"
 	$emailTo = "user@yourdomain.com"
 	$emailSubject = "VM Snapshot Reminder"
 	$emailMessage = "You have still some snapshots: `n `n" + $info + "`n Greetings your SCVMM Server"
 	$smtpServer = "mail.server.com"
 	$smtpUserName = "username" # This could be also in e-mail address format
 	$smtpPassword = "password"
	$smtpDomain = ""
 
	# SMTP Object
	$smtp = New-Object System.Net.Mail.SmtpClient($smtpServer)
	$mailCredentials = New-Object System.Net.NetworkCredential  
 	$mailCredentials.Domain = $smtpDomain
 	$mailCredentials.UserName = $smtpUserName
 	$mailCredentials.Password = $smtpPassword
 	$smtp.Credentials = $mailCredentials  
 
 	# Send E-Mail
 	$smtp.Send($emailFrom, $emailTo, $emailSubject, $emailMessage)
 }