Last updated by at .

  • Microsoft Azure
  • Virtual Machine Manager

Tag: VM

WAP Register SPF

Windows Azure Pack – Virtual Machine Cloud

One of the big features of Windows Azure Pack right now is the integration of a Infrastructure as a Service offering or in other words Virtual Machine Cloud. VM Cloud allows you to integrate your existing System Center Virtual Machine Manager 2012 R2 and Hyper-V environment over SPF (Service Provider Foundation) API, so you can create a offering similar to the Windows Azure IaaS experience.

I had the chance working on several Windows Azure Pack projects where we have integrated the Virtual Machine Cloud and created offerings for service providers as well as for enterprise companies for internal use. Two parts of I really like about the solution in the integration of Hyper-V Network Virtualization and the integration of VM Roles, which are basically a solution to deploy services instead of just Virtual Machines. Microsoft also finally fixed the issue we had in App Controller and other products to connect to a Virtual Machine via the Hyper-V Console from outside your organization by using a Remote Desktop Gateway.

Architecture

To deploy the VM Cloud or IaaS offering in Windows Azure Pack you need several roles, services and components. If you want to know more about the Windows Azure Pack Architecture, check out the following blog post.

Windows Azure Pack VM Cloud Architecture

Picture Source: TechNet

  • Hyper-V – You need a Hyper-V environment for hosting virtual machines.
  • System Center Virtual Machine Manager – In a VM Cloud environment you need your Hyper-V resources to connect to a Virtual Machine Manager. You can connect multiple Virtual Machine Manager servers so called VMM stamps. If you are using Hyper-V Network Virtualization (NVGRE) make sure you build a highly available VMM Cluster for each stamp.
  • Service Provider Foundation – To bring those VMM stamps inside Windows Azure Pack you need an API solution called Service Provider Foundation. Every VMM stamp has to be registered in Windows Azure Pack trough a Service Provider Foundation Endpoint.
  • Windows Azure Pack Tenant Portal – The Portal for tenants/customers to manage Virtual Machines
  • Windows Azure Pack Admin Portal – The Portal for Administrator to register new VMM stamps and create offerings for customers.
  • Service Management API – You always need this if you deploy Windows Azure Pack.
  • SQL Server – SQL Server for Windows Azure Pack, SPF and Virtual Machine Manager
  • RD Gateway – Remote Desktop Gateway for the Console Connection to the Virtual Machine
  • System Center Operations Manager – If you just want to monitor your VM environment or you want to do chargeback you need Operations Manager and Service Reporting.

How to setup VM Cloud in Windows Azure Pack

After you have setup your environment you have to register your Service Provider Foundation and VMM in Windows Azure Pack. Enter the address of the SPF Endpoint and the address of the VMM Server.

WAP Register SPF

You can than add VMM servers or VMM Stamps to the Windows Azure Pack.

VMMStamp in WAP

You can now select the Cloud you want to use for your offering. If you create a new plan you can select which VMM stamp and cloud should be used for the offering. You can limit resources like Virtual Machine count, CPU cores, RAM, Storage, VM Networks, Templates and more inside plans and add-ons. You can than offer these plans and add-ons to your customers.

WAP VM Cloud Plan

As another part you can extend the solution by adding a SMA Web Service endpoint to the Windows Azure Pack and configure it for the Virtual Machine Clouds. With this solution you can link SMA Runbooks to actions in Windows Azure Pack VM Cloud, SPF and Virtual Machine Manager.

WAP Link SMA Runbook to VMM Action

If you need to enable Console access to the Virtual Machine to the tenant users, you also have to register a Remote Desktop Gateway. This will allow user to access the Virtual Machine without having a IP address set inside the VM.

Tenant VM Console Access WAP

Remember there are much more steps you have to do. For example configuring the fabric in System Center Virtual Machine Manager or configuring the Remote Desktop Gateway to have access to the Hyper-V hosts. And if you are doing NVGRE (Hyper-V Network Virtualization) you may also want to have NVGRE Gateways in place so customers can leave the Virtual Network and connect to the physical network or the internet. So setting this thing up is one part but having it designed and configured the right way is another.



Export Templates from Virtual Machine Manager Settings

Export and Import Virtual Machine Manager Templates

If you are working with System Center Virtual Machine Manager and you want to export and import your existing VM or Service Templates. I have a customer scenario where we have two VMM installations. They are using System Center Virtual Machine Manager, Orchestrator, Serivce Manager to deploy new customer environments for their premium SaaS (Software as a Service) hosting solution where they deploy Lync, Exchange and SharePoint fully automated. Here we have a development environment where they test new System Center Orchestrator Runbooks and new Templates in Virtual Machine Manager. After they have a working RunBook with working Templates they export the templates from the dev VMM and import them in the production environment.
Because I was surprise how great this works and I think not a lot of people know about this feature, I created this short step-by-step guide.

Export Templates from Virtual Machine Manager

First select the Templates you want to export and click on the Export button on the Ribbon bar. You can also do a multiple select to export multiple templates.

Export Templates from Virtual Machine Manager

You can than configure the export, with a location, password.

Export Templates from Virtual Machine Manager Settings

 

You can also select what physical resources which should be exported with the template. For example if you are using the same VHD or VHDX for multiple templates you may want to export this resource only once to save some space.

Export Templates from Virtual Machine Manager physical resources

The export will look kind of like this. The XML files are the templates with the configurations, and in the folders are the physical resources like VHDs, XMLs or other stuff.

Exported Templates from Virtual Machine Manager

Import Templates in Virtual Machine Manager

To import a template just select the exported XML file.

Import Templates in Virtual Machine Manager

You can change or setup the resource of the template, for example you can select an already existing VHD from your Library or an already existing Run As account.

Import Templates in Virtual Machine Manager resources

And you can set the location for the new imported resources (VHDs,…)

Import Templates in Virtual Machine Manager resource location

I hope this shows you how easy an export and import of a Service or VM Template from System Center Virtual Machine Manager is. I like especially how SCVMM handles the additional resources, so you don’t have to import the same VHD every time and you can change Run As accounts very easily.

 

 



Windows Server 2012 Hyper-V: Configure VM Processor Compatibility via PowerShell

Windows Server 2012 Logo

If you have a mixed Hyper-V environment with Hyper-V hosts which have different CPU generations you may cannot live migration Virtual Machines from one Hyper-V host to another without setting the VM CPU Compatibility setting.

Note: I saw a lot of different environments where different generation of Intel CPUs were used, and most of the time Live Migration did still work. I would recommend to set this setting only if you really need it.

Hyper-V VM Processor Compatibility

If you need to do this for multiple Virtual Machines you may better use Windows PowerShell to do this.

To do this you can use the new Hyper-V PowerShell module and the Get-VMProcessor and Set-VMProcessor cmdlet. With the Get-VMProcessor cmdlet you can get information about the virtual CPU of VMs. You can list this for all virtual machines running on one host by using the following command

Hyper-V Get-VMProcessor

To change this setting for all virtual machines running on the Hyper-V host you can use the following PowerShell command. This does only working with virtual machines which are not running.

Hyper-V Set-VMProcessor

If you want to shut down all the VMs first you can use the following command.

If you just want to do this for a single VM you can use the following commands.

Hyper-V Set-VMProcessor Single VM

To do a full automation you could do it the following way:

As you can see you can also find the “CompatibilityForOlderOperatingSystemsEnabled” property to enable Processor Compatibility for legacy Operating Systems in Windows Server 2012 Hyper-V for example Windows NT 4.0 Server or Windows 2000.



Basic Hyper-V Networking in 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).

In January Microsoft released the Service Pack 1 for System Center 2012. This was more close to a full featured release rather than just a normal maintenance Service Pack with just small changes and bug fixes. The main purpose of System Center 2012 Service Pack 1 is to support Windows Server 2012. But in the special case of Virtual Machine Manager there are also a lot of new features and improvements. One of the biggest investments Microsoft made with SP1 was the Network Management.

Besides the integration of Network Virtualization which came with Windows Server 2012 Hyper-V a new concept call “Logical Switch” has been introduced. These Logical Switches allow you to configure the Virtual Switch and other network components of Hyper-V hosts directly and centralized from Virtual Machine Manager.

Network Definitions

Logical Networks – Logical Networks represents basically the network infrastructure you have already in your environment. For example this can be a subnet for a specific server or even a storage network. In System Center 2012 Virtual Machine Manager without Service Pack 1 you connected a virtual machine to a Logical Network to connect it to the specific subnet. In Service Pack 1 the concept has been extended with  VM Networks.

Virtual Machine Manager Logical Network Overview

Network sites – Network sites are added to an Logical Network to associate VLANs and subnets to host groups, which are representing the different locations. For example the “CorpNET” network on “Site A” has a different VLAN or subnet than “Site B” uses for the same network. When deploying a new virtual machine to the “CorpNET” network, Virtual Machine Manager automatically detects the right subnet and also adds (if required) the VLAN ID to the specific virtual machines network adapter.

Logical Network

IP Pools – IP Pools are just a pool of IP addresses which can be used to automatically let Virtual Machine Manager to assign static IP addresses from the selected subnet (example CorpNET) to a virtual machine or a physical Hyper-V host. An IP Pool includes also the information about Gateway or DNS Serves which are automatically used for the network adapter configuration.

IP Pool

VM Networks – VM Networks are defined by logical networks and virtual machines are now connected to VM Networks. This is done because of the new Network Virtualization feature in Windows Server 2012 Hyper-V. With this technology multiple VM networks can run on a single logical network.

SCVMM 2012 SP1 Networking 01

As already mentioned the Logical Network is mapped to a VM Network. This mapping is done because with the new Hyper-V Network Virtualization feature you can run multiple VM Networks on a single Logical network.

SCVMM 2012 SP1 Networking

Extended Virtual Switch

Logical Switch – The new Logical Switch is the main part of the new concept Microsoft introduced in System Center 2012 SP1 Virtual Machine Manager. A Logical Switch combines the different configuration objects used to create a new Hyper-V Virtual Switch in your environment, as for example Virtual Switch Extensions, Uplink Port Profiles and Virtual Adapter Port Profiles mapped to Port Classifications.

Native Virtual Adapter Port Profile – The Virtual Adapter Port Profiles define Virtual network adapter definitions like QoS settings, security settings like router or DHCP guard and performance settings like SR-IOV, IPsec task offloading or Virtual Machine Queue (VMQ). The Virtual Adapter Port Profile settings are not just for Virtual Machines they are also used for Virtual Network Adapters (vNIC) attached to the Hyper-V Management OS in a Converged Network setup.

Native Uplink Port Profile – The Uplink Port Profile sets the definition for the physical adapter like which logical networks are available on these physical adapters, the configuration of the LBFO and if Network Virtualization is being used.

Port Classifications – Port Classifications are mapping with Virtual Adapter Port Profiles based on the logical switch the virtual machine runs on. If a Virtual Machine is moved to a Hyper-V hosts with a different logical switch, the port classification links in the background which Virtual Adapter Port Profile has to be used

Port Classification

How this works together

The Logical Switch defines a Virtual Switch with Extensions

SCVMM 2012 SP1 Logical Switch

The Logical Switch has Native Uplink Port Profiles which add information about the Teaming Configuration, which Logical Networks and Network Sites are available on the physical network adapters and if Network Virtualization is allowed.

SCVMM 2012 SP1 Logical Switch2

The Logical Switch has also a Native Virtual Adapter Port Profiles which matches with a Port Classification on the Logical Switch and defines the Virtual Network Adapter settings for Virtual Machines or in a Converged Environment for the Hyper-V Management OS.

SCVMM 2012 SP1 Logical Switch3

I hope this post gives you some basic understanding about the new networking features which are added in Service Pack 1 for System Center 2012 Virtual Machine Manager.

You can find the German Version of this blog post on Michel Lueschers (Consultant Microsoft Switzerland) blog.



How to make an existing Hyper-V Virtual Machine Highly Available

Windows Server 2012 Logo

If you have a running Hyper-V Virtual Machine with is not part of a cluster you can make this virtual machine highly available via the Failover Cluster Manager. First of all the Virtual Machine has to be stored on a shared storage. In Windows Server 2008 R2 this means the Virtual Machine and the attached Virtual Disks had to be stored on a Cluster Shared Volume (C:\ClusterStorage\…), with Windows Server 2012 the VM could also be stored on a SMB 3.0 file share.

Windows Server 2008 R2 Make Virtual Machine Highly Available

And there is also a big difference in Windows Server 2008 R2 Hyper-V and in Windows Server 2012 Hyper-V. In Windows Server 2008 R2 the Virtual Machine had to be offline during you add the VM to the Cluster, and in Windows Server 2012 you can do this online.

First open the Failover Cluster Manager and right click on your Cluster Name in the menu select “Configure Role”

Windows Server 2012 Failover Cluster Manager Configure Role

This started the High Availability Wizard. First select the role you want to make high available, in the Hyper-V case this is “Virtual Machine”.

Windows Server 2012 Failover Cluster Manager High Availability Wizard

Now select the Virtual Machine you want to add to the cluster. Note: In Windows Server 2012 the Virtual Machine can be online, in Windows Server 2008 R2 the Virtual Machine had to be offline.

Select Virtual MachineAfter clicking next on the wizard, you the VMs will be added to the Failover Cluster.

Btw. thanks to Philipp Witschi (itnetx), who I now owe a dinner.

 



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

 

Enable-VMResourceMetering

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

Measure-VM

To get the network traffic use the properties of the 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 measure-vm

Of course you can reset the statistics for the VM.

reset-vmresourcemetering

And to disable resource metering for the VM use:

 

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.



First Patch Tuesday with Windows Server 2012 Hyper-V Patches – New version of Hyper-V Integration Services

Hyper-V Integration Services Upgrade

Yesterday Microsoft released some patches for Windows Server 2012 and Windows 8. In this wave Microsoft also included some fixes for Hyper-V and also updated the Integration Services to a new version.

Old Hyper-V Integration Services Version: 6.2.9200.16384
New Hyper-V Integration Services Version: 6.2.9200.16433

To check which version is installed in your virtual machine you can use Windows PowerShell: Get Integration Services Version of Windows Server 2012 Hyper-V Virtual Machines.

So if you are running Windows Server 2008 R2 SP1 virtual machines or later don’t forget to update your Hyper-V Integration Services on those virtual machines. If you are running Windows Server 2012 virtual machines you can normally patch those via Windows Update or WSUS to get the latest Hyper-V integration services.

If you run Windows Server 2012 Cluster Aware-Updating you can us the Self-Service update feature to patch your Hyper-V Cluster automatically.