Compacting a Dynamic Hyper-V Virtual Hard Drive

If you have ever tried to use the Hyper-V “compact” command on a dynamic vhd, you have probably noticed that it very rarely reduces the vhd file size.  If you ever delete files from within the guest OS, reducing the size of the volume, you will notice that the VHD doesn’t get smaller.  I found a very quick and easy way to reduce the size of dynamic vhd’s:

  1. For best results, first defrag the drive from within the guest (optional).  If you know you have empty space on the volume, this step isn’t really necessary.
  2. Shutdown the VM and make a copy of the vhd so you will be working from a backup (obvi…)
  3. From the hyper-v host computer type diskpart in a command prompt
  4. Type the following commands within the diskpart window:
select vdisk file="C:\path\to\copy\of\backup.vhd"
attach vdisk readonly
compact 
vdisk
detach vdisk 
exit

Hyper-V Virtual Machines wont start with Errors 17040 and 15500

Synopsis:

We have a Hyper-V Host server running Server 2008 Datacenter with Hyper-V RTM.  On this host we have several guest machines:

1.       Domain Controller

2.       DPM

3.       VMM

4.       Etc

 

The host OS had a VMM agent which happened to be managed by Virtual Machine Manager which was running on guest OS #3.  In other words, the guest was managing the host.

 

After installing some windows updates and rebooting the host OS, none of the VM’s would boot, with a dialog box saying that the machines were "unable to start."  Clicking on details would show "ServerName failed to start worker process: The extended attributes are inconsistent. (0x800700FF)."

 

The following errors showed in the event log:

 

Log Name:      Microsoft-Windows-Hyper-V-VMMS-Admin

Source:        Microsoft-Windows-Hyper-V-VMMS

Date:          8/29/2008 1:04:57 PM

Event ID:      15500

Task Category: None

Level:         Error

Keywords:     

User:          SYSTEM

Computer:      Hyper-V Servername 

Description:

‘CATDEMO-DC’ failed to start worker process: The extended attributes are inconsistent. (0x800700FF). (Virtual machine ID C6A6A456-C58A-45BE-93D4-A94081481267)

 

 

Log Name:      Microsoft-Windows-Hyper-V-Worker-Admin

Source:        Microsoft-Windows-Hyper-V-Worker

Date:          8/29/2008 1:07:06 PM

Event ID:      17040

Task Category: None

Level:         Error

Keywords:     

User:          NETWORK SERVICE

Computer:      Hyper-V Servername

Description:

The authorization store could not be initialized from storage location ‘msxml://C:\ProgramData\Microsoft\Virtual Machine Manager\HyperVAuthStore.xml’. Error: General access denied error (0x80070005).

 

 

Resolution:

1.       Back up the C:\ProgramData\Microsoft\Virtual Machine Manager\HyperVAuthStore.xml file by copying it to the desktop

2.       Change security on C:\ProgramData\Microsoft\Virtual Machine Manager\HyperVAuthStore.xml, give “EVERYONE” read access to the file.

3.       Start your virtual machines.

 

The recommended resolution is to reinstall the VMM agent from the VMM server, but this wasn’t possible since the VMM server was a virtual that wouldn’t start.  This is a known error with VMM

 

Related Articles:

http://forums.technet.microsoft.com/en-US/winserverhyperv/thread/d6103439-93cf-4a92-baed-7c042fbe4cd9/

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3469073&SiteID=17

http://www.expta.com/2008/06/vmm-2008-managed-hyper-v-s-wont-start.html

VMbus Failure in 32-bit Server 2008 VHD

I recently decided installed Server 2008 with Hyper-V on my laptop and migrated all my virtual PC machines. 

If you use a Server 2008 32-bit vhd created in Virtual PC, you may not be able to install and use Hyper-V integration services.  The mouse service will not perform correctly and your network devices will not show up.  The VMbus will show a warning yellow icon in device manager and will say that there aren’t enough IRQ’s to load the bus.

In MSCONFIG, I changed the advanced boot options to check HAL when loading boot.ini and it fixed the problem.