<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tristan Watkins on IT Infrastructure &#187; Hyper-V Manager Archive</title>
	<atom:link href="http://tristanwatkins.com/index.php/tag/hyper-v-manager/feed/" rel="self" type="application/rss+xml" />
	<link>http://tristanwatkins.com</link>
	<description>Technical guidance for SharePoint, Cloud Services, Windows and more</description>
	<lastBuildDate>Fri, 21 Oct 2011 23:33:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Recovering from Hyper-V Virtual Machine corruption</title>
		<link>http://tristanwatkins.com/index.php/recovering-from-virtual-machine-corruption/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recovering-from-virtual-machine-corruption</link>
		<comments>http://tristanwatkins.com/index.php/recovering-from-virtual-machine-corruption/#comments</comments>
		<pubDate>Fri, 28 May 2010 22:56:09 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[AVHD]]></category>
		<category><![CDATA[Corruption]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Hyper-V Manager]]></category>
		<category><![CDATA[Snapshot]]></category>
		<category><![CDATA[VHD]]></category>
		<category><![CDATA[Virtual Har]]></category>
		<category><![CDATA[Virtual Machine]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=941</guid>
		<description><![CDATA[I was recently working with a Hyper-V VM that had a large branch of snapshots that I wanted to clean up, in order to conserve disk space. This was a SharePoint 2010 development VM which I&#8217;d configured specifically for a project, so I didn&#8217;t need all of the earlier snapshots. The environment has two VMs [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently working with a Hyper-V VM that had a large branch of snapshots that I wanted to clean up, in order to conserve disk space. This was a SharePoint 2010 development VM which I&#8217;d configured specifically for a project, so I didn&#8217;t need all of the earlier snapshots. The environment has two VMs (one domain controller, everything else on the other), so I deleted all of the snapshots that I needed to get rid of on the first VM, one-by-one. From previous experience I knew that I could delete multiple snapshots before the initial merge operation completed. Hyper-V creates a queue of the merge operations that need to complete before the virtual machine can be restarted again. I left myself with only the latest snapshot and moved on to the second virtual machine to do the same. At this point I got a little too clever and started deleting the second snapshot before the first snapshot deletion was queued. It usually only takes a few seconds to complete but I jumped the gun and Hyper-V Manager threw two errors (4096 and 16410) regarding Virtual Machine file access when I tried to delete the second snapshot.</p>
<p><span id="more-941"></span><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_4096.png"><img style="display: inline; border: 0px;" title="Hyper-V_Error_4096" src="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_4096_thumb.png" border="0" alt="HyperV Error 4096 thumb Recovering from Hyper V Virtual Machine corruption" width="549" height="387" /></a></p>
<p><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16410.png"><img style="display: inline; border: 0px;" title="Hyper-V_Error_16410" src="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16410_thumb.png" border="0" alt="HyperV Error 16410 thumb Recovering from Hyper V Virtual Machine corruption" width="548" height="388" /></a></p>
<p>After that I tried to delete other snapshots but I kept getting errors and the VM entered a <em>Saved-Critical</em> state. This will happen when Hyper-V Manager cannot access a file system location or cannot find a file, for instance when a removable hard drive is pulled out.</p>
<p>Approximately 30 seconds later, Hyper-V thought that it regained access to the location:</p>
<p><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_4098.png"><img style="display: inline; border: 0px;" title="Hyper-V_Error_4098" src="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_4098_thumb.png" border="0" alt="HyperV Error 4098 thumb Recovering from Hyper V Virtual Machine corruption" width="549" height="390" /></a></p>
<p>However, I couldn&#8217;t get any snapshots to delete and the virtual machine wouldn&#8217;t start. After a few minutes of panicked clicking I decided to restart the Hyper-V services. When they came back up my VM disappeared. The Virtual Machine configuration file was corrupted.</p>
<p><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16310.png"><img style="display: inline; border: 0px;" title="Hyper-V_Error_16310" src="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16310_thumb.png" border="0" alt="HyperV Error 16310 thumb Recovering from Hyper V Virtual Machine corruption" width="548" height="388" /></a></p>
<p>The next event suggests that a snapshot file was also corrupted.</p>
<p><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16330.png"><img style="display: inline; border: 0px;" title="Hyper-V_Error_16330" src="http://tristanwatkins.com/wp-content/uploads/HyperV_Error_16330_thumb.png" border="0" alt="HyperV Error 16330 thumb Recovering from Hyper V Virtual Machine corruption" width="548" height="385" /></a></p>
<p>These 16310 and 16330 errors repeated for a while. Panic continued. Eventually I rebooted. On reboot the VM was still missing and the 16310/16330 errors persisted.</p>
<p>On a hunch I decided to see what the AVHD files (the differencing disks that correlate with snapshot states) looked like.</p>
<p><a href="http://tristanwatkins.com/wp-content/uploads/HyperV_AVHDFiles.png"><img style="display: inline; border: 0px;" title="Hyper-V_AVHDFiles" src="http://tristanwatkins.com/wp-content/uploads/HyperV_AVHDFiles_thumb.png" border="0" alt="HyperV AVHDFiles thumb Recovering from Hyper V Virtual Machine corruption" width="548" height="265" /></a></p>
<p>This looked very much like what I would have expected if nothing had gone wrong (and if none of the snapshot deletions completed). Sticking with this line of inquiry (and what the 16310 error suggests), I created a new virtual machine and pointed it at the most recent AVHD file (selected above). All of my snapshots were missing but the virtual machine created successfully. I started the virtual machine and it was clearly in the same state it was in before I took the most recent snapshot, with a few caveats. In my panic I forgot to re-create my second NIC, so the VM started with only one (the one that I specified when I created the new VM). I also forgot to give it a second CPU. So I shut down the VM, made these changes, restarted, reconfigured the second NIC and tested that everything worked to my expectations. Recovery complete, so I shut down both VMs again.</p>
<p>At this point I&#8217;d recovered the VM but I still had a bunch of unnecessary data in my branch of differencing disks. In order to clean this up, I took a new snapshot of both VMs and exported the latest snapshot of each of them. This merged all the differences across the AVHD files in to a new, self-contained VHD file. After the exports finished I deleted the old VMs, waited for the Destroy operations to complete, cleaned up lingering files on the file system and imported the new exports. I took a new snapshot, as this is my new stable starting point and everything was (relatively speaking) back to normal. Phew!</p>
<p>With hindsight, I would have handled the recovery as follows:</p>
<ul>
<li>Create new VM, pointing at latest differencing disk (or whichever snapshot state you wanted to preserve).</li>
<li>Reconfigure processors.</li>
<li>Reconfigure network adapters in Hyper-V Manager.</li>
<li>Start the virtual machine.</li>
<li>Reconfigure NICs in the guest.</li>
<li>Reboot.</li>
<li>Test everything is working as expected in the VM.</li>
<li>Shut Down.</li>
<li>Snapshot.</li>
<li>Export.</li>
<li>Delete old VM from Hyper-V Manager.</li>
<li>Wait for the Destroy operation to complete.</li>
<li>Delete any lingering files from the file system.</li>
<li>Import the exported virtual machines.</li>
</ul>
<p>As I hinted at above, having gone through this process, it occurred to me that you could probably point at whichever AVHD file you wanted to, if you didn&#8217;t want to use the latest snapshot, assuming none of the AVHD files were corrupted. In this case it was just the virtual machine XML file and possibly the snapshot file that were corrupted, rather than the VHD file and differencing disks (AVHD files) themselves. The problem would be identifying which AVHD file corresponds to the snapshot that you want to keep, but in principal I think this would work.</p>
<p>I should note that this is probably unsupported, but you&#8217;re not really losing anything because otherwise you would have only been able to recover the first VHD file. This technique wouldn&#8217;t be much use if you didn&#8217;t know which snapshot you were after or if you wanted to recover the entire snapshot tree, but this fix gives you some recovery where the virtual machine file and the snapshot tree are corrupted but the disk data is not.</p>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/recovering-from-virtual-machine-corruption/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hyper-V Manager over VPN may fail if the server is VMM-managed</title>
		<link>http://tristanwatkins.com/index.php/hyper-v-manager-over-vpn-doesnt-like-sc-vmm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hyper-v-manager-over-vpn-doesnt-like-sc-vmm</link>
		<comments>http://tristanwatkins.com/index.php/hyper-v-manager-over-vpn-doesnt-like-sc-vmm/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 21:36:19 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[HVRemote]]></category>
		<category><![CDATA[Hyper-V Manager]]></category>
		<category><![CDATA[SC VMM]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[WBEMTEST]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=76</guid>
		<description><![CDATA[About a year ago John Howard published guidance on how to get Hyper-V Manager to connect to Hyper-V servers over VPN. His network monitoring and suggestion to change the VPN connection IP settings so that the VPN adapter registers the machine&#8217;s new address in DHCP/DNS went a long way towards fixing the issue  for me &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>About a year ago <a title="John Howard" href="http://blogs.technet.com/jhoward" target="_blank">John Howard</a> published guidance on how to get Hyper-V Manager to connect to Hyper-V servers over VPN. His network monitoring and suggestion to change the VPN connection IP settings so that the VPN adapter registers the machine&#8217;s new address in DHCP/DNS went a long way towards fixing the issue  for me &#8211; however, we recently uncovered a couple of caveats as detailed in <a title="John Howard" href="http://blogs.technet.com/jhoward/archive/2008/08/07/hyper-v-why-does-hyper-v-manager-not-always-work-over-vpn-connection-access-denied-or-rpc-server-unavailable-errors.aspx#3266386" target="_blank">the comments on his original post</a>.<span id="more-76"></span></p>
<p>First, I found it was necessary to disable the DNS cache on the Hyper-V server so that it would find the newly-registered VPN-connected IP address of the client machine so that it can correctly route all traffic back to it. This can be rectified for testing purposes with an IPCONFIG /FLUSHNDS but it would be a massive annoyance if all remote Hyper-V users had to log on to the Hyper-V server via remote desktop and flush the DNS cache before connecting with Hyper-V Manager. In order to disable DNS caching at all times just disable the DNS client service. Granted, this introduces the overhead of DNS requests for all network activity on the root partition, but in this case we can live with that, especially since most Hyper-V hosts probably won&#8217;t have a lot of traffic on the management NIC.</p>
<p>Once this fix was in place we could establish a Hyper-V Manager connection over VPN, the server&#8217;s activity pane expanded and I could even modify the server&#8217;s settings. Strangely, the Hyper-V virtual machine pane remained empty and never enumerated the guests. At this point I started to detail the new problem for John and he suggested connecting using the WMI testing tool, WBEMTEST. He provided me with the query syntax and I confirmed that WMI was able to enumerate all of the virtual machines over VPN when Hyper-V Manager could not. John also asked if we were using SC Virtual Machine Manager (VMM) in this environment (we are), which unfortunately means that we can&#8217;t use his HVRemote tool to gather additional test results, as it doesn&#8217;t support VMM-managed Hyper-V servers.</p>
<p>We&#8217;re going to rebuild the Hyper-V Server on Windows Server 2008 R2 RTM in a few weeks and test connections before bringing it under VMM-management and test with HVRemote in more detail if there are problems. Until then, it would be interesting to know if anyone else has this problem with VMM-managed Hyper-V servers.</p>
<p>22/10/09 update: we still have the same problem after rebuilding the server. The rebuilt machine is not VMM-manager. Still no solution for this presently.</p>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/hyper-v-manager-over-vpn-doesnt-like-sc-vmm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

