Scrubbing Hyper-V Virtual Networks

I was installing a new Hyper-V host a few days ago and had some issues when I tried to create the virtual networks.  I setup the virtual networks via Hyper-V Manager, but then the machine disappeared from the network.  Luckily, I had console access.  Turns out, the host couldn’t renew its IP addresses for some reason.  In my troubleshooting, I decided to try to remove the virtual networks – but how?

Via this script: Continue reading

WIM2VHD

In looking for an easy way to deploy operating systems to virtual servers, I started digging around for a way to import a WIM (like what comes on the 2008 installation DVD) into SCVMM’s library.  Instead, I found something that might be a bit better (or at least more versatile): the WIM to VHD Converter.

The Windows(R) Image to Virtual Hard Disk (WIM2VHD) command-line tool allows you to create sysprepped VHD images from any Windows 7 installation source. VHDs created by WIM2VHD will boot directly to the Out Of Box Experience, ready for your first-use customizations. You can also automate the OOBE by supplying your own unattend.xml file, making the possibilities limitless.

It took about ten minutes for WIM2VHD to deploy my WIM source to a usable VHD, which I then copied into the VMM library.  About an hour later (stupid refresh interval), the newly created VHD was available.  When I deployed a new virtual machine with that VHD, it was as if I had just installed Server 2008 with the DVD.  Awesome.

Unsupported Cluster Configuration

Maybe Michael should go away more often.  I seem to get a lot more done when he’s out.

Today, I added the third node to the Hyper-V R2 cluster we’re currently testing.  When I did, VMM freaked out and all of the guests on the other two nodes went into a warning state.  The error they displayed:

Warning (13921)

Highly available virtual machine <INSERT NAME> is not supported by VMM because one or more of its network adapters is not configured correctly.

Recommended Action

Ensure that all of the virtual network adapters are either disconnected or connected to highly available virtual networks.

So, how do we fix this issue?  You use Google, of course.  A quick Google-ing gave the following information (edited for grammar):

For a VN [Virtual Network] to be marked as HA, the location and tag of the VN in all nodes must be the same.  For each VN in the cluster[, be sure that]:

  • The NICs to which the VN is attached in each node have the same location.
  • The Tag in the VN in each node is the same.
  • The VN Name is the same.
  • After you commit changes, refresh the cluster so ensure that the VN is detected as HA.

Our problem, specifically, was related to the network tagging.  To fix the tag, do the following:

  1. Open VMM, and navigate to the “Hosts” view.
  2. Right click on one of the hosts and select “Properties.”
  3. Navigate to the “Networking” tab.
    VMM Network Tab
  4. Once, there, you’ll need to click each network (in this case, we have two) and add text to the “Network tag:” field.  Keep in mind that these tags will need to be the same across all your hosts in order to make them highly available.
    VMM Network Tag
  5. Rinse and repeat for the rest of your hosts.
  6. Once you finish tagging, you’ll need to refresh the cluster node in VMM.
    vmmrefresh

That fixed our problem.  Maybe it will help you.

More information here in the “Troubleshoot ‘Unsupported Cluster Configuration’ Status for a Highly Available Virtual Machine” section.

2008 R2 High Availability

Michael and I are probably the only two people in the world that would find this even remotely amusing, but…

We’re testing 2008 R2′s Failover Clustering.  In particular, we’re going to test Hyper-V and highly available machines.  So, in Michael’s infinite wisdom, he asked me what to name the first test cluster.  I suggested the following:

clusterf

Error 0x800704C8 in VMM

I was trying to deploy a new virtual machine today via Virtual Machine Manager, and kept getting this error (names changed to protect the innocent):

Error (12700)
VMM cannot complete the Hyper-V operation on the [virtualhost.domain.com] server because of the error: ‘[VIRTUALGUEST]‘ failed to add device ‘Microsoft Emulated Ethernet Port’. (Virtual machine ID 26DD8B56-0594-446A-8084-405218737EB0)

The Virtual Machines configuration 26DD8B56-0594-446A-8084-405218737EB0 at ‘J:\VS\[VIRTUALGUEST]‘ is no longer accessible: The requested operation cannot be performed on a file with a user-mapped section open. (0x800704C8)
(Unknown error (0×8000))

Recommended Action
Resolve the issue in Hyper-V and then try the operation again.

Well, that’s really good advice – clear the error and try again.  So, a quick Google-ing turned up a Microsoft KB article: Creating or starting a Hyper-V virtual machine on Windows Server 2008 or Microsoft Hyper-V Server 2008 may fail with error: 0x800704C8.  Oddly enough, this was exactly my issue:

CAUSE

This issue can be caused by antivirus software that is installed in the parent partition and the real-time scanning component is configured to monitor the Hyper-V virtual machine files.

RESOLUTION

To resolve this issue, configure the real-time scanning component within the antivirus software to exclude the following directories and files:

  • Default virtual machine configuration directory (C:\ProgramData\Microsoft\Windows\Hyper-V)
  • Custom virtual machine configuration directories
  • Default virtual hard disk directory (C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks)
  • Custom virtual hard disk directories
  • Snapshot directories
  • Vmms.exe
  • Vmwp.exe

Notes:

  • If virtual machines are missing from the Hyper-V Management console, you must configure the antivirus exclusions, and then restart the Hyper-V Virtual Machine Management service.
  • If the error code was 0x800704C8, it is likely that the virtual machine configuration file was corrupted and the virtual machine may need to be re-created or restored from backup if restarting the Hyper-V Virtual Machine Management service does not resolve the issue.

Chalk one up for Microsoft KB articles.  Now, a little further down in the KB article, it suggests (per Planning for Hyper-V Security) installing the antivirus on the guest (which we do) and not on the host (which we do, too):

Do not run any applications in the parent partition. Run all applications on virtual machines, which use child partitions. For example, if antivirus is required, be sure to run it on the VMs rather than the parent partition. Keeping the parent partition free of applications and running on a Windows Server 2008 core installation means fewer host updates, since nothing needs software updates except the Windows Server 2008 core installation, the Hyper-V service components, and the small (~600KB) hypervisor.

A connection will not be made…

First of all, don’t tell me what you will and will not do, young lady.

I was receiving the error below when trying to connect to a VM through Hyper-V Manager:

The fix was easily found in the TechNet Forums (in case that link isn’t active in the future, I’ve documented the fix for posterity below).

The fix:

Copy and paste the following into a text file and save it as a *.reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowDefaultCredentials]
“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowDefaultCredentialsDomain]
“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentials]

“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain]

“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsWhenNTLMOnly]

“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsWhenNTLMOnlyDomain]

“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentials]

“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentialsDomain]
“Hyper-V”=”Microsoft Virtual Console Service/*”

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentialsWhenNTLMOnly]
“Hyper-V”=”Microsoft Virtual Console Service/*”

Now import it into your registry and enjoy your new Credssp configuration.