Reading Windows Server 2016 Hyper-V Configuration Files

By now a lot of you will have heard that in Windows Server  2016 virtual machines have a new configuration file format. The new configuration files use the .VMCX file extension for virtual machine configuration data and the .VMRS file extension for runtime state data.  These are binary, so no more xml and VSV/BIN files.

image

The new format was designed with a couple of goals in mind:

  • Increase the efficiency of reading and writing virtual machine configuration data.When you start scaling to thousands, tens of thousands and more VMs the overhead of parsing XML begins to weigh on performance.
  • Reduce the potential for data corruption in the event of a storage failure. It has logging included. So after making the virtual hard disks (thanks to VHDX introduced in Windows Server 2012) more resilient to corruption the configuration files have followed.
  • Perhaps the reason with the least emphasis but it also prevents us from mucking around in the XML files. Yes we didn’t just read them. We edited them, we “experimented”, we copied them and fix the security settings … all god when you accept the big boys rule of ”it’s your responsibility and not supported” but I’m afraid Microsoft support got a fair share of calls related to this.

Note: With PowerShell & Compare-VM we can still correct inconsistencies on a file. That’s what Compare-VM is all about => getting the info you need to correct issues so you can register or import a virtual machine.

Let’s take a peak under the hood at a VMCX file. As you can see it’s not human readable.

image

I’m fine with that as long as I have the tools I need to get the information I need. The Hyper-V Manager GUI is one of those tools. But it doesn’t always show me everything I might need. An example of this is when things have gone wrong and I need to manually merge snapshots. There is valuable information in the VHDX/AVHDX configuration in the virtual machine configuration that gives me clues and pointers as what to do.

image

So how do I deal with reading Windows Server 2016 Hyper-V configuration files now? It was one of my first questions to the Product Group actually. The answer I got from Ben Armstrong was: PowerShell and Compare-VM.  He has a blog post on this here.

The gist is that we create a temp VM object using Compare-VM en get the configuration information out that way.

$TempVM = (Compare-VM -Copy -Path $VMConfig -GenerateNewID).VM

$TempVM | select *

In my example I used a VM with some checkpoints and as you can see we can get the information on the parent checkpoint name (“HELLO”) and everything else we desire.

image

image

By querying the $TempVM a bit more we get the hard drive info and see which is the current AVHDX we’re running on. image

Hope this gives you some pointers.

Production Checkpoints in Windows Server 2016

We’ve  had snapshots, or better checkpoints as we call them now for consistency amongst products, for a longest time in Hyper-V. I have always liked and used them to my benefit. That’s what they are intended for. But you have to use them correctly, in a supported and smart manner. Some (or perhaps not an insignificant number of) people did not read the manual and/or do not test their assumptions before trying something in production. Some times that leads to a lesson, sometimes it leads to tears.

We now have the choice between two type of checkpoints: Production Checkpoints and Standard Checkpoints.

A standard virtual machine checkpoint all the memory state of running applications get stored and when you apply the checkpoint it’s back magically. Doing this to a production SQL or Exchange Server for example causes (huge) problems. With some applications these problems are minor or transient but it’s not a healthy consistent state to be in, and recovery has to happen. Which could  happen automatically or require disaster recovery depending on the situation at hand.

Production checkpoints are made in application consistent manner. For this the leverage Volume Shadow Copy Services (or File System Freeze on Linux) which puts the virtual machines into a safe state to create a checkpoint that can be restored like a VSS based, application consistent backup or SAN snapshot. This does mean that applying a production checkpoint requires the restored virtual machine to boot from an off line state, just like with a restored backup.

The choice for what type of checkpoint can be made on a per virtual machine basis which make it’s flexible as you can pick the best option for a particular virtual machine for a specific purpose. As you might have guessed, that still requires some insight, reading the manual and testing your assumptions. But you now can have the behavior you want and way to many assumed to have.

image

We also have the option of allowing or disallowing for a standard checkpoint to me made if for any reason (which results in the VSS snapshot in Windows or file systems freeze in Linux  in the guest might not work or are not available) a production checkpoint cannot be made. Here’s the table of what type of checkpoint can be used when from MSDN. I conclude that the chosen default is the best fitting one for most scenarios.

image

You also have the option of choosing the standard checkpoints for a virtual machine. That gives you the exact behavior as with all previous versions of Hyper-V.

I love the GUI for ad hoc work but when I need to do this on dozens or hundreds of virtual machines or potentially tens of thousands when running a larger private cloud this is not the way to go. PowerShell is you long time trusted friend here!

image

As you can see just the “-CheckpointType” parameter you control the check pointing behavior. And as it is very easy to grab all virtual machines on a host or cluster setting this for all or a selection of your virtual machines is easy and fast. Let’s set it to “ProductionOnly” and grab the setting for that VM via PowerShell

image

When you create a checkpoint of a Windows Server 2016 Hyper-V host you’ll even get a nice notification (you can turn it off) by default that the Production checkpoint used backup technology in the guest operating system.

image

It’s also important to realize that this capability is the basis of the new checkpoint based way of making backups in Windows Server 2016 as well. But that’s a subject for another blog post. Thank you for reading!

RemoteFX and vGPU Improvements in Windows Server 2016 Hyper-V

UPDATE 2015/11/23: RemoteFX works in Windows Server 2016 TPv4 and I’m successfully running OpenGL in a server VM with W2K16Tpv4 and a W2K16TPv4 host!

image

Let’s take a look at some of the RemoteFX and vGPU Improvements in Windows Server 2016 Hyper-V. For me the abilities they are adding in this release are significant and a break through. Why? They are talking away many of the last show stoppers for a number of scenarios that are important to the ecosystems I roam around in, when the CxO have a clue that is.

What are we looking at that’s new for Windows Server 2016?

The things that are breaking down the biggest showstoppers are:

  • OpenGL & OpenCL API Support (FINALLY!)
  • 1GB dedicated VRAM
  • 4K Resolution
  • Serverv VM Suppport (very important in our GIS environment actually) Generation 2 VM Support (YES!)
  • Improved performance
  • H.264/AVC codec investment

Now, I missed this initially but it was announced at Microsoft Ignite 2015 that RemoteFX will support generation 2 virtual machines and it allows us to still benefit form the future of virtual machines without losing RemoteFX. Until now generation 2 virtual machines were no compatible with RemoteFX.This was due to the Generation 2 virtual machines not having an emulated PCI bus, which RemoteFX needs until WIndows Server 2012 R2 and Windows 8.1.

Generation 2 support combined with Server support in the virtual machine and OpenGL (ip to 4.4) /OpenCL (up to 1.1)  is a breakthrough, let’s hope the versions supported don’t spoil the party. I wonder if they can come up with a mechanism to upgrade support if OpenGL for newer versions that are released. But application compatibility was very limiting.

This is really great news and will make Hyper-V a far better candidate for many more scenarios than ever before.

Get your test rig set up

So it’s time to upgrade the lab server with a RemoteFX capable GPU to Windows Server 2016 TPv3 and test this.

I think some of our GIS engineers will be very happy with these new capabilities for ESRI Arc GIS, Adobe, AutoCAD, … and many more less well know specialty software they need.

If you want to test it out here’s the Experience guide for Enabling OpenGL Support for vGPU in Server 2016

image
So we set it all up but unfortunately there is still an issue being worked out at the moment of writing.

image

But I will help you get started for when it’s fixed.  Which I hope will be soon! To me it looks like they “just forgot” to activate RemoteFX for server as it look a lot like a Windows Server 2012 R2 VM where one tries to add a RemoteFX card, it just doesn’t work. Sale host with Windows 10 Enterprise does not have this issue …

image

 

So why not test with Windows 10? Well the OpenGL/CL capabilities are server only. And those are important to us!

Putting Windows Server 2016 TPv3 To The Test

I’ve dedicated some time to start investigating the new and improved feature and capabilities ever since Technical Preview 1 (TPv1). We kept going with TPv2 and now TPV3. The proving grounds for putting Windows Server 2016 TPv3 to the test are up and running.image

As usual I’ll be sharing some of the results and finding.  I only use the public Technical Previews for this so this means that it’s public information you can read about and go test  or find out about yourself.

So far things are going quite well. I’m learing a lot. Sure, I’m also hitting some issues left and right but on the whole Windows Server 2016 is giving me good vibes.

Expertise, insights, knowledge and experience is hard won. It’s never free. So I test what I need to find out about, find interesting or think what will be valuable in the future. Asking for me to go and test things for you on demand isn’t really going to work. I have bills to pay and cannot spend time, effort & resources on all of the numerous roles and features available to us in this release. Trust me I get enough offer to work for free or peanuts from both strangers and employers, so, thanks for the offers but I need no more 😉