Home » Hyper-V

Category Archives: Hyper-V

Where am I? HELP!

My colleague created a virtual machine for me in our datacentre a few weeks ago.  (Thanks Michael!)  Earlier this week I needed to create a second virtual machine to cluster with it, and I felt that the best way to maximize my resources completely would be to create another virtual machine identical to the first.  Okay, all I had to do was pop open the Settings window for the virtual machine and copy it.

We have 25 physical host servers in the lab environment in question, and no Virtual Machine Manager.  Crap.

I could, if I had to, connect to each host one by one looking for the virtual machine in question, but that would be a waste of time… not to mention that as a one-off solution it could work, but it is a bad habit to get into.  I needed a better solution.

If you ever find yourself in the position, here’s a tip: As long as you have the Integration Services installed, there is a registry key in the virtual machine that gives me my answer.  So open Regedit and navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters

See? There it is, right there in black and white.  In fact, it’s there three times – under HostName, PhysicalHostName, and PhysicalHostNameFullyQualified.   I no longer need a map, I no longer need to go looking by hand.

But Mitch, isn’t there a way to do this in PowerShell?

I’m glad you asked.  Sure, here it is:

(Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).PhysicalHostName

Of course, if you are a stickler about it, you can change the last bit to PhysicalHostNameFullyQualified, but that’s up to you.

Now that you know where you are… keep going!

New (and Free!) E-Books

Last month I posted an updated list of free ebooks that Microsoft Press offers (Free E-Books… Way beyond PDF Files!) which was extremely well received.  Well today I was given information that MS Press released two new ebooks this month, both of which are extremely of interest to a lot of my readers.

Microsoft System Center Deploying Hyper-V with Software-Defined Storage & Networking

Microsoft System Center Software Update Management Field Experience

You can download one or both of them from here.  They are not yet available on Kobo.com but I hope that will change soon!

Converting Fixed Size VHDs to Dynamic Sized VHDs

I was called in to help a company recently with a small Hyper-V environment.  They created a 2TB VHD file (they had good reasons for not using .vhdx files, but the steps in this article will work for both versions). 

They realized that they had unnecessarily created the drive as a 2TB Fixed Size disk rather than a Dynamically Expanding disk.  While there are no real performance differences between the two in Server 2012 R2, when it comes to portability, the dynamically expanding drives have a huge advantage.  When they realized that they were planning for a SAN upgrade, the IT Administrator decided to take the preemptive step of converting the disk.

It’s actually pretty easy… In the Hyper-V menu you click on Edit Disk…, and when the Edit Virtual Hard Disk Wizard comes up you go through the steps of selecting the appropriate file, and on the Choose Action screen select the radio button Convert.  On the next screen you specify the destination file, which eventually is where the problem is going to lie.  But for now you enter the filename, click Next, then click Finish to begin the process.

For those of you who are PowerShell fans, you can accomplish the same task by running the following cmdlet:

Convert-VHD D:\Hyper-V\HardDisk.vhdx -DestinationPath D:\Hyper-V\NewHardDisk.vhdx -VHDType Dynamic

Great.  Now you go into the settings of your virtual machine, point it to the new file, and boot it up.

Microsoft Emulated IDE Controller (Instance ID
{83F8638B-8DCA-4152-9EDA-2CA8B33039B4}): Failed to Power on with Error ‘General access denied error’
IDE/ATAPI Account does not have sufficient privilege to open attachment
‘D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’
Account does not have sufficient privilege to open attachment
‘D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’

Un-oh.  That doesn’t look good.  I click on the option to see the details, and it expands to the following:

‘VMName’ failed to start. (Virtual machine ID
‘VMName’ Microsoft Emulated IDE Controller (Instance ID
{83F8638B-8DCA-4152-9EDA-2CA8B33039B4}): Failed to Power on with Error ‘General access denied error’ (0x80070005). (Virtual machine ID
‘VMName’: IDE/ATAPI Account does not have sufficient privilege to open attachment D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’ (0x80070005). (Virtual Machine ID 1DC704C1-6075-4F6C-B364-AFE4947304F3)
‘VMName’: Account does not have sufficient privilege to open attachment
D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’ (0x80070005). (Virtual Machine ID 1DC704C1-6075-4F6C-B364-AFE4947304F3)

Alright, it looks like I have a file permission error.  When I look at the Security tab on the Properties window of the source VHD file I see the following:


Great… all I have to do is add that user (group?) to the new VHD file, and I’ll be set.  The problem is… how the heck do I do that?  I certainly can’t do it from the GUI… No problem. 

  1. Open a Command Prompt with Administrator credentials.
  2. type the following command: icacls “D:\Hyper-V\NewHardDisk.vhd” /grant “NT Virtual Machine\1DC704C1-6075-4F6C-B364-AFE4947304F3”:F
  3. The response should read:

processed file: D:\Hyper-V\NewHardDisk.vhd
Successfully processed 1 files; Failed processing 0 files

If this is what you got, then you are ready.  You should now be able to start up your virtual machine without error.

Good luck… now go forth and virtualize!

Hyper-V 2008 R2: Still good enough?

I manage a vSphere environment at work, and it is a real change from the last few years when I spent all of my time talking about Hyper-V.  I want to be clear – it is not better or worse, it is just… different.  We have a number of virtualization hosts, plus a physical domain controller, and one physical server running Windows Server 2008 R2 (Enterprise), which has an app running that precludes us from changing that.  The app hardly uses any memory, so a lot of that was wasted.

While my physical server does not have a lot of RAM (8GB) it has a ridiculous amount of internal storage… I mean terabytes and terabytes of it.  I asked my boss about it, and he said it was there for something that they no longer use the server for… but it’s there… wasted as well… for now.

A few weeks ago I proposed a project that would require use of that space, and it was tentatively approved.  The problem is that the existing application and the proposed application are not supposed to co-exist on the same server.  I would have to come up with a way to segregate them.  No problem… I would install the Hyper-V role onto the physical server, and then create a new virtual machine for my purposes.

Once I explained to my boss that no extra licensing was required – because the physical server is licensed for Windows Server 2008 R2 Enterprise Edition, we could build as many as four virtual machines on the same license on that host – he got excited, and asked the usual ‘what else can we do?’ questions.

‘Can we cluster the virtual machine?’

No.  I mean, we could, but it would require having a second Hyper-V host which we do not have.  There is nothing we can do about that without incurring extra costs… and the purpose of the exercise is to do it for zero dollars.

‘Can we use Storage Spaces?’

No.  Storage Spaces is a great technology – one that I really loved talking about when I was working with Microsoft.  However it is a feature that was only introduced in Windows Server 2012, and we are only on Server 2008 R2.

‘Can we create the VM using 64TB .vhdx drives?’

No.  Again, .VHDX files were only introduced in Windows Server 2012.  We are limited to 2TB .VHD files… which is more than enough for our actual needs anyways.

‘How about UEFI Boot on the VM’

Nope.  Generation 2 hardware was introduced in Windows Server 2012 R2, so we are stuck with Generation 1 hardware.

So after he struck out on all of these questions, he asked me the question I was expecting… ‘Then why bother?’

I became a fan of Hyper-V as soon as it was released in Windows Server 2008.  Yes, the original.  I was not under any delusions that it was as good as or better than ESX, but it was free and it didn’t require anything to install… and if you knew Windows then you didn’t need to learn much more to manage it.

Of course it got much better in Windows Server 2008 R2, and even better in the SP1 release… and then in Windows Server 2012 it broke through, and was (in my opinion) as good as or better than vSphere… in some ways it was almost as good, in some ways it was better, and in the balance it came out even. Of course Server 2012 R2 made even better improvements, but when I spent three years with Microsoft Canada – first as a Virtual Partner Technology Advisor and then as a Virtual Evangelist – criss-crossing the country (and the US and the globe) evangelizing Hyper-V in Windows Server 2012 I was confident when I said that at last Microsoft Virtualization was on a par with VMware.

I would never have said that about Hyper-V in Windows Server 2008 R2. Sorry Microsoft, it was good… but vSphere was better.

However in this case we are not comparing Microsoft versus VMware… we are not deciding which platform to implement, because VMware is not an option. We are not even comparing the features of vOld versus vNew… because vNew is still not an option.

All we are deciding is this: Does the version of Hyper-V that is available to us for this project good enough for what our needs are for the project? Let’s review:

  • We need to create a virtual machine with 4GB of RAM. YES.
  • We need that VM to support up to 4TB of storage. YES. (We cannot do it on a single volume, but that is not a requirement)
  • We need the VM to be able to join a domain with FFL and DFL of Windows Server 2008 R2. YES.
  • We need the virtual machine to be backed up on a nightly basis using the tools available to us. YES

That’s it… we have no other requirements. All of our project needs are met by Hyper-V on Windows Server 2008 R2. Yes, Microsoft would love for us to pay to upgrade the host operating system, but they got their money for this server when we bought the license in 2011, and unless they are willing to give us a free upgrade (there is no Software Assurance on the existing license) and pay to upgrade the existing application to work on Server 2012R2 then there is nothing that we can do for them… and frankly if we were in the position where we were going to have to redeploy the whole server, it would be on VMware anyways, because that is what our virtualization environment runs on.

I spent two years evangelizing the benefits of a hybrid virtualization environment, and how well it can be managed with System Center 2012 R2… and that is what we are going to have. I have purchased the System Center licenses and am thrilled that I will be able to manage both my vSphere and my Hyper-V from one console… and for those of you who were paying attention that is what I spent the last three years recommending.

I can hold my head up high because I am running my environment exactly how I recommended all of you run yours… so many of my audience complained (when I was with Microsoft) that my solutions were not real-world because the real world was not exclusively Microsoft. That was never what I was recommending… I was recommending that the world does not need to be entirely VMware either… the two can coexist very well… with a little bit of knowledge and understanding!

Surface Pro 3: Two weeks later

Are there problems with it?  Yes.

Do I absolutely love it? I love my kids and my dogs… but I suppose I do like it as much as I have ever liked a laptop or tablet… and I have had quite a few of them over the years!

What are the problems? There is really only one that you should be aware of if you are thinking of going out to buy one.  It’s the patches and the battery.

How, you may ask, do patches and batteries wind their way into a single problem?  Simple… as you probably know, everything in computers is managed by software drivers… and that includes the battery to some extent.  When you buy the device (or any device) you are prompted to apply patches, and at this point a couple of them for the Surface Pro 3 are firmware updates.  You apply the first one, and then you have a problem…

…Windows tells you there is no battery detected.  Worse, if you unplug the device it shuts off immediately.  The firmware update actually tells the computer that there is no battery installed.

BUT THERE IS! Wait a minute!  I was using it unplugged just a few minutes ago!  Where did it go?  Oh… I get it!  The pesky firmware is what screwed me up.  Let’s check to see if there is ANOTHER firmware update.  Plug it in, connect to the Internet, run Windows Update… By Jove, there it is!  Install it, and presto changeo, there’s my battery!

…and what a battery it is!  My original Surface Pro probably gave me 3 hours of battery (with Hyper-V and a bunch of other things draining it).  The Surface Pro 2 was probably closer to 5.  The Pro 3? I haven’t had it run dry on me yet… for the first time in my laptop-owning life I am not afraid to leave the house in the morning without the charger.

(Imagine the voice of Hervé Villechaize if you would…)

Yes, there are a lot of improvements over the Surface Pro 2, but wow I never would have imaginged that the 1.4″ difference in screen size (12″ over 10.6″) would make that much of a difference.  As I told you recently I have an external 16″ screen that I keep in the trunk of my car so that I can have the dual screen experience on the go.  I don’t know that I have pulled it out once since I got the Pro 3… the combination of the slightly bigger screen and the much improved screen resolution make the extra screen redundant… at least when I am on the go.

Don’t get me wrong… the day the Pro 3 docking station is available I am buying it – I have pre-ordered it from the Microsoft Store, and I have the voucher for it (from something else I returned).  All I need is the e-mail saying it is in… and I expect that to be around the same time the remaining Surface Pro 3 models (with the Intel i3 and i7 CPUs) are released, sometime in August.  When I am at home (or an office) I will still want the multi-screen experience.  On the go?  Not necessary anymore.

A lot of people are saying I should have waited for the Intel i7 version, but the reality is I have not found myself lacking.  The Surface Pro 3 runs everything I need it to with 8GB of RAM and the Intel Core i5 CPU, and frankly I don’t want to spend the extra money (the i7 version will come in two models – 256GB storage for $1,599, and the 512GB model for $1,999.  Too rich for my blood, but thanks!


I am asked pretty often (including 3 minutes ago, as I sit at the Microsoft Store in Square One Mall blogging) whether the Surface Pro 3 is really a laptop replacement.  The answer, as with everything, is that it depends.  I would think that for the vast majority of people the answer is yes.  If you are a true hard-core gamer? Maybe not; there are some gamers who need more than 8gb of RAM.  If you are a coder? I have a friend who is a programmer who needs to run virtual machines running more than 8gb of RAM at all times.  (Did I mention that I LOVE the fact that it runs Hyper-V?  Well I do…). Aside from them?  I don’t know too many users – even power users – who need more than 8gb of RAM ever, not even occasionally.  For them (like myself) I would say that this is the device for you.

If you are in the Greater Toronto Area come down to the Microsoft Store at Square One or Yorkdale Malls to check it out! :)

Standardize your Hosts: Simplify your Life

For several years I have been speaking and writing about desktop deployment to standardize your client system environment.  What about your servers? What about your hypervisors? 

A couple of years ago VMware introduced Host Profiles into vCenter Server which allow you to take all of the settings from one host and then apply them to all of your other hosts.  Nice… but unfortunately it is a feature only of the Enterprise Plus SKU of the product. 

Microsoft has similar functionality with System Center 2012 R2, which is a real godsend for larger organizations.  But what about the smaller companies?  What about companies that have not completely implemented the whole System Center suite of tools?  Are they doomed to having multiple hypervisor configurations?  No… that’s what PowerShell is for!

Super-Shell!Okay, PowerShell is for a lot of things; in fact it is for just about everything, depending on how well you want to use it.  However with the help of my friend and fellow Microsoft MVP Sean Kearney I have put together a list of cmdlets that will do the job for you.

Firstly we should recognize that there are infinitely more settings to configure in VMware vSphere than there are in Microsoft’s Hyper-V; hundreds of settings, any of which can prevent critical functionality from performing properly.  There are certainly issues that need to be properly configured in Hyper-V, but not nearly as many.  With that being said, it is still important to standardize your Hyper-V hosts, if for no other reason than to simplify management, but also to ensure failover readiness and more.

For the purpose of this article I am going to assume a directory on all hosts called c:\Profile.  You can really name the directory anything you like.  In fact none of the file names have to be what I call them, as long as you remember what you use.

Hyper-VOh, and before you ask, this article applies to the full GUI version of Windows… and MinShell… and Server Core… and yes, even Hyper-V Server!

In PowerShell there is a simple cmdlet: Get-VMHost |fl.  This will show you all of the host settings.  The fl gets the full list, instead of the basic information.

If you are simply trying to collect the host settings for the purpose of documentation, you can export this information to a .csv (comma separated value) file that can be read in a text editor or, more importantly, in Microsoft Office Excel.  That cmdlet would be Get-VMHost |Export-CSV c:\Profile\HostSettings.csv.

PowerShellWhile this is helpful for documentation purposes, in order to actually work with the information we are going to export it to a .xml (Extended Markup Language) file.  It will be harder for us to read, but easier for the computer to work with.  The cmdlet to do that is Get-VMHost |Export-CLIXML c:\Profile\HostSettings.xml.

Now that we have collected the information, we can start applying the information to other hosts.  The corollary to any Get- cmdlet in PowerShell is a Set- cmdlet.  However the .xml file has some information in it that we would not want to apply to each host – hostname, for example.  So although we could theoretically apply each setting by hand (set-VMHost <parameter>) I have taken the liberty to write a script that would apply all of the information for you, based on the file we collected earlier:

$info=Import-CLIXML C:\Profile\HostSettings.xml

Set-VMHost -VirtualHardDiskPath $info.VirtualHardDiskPath
Set-VMHost –VirtualMachinePath $info.VirtualMachinePath
Set-VMHost –MacAddressMinimum $info.MacAddressMinimum
Set-VMHost –MacAddressMaximum $info.MacAddressMaximum
Set-VMHost –MaximumStorageMigrations $info.MaximumStorageMigrations
Set-VMHost -UseAnyNetworkForMigration $info.UseAnyNetworkForMigration
Set-VMHost -FibreChannelWwnn $info.FibreChannelWwnn
Set-VMHost -FibreChannelWwpnMaximum $info.FibreChannelWwpnMaximum
Set-VMHost -FibreChannelWwpnMinimum $info.FibreChannelWwpnMinimum
Set-VMHost -ResourceMeteringSaveInterval $info.ResourceMeteringSaveInterval
Set-VMHost -NumaSpanningEnabled $info.NumaSpanningEnabled
Set-VMHost -EnableEnhancedSessionMode $info.EnableEnhancedSessionMode

Let’s look at the format of this script.

1)  $info=Import-CLIXML C:\Profile\HostSettings.xml
What we are doing here is importing the .xml file that we created into a variable called $info.  Each piece of information in the XML file will be called using that variable.

Next let’s look at one of the Set-VMHost lines:

2) Set-VMHost -VirtualHardDiskPath $info.VirtualHardDiskPath
What we are doing here is taking one of the parameters – the default directory for new virtual hard disks – and setting it with the VirtualHardDiskPath parameter from the .xml file… because we imported that file into $info, that sub-variable is expressed as $info.VirtualHardDiskPath.  We will repeat that for each parameter.

So essentially for this script we are running the same cmdlet twelve times with different switches.  Can we put them together into a single line? Sure… it would look like this:

Set-VMHost -VirtualHardDiskPath $info.VirtualHardDiskPath –VirtualMachinePath $info.VirtualMachinePath –MacAddressMinimum $info.MacAddressMinimum –MacAddressMaximum $info.MacAddressMaximum –MaximumStorageMigrations $info.MaximumStorageMigrations -UseAnyNetworkForMigration $info.UseAnyNetworkForMigration -FibreChannelWwnn $info.FibreChannelWwnn -FibreChannelWwpnMaximum $info.FibreChannelWwpnMaximum -FibreChannelWwpnMinimum $info.FibreChannelWwpnMinimum -ResourceMeteringSaveInterval $info.ResourceMeteringSaveInterval -NumaSpanningEnabled $info.NumaSpanningEnabled -EnableEnhancedSessionMode $info.EnableEnhancedSessionMode

It may look long and ugly, but the good news is you don’t have to type it out again… all you have to do is copy and paste it from this article!

Of course, you can clean it up a little… if you are not using virtual fibre channel, for example, you could remove all of the parameters that pertain to that.  A lot of companies don’t care about the MAC addresses of their VMs and resource metering, so remove those.  All of a sudden that line gets a lot smaller:

Set-VMHost -VirtualHardDiskPath $info.VirtualHardDiskPath –VirtualMachinePath $info.VirtualMachinePath –MaximumStorageMigrations $info.MaximumStorageMigrations -UseAnyNetworkForMigration $info.UseAnyNetworkForMigration -NumaSpanningEnabled $info.NumaSpanningEnabled -EnableEnhancedSessionMode $info.EnableEnhancedSessionMode

Because PowerShell is plain English, you can easily go through these scripts and customize it the way you like.  No worries, have fun!

Of course, you may have noticed by now that we have not even touched on virtual networks here, and that is certainly an important component.  What do we need for that?  You need to read my next article!

Another tough exam…

As a subject matter expert (SME) on virtualization, I was neither excited nor intimidated when Microsoft announced their new exam, 74-409: Server Virtualization with Windows Server Hyper-V and System Center.  Unlike many previous exams I did not rush out to be the first to take it, nor was I going to wait forever.  I actually thought about sitting the exam in Japan in December, but since I had trouble registering there and then got busy, I simply decided to use my visit to Canada to schedule the exam.

This is not the first exam that I have gone into without so much as a glance at the Overview or the Skills Measured section of the exam page on the Internet.  I did not do any preparation whatsoever for the exam… as you may know I have spent much of the last five years living and breathing virtualization.  This attitude very nearly came back to bite me in the exam room at the Learning Academy in Hamilton, Ontario Wednesday morning.

Having taught every Microsoft server virtualization course ever produced (and having written or tech-reviewed many of them) I should have known better.  Virtualization is more than installing Hyper-V.  it’s more than just System Center Virtual Machine Manager (VMM) and Operations Manager (OpsMgr).  It is the entire Private Cloud strategy… and if you plan to sit this exam you had better have more than a passing understanding of System Center Service Manager (ServMgr), Data Protection Manager (DPM), and Orchestrator.  Oh, and your knowledge should extend beyond more than one simple Hyper-V host.

I have long professed to my students that while DPM is Microsoft’s disaster recovery solution, when it comes down to it just make sure that your backup solution does everything that they need, and make sure to test it.  While I stand behind that statement for production environments, it does not hold water when it comes to Microsoft certification exams.  When two of the first few questions were on DPM I did a little silent gulp to myself… maybe I should have prepared a little better for this.

I do not use Service Manager… It’s not that I wouldn’t – I have a lot of good things to say about it.  Heck, I even installed it as recent as yesterday – but I have not used it beyond a passing glance.  The same used to be true of System Center Orchestrator, but over the last year that has changed a lot… I have integrated it into my courseware, and I have spent some time learning it and using it in production environments for repetitive tasks.  While I am certainly not an expert in it, I am at least more than just familiar with it.  That familiarity may have helped me on one exam question.  Had I taken the time to review the exam page on the Microsoft Learning Experience website I would have known that the word Orchestrator does not appear anywhere on the page.

Here’s the problem with Microsoft exams… especially the newer ones that do not simply cover a product, but an entire solution across multiple suites.  Very few of us will use and know every aspect covered on the exam.  That is why I have always professed that no matter how familiar you may be with the primary technology covered, you should always review the exam page and fill in your knowledge gaps with the proper studying.  You should even spend a few hours reviewing the material that you are pretty sure you do know.  As I told my teenaged son when discussing his exams, rarely will you have easy exams… if you feel it was easy it just means you were sufficiently prepared.  Five questions into today’s exam I regretted my blasé attitude towards it – I may be a virtualization expert, but I was not adequately prepared.

As I went through the exam I started to get into a groove… while there are some aspects of Hyper-V that I have not implemented, those are few and far between.  the questions about VHDX files, Failover Clustering, Shared VHDX, Generation 2 VMs, and so many more came around and seemed almost too easy, but like I told my son it just means I am familiar with the material.  There were one or two questions which I considered to be very poorly worded, but I reread the questions and the answers and gave my best answer based on my understanding of them.

I have often described the time between pressing ‘End Exam’ and the appearance of the Results screen to be an extended period of excruciating forced lessons in patience.  That was not the case today – I was surprised that the screen came up pretty quickly.  While I certainly did not ace the exam, I did pass, and not with the bare minimum score.   It was certainly a phew moment for a guy who considers himself pretty smart in virtualization.

Now here’s the question… is the exam a really tough one, or was I simply not prepared and thus considered it tough?  And frankly, how tough could it have been if I didn’t prepare, and passed anyways?  I suppose that makes two questions.  The answer to both is that while I did not prepare for the exam, I am considered by many (including Microsoft) a SME on Hyper-V and System Center.  I can say with authority that it was a difficult exam.  That then leads to the next question, is it too tough?  While I did give that some thought as I left the exam (my first words to the proctor was ‘Wow that was a tough exam!) I do not think it is unreasonably so.  It will require a lot of preparation – not simply watching the MVA Jump Start videos (which are by the way excellent resources, and should be considered required watching for anyone planning to sit the exam).  You will need to build your own environment, do a lot of reading and research, and possibly more.

If you do plan to sit this exam, make sure you visit the exam page first by clicking here.  Make sure you expand and review the Overview and Skills Measured sections.  If you review the Preparation Materials section it will refer you to a five day course that is releasing next week from Microsoft Learning Experience – 20409A- Server Virtualization with Windows Server Hyper-V and System Center (5 Days).  I am proud to say that I was involved with the creation of that course, and that it will help you immensely, not only with the exam but with your real-world experience.

Incidentally, passing the exam gives you the following cert: Microsoft Certified Specialist: Server Virtualization with Hyper-V and System Center.

Good luck, and go get em!

%d bloggers like this: