<?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>MCB Systems &#187; hyper-v</title>
	<atom:link href="http://www.mcbsys.com/techblog/tag/hyper-v/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mcbsys.com/techblog</link>
	<description>Custom Software and I.T. Services</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:58:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Can&#8217;t Ping Server after Changing Router</title>
		<link>http://www.mcbsys.com/techblog/2011/11/cant-ping-server-after-changing-router/</link>
		<comments>http://www.mcbsys.com/techblog/2011/11/cant-ping-server-after-changing-router/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 21:05:50 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2011/11/cant-ping-server-after-changing-router/</guid>
		<description><![CDATA[After installing a new router, I was no longer able to ping my Hyper-V server. Why not? The router sits at the edge of the network—how could it affect pinging on the local LAN?
  
Often failed pings are related to the firewall on the target machine. For example, the Windows Firewall setup on my [...]]]></description>
			<content:encoded><![CDATA[<p>After installing a new router, I was no longer able to ping my Hyper-V server. Why not? The router sits at the edge of the network—how could it affect pinging on the local LAN?</p>
<p>  <span id="more-1028"></span>
<p>Often failed pings are related to the firewall on the target machine. For example, the Windows Firewall setup on my Server 2008 R2 only allows ICMPv4 pings on Private networks:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Change Network Type 4" border="0" alt="Change Network Type 4" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-4.png" width="550" height="101" /></p>
<p>By temporarily disabling individual firewall profiles on the server, I found that I could ping the server if I turned off the Public firewall profile. Huh? Why does the server thing it is on a Public network?</p>
<p>The answer is Network Location Awareness. You’ve seen the prompt when you connect a laptop to a new wireless network:&#160; is this a Home, Work, or Public network? Well I never saw that prompt on the server; apparently it just assumes that a new network (e.g. due to a new router) is Public, the most restrictive profile. </p>
<p>Note that this doesn’t affect domain-joined computers; they are automatically assigned to the Domain firewall profile. But it does affect my non-domain-joined Hyper-V server.</p>
<h3>Change the Network Type</h3>
<p>To tell the server it’s on a Private network, go to Network and Sharing Center, click on <strong>Public network:</strong></p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-1.png" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Change Network Type 1" border="0" alt="Change Network Type 1" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-1_thumb.png" width="554" height="242" /></a></p>
<p>Then choose <strong>Work network:</strong></p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-2.png" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Change Network Type 2" border="0" alt="Change Network Type 2" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-2_thumb.png" width="554" height="359" /></a></p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-3.png" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Change Network Type 3" border="0" alt="Change Network Type 3" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/Change-Network-Type-3_thumb.png" width="554" height="245" /></a></p>
<p>That’s it! The server now knows it’s on a Private network, and the Private firewall profile applies. As long as that profile accepts ICMP (ping) requests, you should be able to ping the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2011/11/cant-ping-server-after-changing-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hyper-V Certificate Will Expire within 30 Days</title>
		<link>http://www.mcbsys.com/techblog/2011/06/hyper-v-certificate-will-expire-within-30-days/</link>
		<comments>http://www.mcbsys.com/techblog/2011/06/hyper-v-certificate-will-expire-within-30-days/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 00:04:32 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[hyper-v]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/?p=833</guid>
		<description><![CDATA[It may be a bit sensationalistic to call it a time bomb, but apparently Hyper-V will only run for a year before the self-signed certificate that allows remote access to the machines expires. Supposedly it will auto-renew (unless you’re on Server 2008 and need this hotfix), but according to MSKB 241735, you may still be [...]]]></description>
			<content:encoded><![CDATA[<p>It may be a bit sensationalistic to call it a time bomb, but apparently Hyper-V will only run for a year before the self-signed certificate that allows remote access to the machines expires. Supposedly it will auto-renew (unless you’re on Server 2008 and need this <a href="http://support.microsoft.com/kb/967902" target="_blank">hotfix</a>), but according to MSKB <a href="http://support.microsoft.com/kb/2413735" target="_blank">241735</a>, you may still be left with an inoperable mouse and need to save/resume your VMs.</p>
<h3><span id="more-833"></span>Symptoms</h3>
<p>How do you know you’re approaching expiration? You’ll see this warning in your Hyper-V-VMMS event log:</p>
<p>Log Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Hyper-V-VMMS-Admin<br />
Source:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Hyper-V-VMMS<br />
Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12510<br />
Task Category: None<br />
Level:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Warning<br />
User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYSTEM<br />
Description:&nbsp; The certificate used for server authentication will expire within 30 days. Remote access to virtual machines will not be possible after the certificate expires. Please renew or recreate the certificate.</p>
<p>To check the certificate, you’ll need to create a new certificate viewer for the Hyper-V Virtual Machine Management service. (For instructions, in this <a href="http://technet.microsoft.com/en-us/library/ff935311(WS.10).aspx" target="_blank">TechNet article</a>, see step 2 under “<span style="font-weight: normal;">Deploying a certificate issued by a CA.”) </span>You’ll see that the machine’s certificate will expire soon:</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-11.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Hyper-V Cert 1" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-1_thumb1.png" border="0" alt="Hyper-V Cert 1" width="554" height="188" /></a></p>
<p>A copy of the certificate is also found in the <strong>vmms\Trusted Root Certification Authorities</strong> store.</p>
<h3>Solution</h3>
<p>Microsoft Support recommended following the instructions in <a href="http://support.microsoft.com/kb/2413735" target="_blank">241735</a> to create a self-signed certificate that is good until 2050. For that you need:</p>
<ul>
<li>This PowerShell script:  <a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V_Cert.zip" target="_self">Hyper-V_Cert.zip</a>. This is a slightly modified version of the script posted on TechNet <a href="http://gallery.technet.microsoft.com/ScriptCenter/be2da634-978b-48d7-b3ab-01c593c9d177/" target="_blank">here</a>. The TechNet version improperly appends “WORKGROUP” to the certificate’s Subject Name if your server is not domain-joined, which prevents Hyper-V from using the certificate. See <a href="http://technet.microsoft.com/en-us/library/ff935311(WS.10).aspx" target="_blank">this article</a> for more info on creating and updating Hyper-V certificates. As always, use downloaded scripts at your own risk!</li>
<li><strong>MakeCert.exe</strong> from the Windows SDK. Use the <a href="http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx" target="_blank">web installer</a> (be sure you’re on a 64-bit machine) and select only the Tools. The total download is about 80MB:</li>
</ul>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Hyper-V Cert 3" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-3_thumb.png" border="0" alt="Hyper-V Cert 3" width="554" height="389" /></a></p>
<h3>Running the Script</h3>
<p>Put the script and <strong>makecert.exe</strong> in the same folder on your Hyper-V server and run the <strong>cert.ps1</strong> PowerShell script.</p>
<p><span style="background-color: #ffff00;"><strong>Note</strong> The script will save and and restore all running VMs!</span></p>
<p>I assume that saving and restoring VMs will disrupt clients that are relying on a constant server connection, so do this when no one is around.</p>
<p>If you see “WORKGROUP” when you start the script, you’re using the version from TechNet. When the script completes, you’ll need to delete the certificate from the certificate store and use the version above.</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-42.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Hyper-V Cert 4" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-4_thumb2.png" border="0" alt="Hyper-V Cert 4" width="354" height="117" /></a></p>
<p>You should instead see something like this if your server is not in a domain:</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Hyper-V Cert 5" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-5_thumb.png" border="0" alt="Hyper-V Cert 5" width="354" height="292" /></a></p>
<p>When the script completes, you should see the new certificate in the <strong>vmms\Trusted Root Certification Authorities</strong> store:</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-6.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Hyper-V Cert 6" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/06/Hyper-V-Cert-6_thumb.png" border="0" alt="Hyper-V Cert 6" width="554" height="236" /></a></p>
<p>No copy is created in the <strong>vmms\Personal</strong> store.</p>
<p>If you stop and start the Virtual Machine Management service, you should no longer see the event log warning about the pending certificate expiration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2011/06/hyper-v-certificate-will-expire-within-30-days/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restore a Hyper-V Server to an Optiplex 960</title>
		<link>http://www.mcbsys.com/techblog/2011/01/restore-a-hyper-v-server-to-an-optiplex-960/</link>
		<comments>http://www.mcbsys.com/techblog/2011/01/restore-a-hyper-v-server-to-an-optiplex-960/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 02:00:31 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bitlocker]]></category>
		<category><![CDATA[diskpart]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[optiplex]]></category>
		<category><![CDATA[windows home server]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/?p=563</guid>
		<description><![CDATA[Recently I upgraded a small server to run Windows Server 2008 R2 as a Hyper-V host, with Server 2008 R2 as a guest as well. I’ve read that Windows Server Backup can restore to dissimilar hardware. That could be especially helpful in a small environment where no other servers are available. Can I restore the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I upgraded a small server to run Windows Server 2008 R2 as a Hyper-V host, with Server 2008 R2 as a guest as well. I’ve read that Windows Server Backup can restore to dissimilar hardware. That could be especially helpful in a small environment where no other servers are available. Can I restore the entire Server 2008 host and guest to an Optiplex 960 desktop? How long will it take?</p>
<p><span id="more-563"></span></p>
<h3>Environment Details</h3>
<p>The server is a Dell PowerEdge 1900 with 4GB of RAM and two 250GB hard drives configured as RAID 1 (mirrored). As mentioned, it runs Windows Server 2008 R2 with the Hyper-V role, and it hosts a single Server 2008 R2 guest. The guest runs as a domain controller, file server, and email server. Windows Server Backup runs daily on the host, taking an image of the C: drive (containing the host operating system, 16GB) and the D: drive (containing the guest virtual machine, about 48GB used on 80GB of fixed VHD space). Backups are stored on a Seagate Freeagent Go USB drive. Windows Server Backup also runs daily on the guest, saving its backups to a VHD on the same Freeagent USB drive.</p>
<p>The desktop is an Optiplex 960 with 4GB of RAM and one 300GB hard drive. Most important is the processor, an Intel Core 2 E8400 that does support Intel Virtualization Technology and Execute Disable, so it should run Hyper-V.</p>
<h3>Recovery Options</h3>
<p>There are at least three options for recovering this guest server (which is of course the critical machine):</p>
<p>1. Restore the host and guest from the host’s backup. This makes use of (and tests) Windows Server Backup’s ability to restore to dissimilar hardware, as reported <a href="http://www.wbadmin.info/articles/hardware-independent-bare-metal-restore-windows-server-2008.html" target="_blank">here</a>.</p>
<p>2. Install Server 2008 R2 and the Hyper-V role in a small partition and apply all operating system updates. Restore the guest VHD in a larger partition. Re-create the Hyper-V guest machine using the VHD. This avoids the dissimilar hardware restore at least for the host.</p>
<p>3. Restore the guest backup directly. This would be a virtual-to-physical restore, so also dissimilar hardware.</p>
<p>Option 1 should be the fastest and the most flexible, since it would also accommodate the scenario where multiple guests needed to be restored.</p>
<h3>Recovery Experience</h3>
<p>The recovery—and this post—became quite long. You may want to skip to the “Conclusions” section, then come back to the step-by-step logs for details as necessary</p>
<h3>Time Log – Day 1</h3>
<p>Here my log of the recovery process with notes for next time.</p>
<p><strong>3:20pm</strong>&nbsp; Insert Server 2008 R2 DVD into Optiplex 960 and attach USB drive containing backup data. During reboot, check BIOS to make sure Virtualization Technology and Execute-Disable are turned on. Boot from DVD.</p>
<p><strong>3:22pm</strong> DVD boot is fast! Glad I didn’t waste time making a bootable thumb drive. Choose <strong>Repair your computer</strong>, then <strong>Restore your computer….</strong> Can’t see external USB drive as backup source. Start googling.</p>
<p><strong>3:35pm</strong> Oh yeah, the whole backup drive is Bitlocker-encrypted. Apparently Repair doesn’t detect this as there is no prompt to unlock. Press Shift-F10 to get a command prompt. Commands:<br />
<strong>manage-bde –status</strong> to show drive (it’s mounted as G:)<br />
<strong>manage-bde –unlock –h</strong> for parameter help<br />
<strong>manage-bde –unlock G: –RecoveryPassword 111111-222222-…-8888888</strong> to unlock using recovery key</p>
<p><strong>3:56pm</strong> Drive unlocked. Close command prompt. Press Refresh in Repair wizard. Backup drive found. Choose most recent backup, accept defaults (do check <strong>Format and repartition disks</strong>, do not check <strong>Only restore system drives</strong>). Do not install drivers or change Advanced options. Start restore. “This might take from a few minutes to a few hours.”</p>
<p><strong>4:06pm</strong> Drive C: restore complete.</p>
<p><strong>4:28pm</strong> Drive D: restore about half done.</p>
<p><strong>4:48pm</strong> Drive D: restore complete.</p>
<p><strong>4:51pm</strong> Drive S: restore complete. “The restored drives are not encrypted.” Remove DVD, unplug USB hard drive, Restart Now.</p>
<p><strong>4:53pm</strong> Stuck on boot. “Intel® Matrix Storage Manager” text on screen. I suspect boot drive number is off. Reboot from DVD.</p>
<p><strong>4:58pm</strong> Choose <strong>Repair your computer</strong>, then <strong>Use recovery tools….</strong> and <strong>Command Prompt</strong>. Start fiddling with <strong>diskpart</strong>:</p>
<p><strong>diskpart</strong><br />
<strong>list disk<br />
select disk 0</strong><br />
<strong>list volume</strong> – letters are all messed up<br />
<strong>select volume 1</strong><br />
<strong>remove letter=C</strong> System Reserved should not have a letter<br />
<strong>select volume 2</strong><br />
<strong>remove letter=F</strong> This is the boot volume<br />
<strong>assign letter=C<br />
active</strong> identify as the boot volume<br />
<strong>select volume 3</strong> this is already assigned drive D, so skip<br />
<strong>select volume 4</strong><br />
<strong>remove letter=E<br />
assign letter=S</strong><br />
<strong>list volumes</strong> confirm correct lettering<br />
<strong>exit</strong></p>
<p><strong>5:16pm</strong> Can’t find a boot.ini file. A little googling confirms that has been replaced in Server 2008 and above with the Boot Manager Configuration file. Let’s just reboot and see what happens.</p>
<p><strong>5:20pm</strong> This time we got far enough to see “BOOTMGR is missing. Press Ctrl+Alt+Del to restart”. Reboot from DVD.</p>
<p><strong>5:24pm</strong> Operating system is not listed for repair, so follow Method 2 of accepted solution in <a href="http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/e6e2399c-746a-4d45-8b77-dc6e89fd9409" target="_blank">this thread</a>. From a command prompt, type<br />
<strong>bootrec /rebuildbcd</strong><br />
and let it add C:\Windows to the boot list. Remove DVD and restart.</p>
<p><strong>5:27pm</strong> Same message:&nbsp; “BOOTMGR is missing.” Boot from DVD.</p>
<p>This time, operating system is listed, so follow Method 1 at the previous link. Select the operating system. Unfortunately there is no Startup Repair option (apparently that is only available on Windows Vista/7 media). Try a couple other <strong>bootrec</strong> options:<br />
<strong>bootrec /fixmbr</strong><br />
<strong>bootrec /fixboot</strong><br />
and reboot.</p>
<p><strong>5:40pm</strong> Same message. Giving up for today. Will contact Microsoft Partner Support for suggestions. In a real disaster recovery situation, I would be on the phone with support and/or moving to Recovery Option 2 above. In fact, since the guest’s VHD is already restored, I could probably just install a clean Server 2008 R2 with Hyper-V on top of the botched C drive and use that to load the guest. But I’d like to understand why Recovery Option 1 hasn’t worked and get it working if possible.</p>
<h3>Time Log – Day 2</h3>
<p><strong>1:10pm</strong> MS Support suggests copying the <strong>bootmgr</strong> file from \Windows\Boot\PCAT\ on the DVD to the root of C:. That location does not exist on the DVD, but it does exist on the restored OS, so I copied that to the root of C:. Voila! Windows boots and immediately reboots, telling me it failed to start. Well at least it’s finding the BOOTMGR.</p>
<p><strong>1:23pm</strong> Windows won’t start in Safe Mode either. Don’t even see a blue screen flicker by; just gets partway through the boot and restarts. (It finishes loading CLASSPNP.SYS but fails on whatever comes after that.) Start googling for how to disable Recovery Options &gt; Automatically Restart when you can’t get into the OS.</p>
<p><strong>1:55pm</strong> No joy finding out how to change boot behavior. Just for grins, try copying BOOTMGR from the root of the DVD drive to the root of C. Same problem:&nbsp; won’t start in Safe Mode, just restarts without blue screen.</p>
<p><strong>2:10pm</strong> Grasping at straws:&nbsp; trying copying <strong>bootmgr.efi</strong> from the root of the DVD to the root of C. Same problem persists.</p>
<p><strong>2:25pm</strong> Interesting thread <a href="http://www.networksteve.com/forum/topic.php?TopicId=15906" target="_blank">here</a>. Though not directly related, I see I didn’t try one of the recommend commands earlier. Try this while booted from the DVD:<br />
<strong>bootrec /rebuildbcd<br />
bootrec /fixmbr</strong><br />
<strong>bootrec /fixboot<br />
G:</strong> switch to DVD drive<br />
<strong>\boot\bootsect.exe /nt60 C:</strong> – this is new<br />
After reboot, same issue.</p>
<p><strong>2:40pm</strong> Follow an idea near the bottom of <a href="http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/2b7213da-ba91-4228-af9d-2ba6b2d2edc0" target="_blank">this thread</a> and change Optiplex 960 BIOS to put SATA Operation in <strong>Legacy</strong> mode (was in <strong>RAID On</strong> mode). Still gets through CLASSPNP.SYS, but does not immediately reboot; it just hangs, won’t even accept Ctrl-Alt-Del. That’s different, so the SATA Operation mode may be the issue! Try the other two SATA modes.&nbsp; <strong>RAID Autodetect / AHCI</strong> behaves like RAID On:&nbsp; a reboot loop. <strong>RAID Autodetect / ATA</strong> … worked! It hung for a while after CLASSPNP.SYS, but then it gave me a Safe Mode logon screen.</p>
<p><strong>2:53pm</strong> After logging on, I see popup telling me “You must restart to apply these changes.” First I went in to System properties &gt; Advanced system settings &gt; Startup and Recovery and unchecked “Automatically restart”. That should stop the reboot loop, should it recur.</p>
<p><strong>2:57pm</strong> It rebooted quickly into full operating system and logged on.</p>
<p>Of course the NIC has changed. In Hyper-V manager, run Virtual Network Manager. Change the “Local Area Connection – Virtual Network” to use the External adapter in the Optiplex 960 (Intel 82567LM-3 Gigabit Network Connection).</p>
<p><strong>3:15pm</strong> Errors in Optiplex’s Server event log confirm that this machine’s name conflicts with the live server. Temporarily shut down the live server.&nbsp; Also disable port 25 on router to block incoming email (to keep email from going to the test machine when we start it.) Reboot the Optiplex.</p>
<p><strong>3:18pm</strong> Start test guest server. “The virtual machine could not be started because the hypervisor is not running.” This corresponds to Hyper-V-Worker error 3112. The third suggestion may apply:&nbsp; “If you have made changes to the Boot Configuration Data store, review these changes to ensure that the hypervisor is configured to launch automatically.” We <em>have</em> been mucking around with the boot manager. Hmm, I wonder if I had stayed with the version in the C:\Windows\Boot\PCAT folder instead of copying from the DVD… In fact, maybe I would not have had to rebuild the BCD if I’d just set the SATA mode first.</p>
<p><strong>3:30pm</strong> Reboot to DVD. Delete <strong>C:\bootmgr</strong>, <strong>C:\bootmgr.efi</strong>, and <strong>C:\bootsqm.dat</strong>. Reboot. “BOOTMGR is missing.” Oh well. Copy <strong>bootmgr</strong> from C:\Windows\boot\PCAT to C:\. Windows boots fine. (I realized later that the <strong>bootmgr</strong> file was not the issue, it was the boot <em>configuration</em>, not stored in the <strong>bootmgr</strong> file.)</p>
<p><strong>3:41pm</strong> I was thinking I would need to re-install the Hyper-V role to get the hypervisor running again, but then I came across <a href="http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/01/19/hyper-v-virtual-machines-do-not-start-after-using-startup-repair.aspx" target="_blank">this article</a> that shows how to fix it with one command:<br />
<strong>bcdedit /set hypervisorlaunchtype auto</strong></p>
<p><strong>3:52pm</strong> After rebooting, try starting the guest OS again. Same problem:&nbsp; the hypervisor is not running. Now in the event log there is Hyper-V-Hypervisor error 41, “Hyper-V launch failed; Either VMX not present or not enabled in BIOS.” Huh? I <em>know</em> I enabled the virtualization stuff in the BIOS.</p>
<p><strong>4:06pm</strong>&nbsp;<a href="http://blogs.technet.com/b/11/archive/2008/04/23/running-virtual-machine-in-hpyerv-on-dell-755-box-with-e6550-processor.aspx" target="_blank">This article</a> suggests turning the BIOS options off and back on. And the first comment in <a href="http://www.shnake.com/blog/?p=419" target="_blank">this article</a> says <strong>Trusted Execution</strong> should NOT be checked in the BIOS, which I agree is counter-intuitive. Followed both suggestions, with full power-off, then started Windows.</p>
<p><strong>4:11pm</strong> No error 41 in the event log. Started guest. Failed to start because external drive is not attached to Optiplex. (The guest targets a VHD on that drive for backups.) Use Hyper-V manager to update the settings for the guest, removing that drive from the configuration.</p>
<p><strong>4:13pm</strong> Start guest again. It tells me it had not shut down successfully (it wasn’t shut down at all; it was backed up from a VSS snapshot). Let it Start Windows Normally.</p>
<p><strong>4:16pm</strong> Guest logon prompt. (Took a long time Applying Computer Settings.) After logon, “You must restart your computer to apply these changes.” Clicked Restart Now.</p>
<p><strong>4:20pm</strong> Guest logon prompt. Logged on. Event log looks fairly normal (typical warnings from a startup). Since the guest server has a fixed IP, it automatically is online at the same address as the live server, ready to accept communications from client computers and the Internet. Tested a few components:</p>
<p>Web server works<br />
Active directory works, including accepting logon from client, group policy, folder redirection<br />
Shared drives are available and allow opening QuickBooks data on test server<br />
Email server can retrieve POP mail and send mail</p>
<p>Theoretically at this point I should do a System State restore from the guest’s backup (see my article <a href="http://www.mcbsys.com/techblog/2010/05/careful-with-image-based-backup-of-exchange-and-active-directory/">Careful with Image-Based Backup of Exchange and Active Directory</a>). But I think we’ll call this good for now.</p>
<p><strong>4:33pm</strong> Shut down test server, restart live server host and guest, and re-open port 25 on router to allow inbound email.</p>
<h3>And a little bonus disaster recovery…</h3>
<p>I was anticipating a quick restore of the Optiplex from the Windows Home Server backup. Here’s what happened.</p>
<p><strong>4:53pm</strong> In Optiplex BIOS, set SATA Operation back to <strong>Raid On</strong>. Boot Optiplex from Windows Home Server PC Restore CD. Network driver was missing, but WHS provides an easy way to retrieve the required drivers (by logging on to the WHS console from another computer and copying a the “Windows Home Server Drivers for Restore” folder directly from the WHS backup). Unfortunately that’s the Windows 7 driver, and WHS restore needs the Vista driver.</p>
<p><strong>5:43pm</strong> Vista NIC driver downloaded from Dell support site and supplied via USB stick. WHS restore started.</p>
<p><strong>5:57pm</strong> Restore complete.</p>
<p><strong>5:59pm</strong> Optiplex booted back to Windows 7.</p>
<h3>Conclusions and Notes for Next Time</h3>
<p>Obviously things did not go as smoothly as hoped. Two hours and 20 minutes on the first day plus three hours and 10 minutes on the second day to get a final logon prompt for the Hyper-V guest. Five and a half hours of solid futzing.</p>
<p>The good news is that it did work; in a real disaster, the client would be back in business.</p>
<p>The other good news is that this was a test, which re-affirms the importance of testing your disaster recovery plan. Next time, I’ll know to check a few key things during the restore process:</p>
<ul>
<li>In the Optiplex BIOS, set SATA Operation mode to to <strong>RAID Autodetect / ATA</strong> before starting the restore.</li>
<li>In the Optiplex BIOS, set <strong>Virtualization</strong>, <strong>VT for Direct I/O Access</strong>, and <strong>Execute Disable</strong> to ON, but set <strong>Trusted Execution</strong> to OFF.</li>
<li>Unlock Bitllocker-protected backup drives using <strong>manage-bde</strong> commands above.</li>
<li>If just a blank screen appears after restore, use <strong>diskpart</strong> to assign correct drive letters and set the C: drive as Active.</li>
<li>If BOOTMGR is missing, copy <strong>bootmgr</strong> from C:\Windows\boot\PCAT to C:\.</li>
<li>Once the host starts, update the Hyper-V Virtual Network Manager to point to the new host NIC.</li>
<li>If the guest references unavailable and unneeded hardware (e.g. an external backup drive), remove it from the Hyper-V configuration before starting the guest.</li>
<li>If the guest won’t start because the hypervisor is not running, set it to auto-start using <strong>bcdedit</strong> command above.</li>
</ul>
<p>Maybe I’ll try this again someday and see how fast it goes with all that in mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2011/01/restore-a-hyper-v-server-to-an-optiplex-960/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hyper-V Virtual Machine Failed to Start after Copying VHD</title>
		<link>http://www.mcbsys.com/techblog/2010/10/hyper-v-virtual-machine-failed-to-start-after-copying-vhd/</link>
		<comments>http://www.mcbsys.com/techblog/2010/10/hyper-v-virtual-machine-failed-to-start-after-copying-vhd/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 00:22:53 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/10/hyper-v-virtual-machine-failed-to-start-after-copying-vhd/</guid>
		<description><![CDATA[On Windows Server 2008 R2 running Hyper-V, I copied a VHD to an external drive using Windows Explorer. After compacting the drive, I copied the VHD back to its original location and tried to start the virtual machine. I got a long message telling me that the virtual machine failed to start due to an [...]]]></description>
			<content:encoded><![CDATA[<p>On Windows Server 2008 R2 running Hyper-V, I copied a VHD to an external drive using Windows Explorer. After compacting the drive, I copied the VHD back to its original location and tried to start the virtual machine. I got a long message telling me that the virtual machine failed to start due to an access denied error.</p>
<p> <span id="more-480"></span>
</p>
<h3>The Message</h3>
<p>Here are the important bits of the message, along with the corresponding event IDs in the Hyper-V-Worker Admin event log:</p>
<blockquote><p>‘VM01’ failed to start.</p>
<p>Microsoft Emulated IDE Controller (Instance ID {…}): failed to Power on with Error ‘General access denied error’ (0&#215;80070005). [Event ID 12010]</p>
<p>IDE/ATAPI Account does not have sufficient privilege to open attachment ‘D:\Virtual Machines\VM01\Virtual Hard Disks\DRIVE01.VHD’. Error: ‘General access denied error’ (0&#215;80070005). [Event ID 12290]</p>
<p>‘VM01 failed to start. (Virtual machine ID 6B78D45F5-71DF-4725-B4B2-E651800BE80EF) [Event ID 12030]</p>
</blockquote>
<p>Okay, so I understand that it can’t access the VHD file. But what is the “IDE/ATAPI Account”? I see no such account in the list of available users and groups when I try to modify the VHD file’s permissions using the GUI. What I do see, when I examine the permissions of a working VHD, is what looks like a GUID as a user name with Read and Write permissions:</p>
<p><img title="Hyper-V VHD Permissions GUI" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="239" alt="Hyper-V VHD Permissions GUI" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/10/HyperVVHDPermissionsGUI.png" width="370" border="0" /> </p>
<h3>Virtual Machine SID</h3>
<p>It turns out that the virtual machine’s unique identifier (SID) actually needs direct access to the file. The details are in this Microsoft knowledge base article:</p>
<p>Hyper-V virtual machines may not start, and you receive an error: “‘General access denied error’ (0&#215;80070005)”    <br /><a title="http://support.microsoft.com/kb/2249906" href="http://support.microsoft.com/kb/2249906">http://support.microsoft.com/kb/2249906</a></p>
<h3>Update the Permissions</h3>
<p>The solution is to give the SID Full control of the VHD using the command line. </p>
<p><strong>Tip:</strong> Rather than type (or mistype) the SID by hand, cut and paste it from the event log message or from the XML file name in the Virtual Machines folder.</p>
<p>The command:</p>
<p><code>icacls <var>&lt;Path of .vhd file&gt;</var> /grant &quot;NT VIRTUAL MACHINE\<var>&lt;Virtual Machine SID&gt;</var>&quot;:F</code></p>
<p>Note that there is no space before the <code>:F</code>. For example:</p>
<p><code>icacls &quot;D:\Virtual Machines\VM01\Virtual Hard Disks\DRIVE01.VHD&quot; /grant &quot;NT VIRTUAL MACHINE\6B78D45F5-71DF-4725-B4B2-E651800BE80EF&quot;:F</code></p>
<p>Once that permission has been added, you should be able to start the virtual machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/10/hyper-v-virtual-machine-failed-to-start-after-copying-vhd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hyper-V Failed to Compact VHD</title>
		<link>http://www.mcbsys.com/techblog/2010/10/hyper-v-failed-to-compact-vhd/</link>
		<comments>http://www.mcbsys.com/techblog/2010/10/hyper-v-failed-to-compact-vhd/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 23:28:46 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/10/hyper-v-failed-to-compact-vhd/</guid>
		<description><![CDATA[On Windows Server 2008 R2 running Hyper-V, I&#8217;m trying to compact a (dynamically expanding) VHD on an external hard drive (USB drive, NTFS format). The drive is 59GB and there is 103GB free on the drive. I keep getting the message, &#34;The system failed to compact &#60;MyDrive&#62;.VHD. Error code:&#160; The requested operation could not be [...]]]></description>
			<content:encoded><![CDATA[<p>On Windows Server 2008 R2 running Hyper-V, I&#8217;m trying to compact a (dynamically expanding) VHD on an external hard drive (USB drive, NTFS format). The drive is 59GB and there is 103GB free on the drive. I keep getting the message, &quot;The system failed to compact &lt;MyDrive&gt;.VHD. Error code:&#160; The requested operation could not be completed due to a file system limitation.&quot; Why can’t I compress the VHD?</p>
<p> <span id="more-477"></span>
<p>In the Hyper-V-Image-Management-Service Admin log, we have Event ID 15054:</p>
<p>Log Name:&#160; Microsoft-Windows-Hyper-V-Image-Management-Service-Admin    <br />Source:&#160; Microsoft-Windows-Hyper-V-Image-Management-Service     <br />Event ID:&#160; 15054     <br />Level:&#160; Error     <br />User:&#160; SYSTEM     <br />Description:&#160; &#8216;The system failed to compact &#8216;F:\&lt;MyDrive&gt;.VHD&#8217;. Error Code: 2424869</p>
<p>I thought maybe the physical drive was too fragmented, but a defrag ran quickly and made no difference.</p>
<p>This <a href="http://www.expta.com/2010/06/unable-to-compact-vhd-due-to-file.html" target="_blank">blog post</a> provides the answer:&#160; the VHD contains VSS shadow copies. (It’s a Server 2003 with Volume Shadow Copies enabled.) </p>
<p>Start up the virtual machine and log on to the guest. Run <strong>vssadmin list shadows</strong> to check for shadow copies. Run <strong>vssadmin delete shadows /all</strong> to delete the shadow copies. Then shut down the virtual machine guest and try compacting again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/10/hyper-v-failed-to-compact-vhd/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A Required CD/DVD Drive Device Driver is Missing</title>
		<link>http://www.mcbsys.com/techblog/2010/09/a-required-cddvd-drive-device-driver-is-missing/</link>
		<comments>http://www.mcbsys.com/techblog/2010/09/a-required-cddvd-drive-device-driver-is-missing/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 23:13:47 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/09/a-required-cddvd-drive-device-driver-is-missing/</guid>
		<description><![CDATA[I downloaded a Windows Server 2008 R2 ISO from Microsoft licensing. I inserted the ISO into a a Hyper-V virtual machine and started the installation. Very soon this message appeared in a window:
“A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert [...]]]></description>
			<content:encoded><![CDATA[<p>I downloaded a Windows Server 2008 R2 ISO from Microsoft licensing. I inserted the ISO into a a Hyper-V virtual machine and started the installation. Very soon this message appeared in a window:</p>
<p>“A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.”</p>
<p> <span id="more-449"></span>
<p><img title="PBUMCHV driver needed" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="411" alt="PBUMCHV driver needed" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/09/PBUMCHVdriverneeded1.png" width="554" border="0" /> </p>
<p>A bit strange to see it complaining about a CD/DVD drive when it is reading from an ISO. I spent awhile searching for drivers for the physical CD/DVD etc. until I came across <a href="http://blogs.infosupport.com/blogs/gilfordg/archive/2009/11/26/windows-server-2008-r2-dvd-image-not-recognised-as-known-filesystem.aspx" target="_blank">this post</a> with the answer.</p>
<p>Long story short, the ISO download was incomplete:&#160; it was only about 540MB instead of 2.3GB. I re-downloaded and the installation ran fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/09/a-required-cddvd-drive-device-driver-is-missing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>W32Time Errors in a Hyper-V Virtual Environment</title>
		<link>http://www.mcbsys.com/techblog/2010/08/w32time-errors-in-a-hyper-v-virtual-environment/</link>
		<comments>http://www.mcbsys.com/techblog/2010/08/w32time-errors-in-a-hyper-v-virtual-environment/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 16:55:38 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[time sync]]></category>
		<category><![CDATA[w32time]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/08/w32time-errors-in-a-hyper-v-virtual-environment/</guid>
		<description><![CDATA[I am running Small Business Server 2008 SP2 under Hyper-V. On a Server 2003 member server, also running under Hyper-V, I was getting frequent W32Time warnings errors in the System event log (Event IDs 38, 24, and 29 in that order).

Here are the event details. Note that the first one is recorded as an Information [...]]]></description>
			<content:encoded><![CDATA[<p>I am running Small Business Server 2008 SP2 under Hyper-V. On a Server 2003 member server, also running under Hyper-V, I was getting frequent W32Time warnings errors in the System event log (Event IDs 38, 24, and 29 in that order).</p>
<p><span id="more-408"></span></p>
<p>Here are the event details. Note that the first one is recorded as an Information event but actually indicates an issue.</p>
<p>Event Type:&nbsp;&nbsp;&nbsp; Information<br />
Event Source:&nbsp;&nbsp;&nbsp; W32Time<br />
Event Category:&nbsp;&nbsp;&nbsp; None<br />
Event ID:&nbsp;&nbsp;&nbsp; 38<br />
Description:<br />
The time provider NtpClient cannot reach or is currently receiving invalid time data from SBS2008Server.mydomain.local (ntp.d|192.168.1.25:123-&gt;192.168.1.2:123).</p>
<p>Event Type:&nbsp;&nbsp;&nbsp; Warning<br />
Event Source:&nbsp;&nbsp;&nbsp; W32Time<br />
Event Category:&nbsp;&nbsp;&nbsp; None<br />
Event ID:&nbsp;&nbsp;&nbsp; 24<br />
Description:<br />
Time Provider NtpClient: No valid response has been received from domain controller SBS2008Server.mydomain.local after 8 attempts to contact it. This domain controller will be discarded as a time source and NtpClient will attempt to discover a&nbsp; new domain controller from which to synchronize.</p>
<p>Event Type:&nbsp;&nbsp;&nbsp; Error<br />
Event Source:&nbsp;&nbsp;&nbsp; W32Time<br />
Event Category:&nbsp;&nbsp;&nbsp; None<br />
Event ID:&nbsp;&nbsp;&nbsp; 29<br />
Description:<br />
The time provider NtpClient is configured to acquire time from one or more time sources, however none of the sources are currently accessible.&nbsp; No attempt to contact a source will be made for 15 minutes. NtpClient has no source of accurate time.</p>
<h3>Analysis</h3>
<p>The SBS machine is the domain controller, so it’s also the default NTP server.</p>
<p>I had already followed <a href="http://blogs.technet.com/b/vikasma/archive/2008/07/24/hyper-v-best-practices-quick-tips-2.aspx" target="_blank">Hyper-V best practices for domain controllers</a> by disabling Time Synchronization and setting the SBS machine to sync with an external source. That’s working fine.</p>
<p>Client computers in the domain, both physical and virtual, were not reporting time sync errors even though they also get time from SBS (Type is NT5DS; see <a href="http://www.mcbsys.com/techblog/2010/05/check-windows-time-settings/" target="_blank">how to check this</a>). So why can’t Server 2003 sync time as well?</p>
<p>Microsoft KB <a href="http://support.microsoft.com/kb/875424" target="_blank">875424</a>, “Time synchronization may not succeed when you try to synchronize with a non-Windows NTP server in Windows Server 2003,” describes the symptoms pretty well except for the “non-Windows” part. But even after putting the Server 2003 machine into “client mode” (<strong>/syncfromflags:MANUAL</strong>) pointed directly at the domain controller, the time sync errors continued. So I set it back to domain mode (<strong>/syncfromflags:DOMHIER</strong>).</p>
<p>I turned on time service logging as described in Microsoft KB <a href="http://support.microsoft.com/kb/816043" target="_blank">816043</a>. Didn’t learn much here except that SBS is returning time packets with Precision: –6, so the <a href="http://www.mcbsys.com/techblog/2007/11/hotfix-lets-w32time-sync-with-very-high-precision-ntp-servers/" target="_blank">issue I had a few years ago</a> with very high precision servers is not the problem here.</p>
<h3>Solution</h3>
<p>Eventually I noticed that when starting the Windows Time Service, I would get an event indicating that time was being synchronized with the Hyper-V integration services provider:</p>
<p>Event Type:&nbsp;&nbsp;&nbsp; Information<br />
Event Source:&nbsp;&nbsp;&nbsp; W32Time<br />
Event Category:&nbsp;&nbsp;&nbsp; None<br />
Event ID:&nbsp;&nbsp;&nbsp; 35<br />
Description:<br />
The time service is now synchronizing the system time with the time source VM IC Time Synchronization Provider.</p>
<p>A little more Googling and I found <a href="http://serverfault.com/questions/24298/w32time-sync-problems-for-hyper-v-guests-w32time-event-ids-38-24-29-35" target="_blank">this article</a> suggesting that the solution is to disable Time Synchronization on <em>all</em> Hyper-V guests, not just on domain controllers. Once I disabled the Time Synchronization integration service on the Server 2003 machine and rebooted, the errors stopped.</p>
<p>I still don’t know why Hyper-V Time Synchronization integration service causes the standard domain-based time synchronization to fail (why not play nicely together?), but disabling Hyper-V Time Synchronization on all virtual machines seems to solve the problem.</p>
<h3>Bonus Tip:&nbsp; Time Sync on the Hyper-V Server</h3>
<p>All the machines above are running on Windows Server 2008 R2 as the Hyper-V host. Follow Microsoft’s recommendation, the host is <em>not</em> joined to the domain since the domain controller is running as a guest. To keep the host’s time in sync, I set it to client mode and pointed it at the SBS domain controller. This command sequence does the trick:</p>
<p><code>sc triggerinfo w32time start/networkon stop/networkoff<br />
</code><code>w32tm /config /manualpeerlist:<var>SBS_server_IP_Address</var>,0x8 /syncfromflags:MANUAL<br />
net stop w32time<br />
net start w32time<br />
w32tm /resync</code><code><br />
</code></p>
<p><strong>Note:</strong>&nbsp; If you get a message that the Windows Time service is not running, from <strong>services.msc</strong>, set it to Automatic and start it. For more details, see this <a title=" Windows Time Stops Even When Set to Start Automatically" href="http://www.mcbsys.com/techblog/2010/09/windows-time-stops-even-when-set-to-start-automatically/" target="_self">later blog post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/08/w32time-errors-in-a-hyper-v-virtual-environment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ShadowProtect Fails Reading Hyper-V Pass-Through Disk</title>
		<link>http://www.mcbsys.com/techblog/2010/07/shadowprotect-fails-reading-hyper-v-pass-through-disk/</link>
		<comments>http://www.mcbsys.com/techblog/2010/07/shadowprotect-fails-reading-hyper-v-pass-through-disk/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 16:51:33 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[shadowprotect]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/07/shadowprotect-fails-reading-hyper-v-pass-through-disk/</guid>
		<description><![CDATA[I decided to use ShadowProtect to do a physical-to-virtual (P2V) move of an SBS 2003 machine. I booted the SBS 2003 machine from a ShadowProtect 3.5 CD and created offline images of the SBS 2003 partitions. I stored the ShadowProtect images on a simple USB drive formatted with NTFS and a 16KB cluster size. I [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to use ShadowProtect to do a physical-to-virtual (P2V) move of an SBS 2003 machine. I booted the SBS 2003 machine from a ShadowProtect 3.5 CD and created offline images of the SBS 2003 partitions. I stored the ShadowProtect images on a simple USB drive formatted with NTFS and a 16KB cluster size. I used the default compression and did not encrypt the backup.</p>
<p>Next I moved the USB drive to a machine running Windows Server 2008 R2 with Hyper-V. In Disk Management, I set the drive Offline, then in Hyper-V Manager I attached the drive to a virtual machine as a pass-through disk. Finally I booted the Hyper-V virtual machine from a ShadowProtect 3.5.2 ISO file.<br />
<span id="more-240"></span></p>
<h3>The Issue</h3>
<p>Since I was restoring a Server 2003 image, I used the ShadowProtect legacy recovery environment. I did not let it load the network since all drives were local to the VM. I started a restore of the boot partition from a ShadowProtect image file. After a minute the restore failed with a cyclic redundancy error 23. I tried to verify the various image files, and the verifies failed with a message that the files were corrupt. I rebooted from the CD several times but the results were always the same:&nbsp; ShadowProtect sees the files and may even start to read or verify one, but soon the read fails.</p>
<h3>The Network Workaround</h3>
<p>I decided to try the workaround I remembered from Virtual PC (which does not have pass-through disks). First I removed the pass-through disk from the Hyper-V VM, then set it Online in Disk Management. Then I booted into the ShadowProtect legacy environment <em>with</em> networking. Finally I started the restore over the network, attaching from inside the VM to the ShadowProtect image files on the host machine (e.g. \\HOST\R$\C_VOL.spf). This time I was able to restore three partitions with no errors.</p>
<p><strong>Note</strong> In order for the ShadowProtect recovery environment to see the Hyper-V network, you have to set up the Hyper-V virtual machine with a Legacy Network Adapter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/07/shadowprotect-fails-reading-hyper-v-pass-through-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Format Drive During Server 2008 Install</title>
		<link>http://www.mcbsys.com/techblog/2010/06/custom-format-drive-during-server-2008-install/</link>
		<comments>http://www.mcbsys.com/techblog/2010/06/custom-format-drive-during-server-2008-install/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 01:58:10 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[sbs]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/06/custom-format-drive-during-server-2008-install/</guid>
		<description><![CDATA[I’m installing SBS 2008 in a Hyper-V VM. I want the system partition to be formatted with 16KB allocation unit (cluster) size. Whether that turns out to be a good idea or not is another discussion. The question here is, how do I even do that during the SBS 2008 installation? The standard “Format” button [...]]]></description>
			<content:encoded><![CDATA[<p>I’m installing SBS 2008 in a Hyper-V VM. I want the system partition to be formatted with 16KB allocation unit (cluster) size. Whether that turns out to be a good idea or not is another discussion. The question here is, how do I even <em>do</em> that during the SBS 2008 installation? The standard “Format” button doesn’t offer the option to change allocation unit size.</p>
<p>Here’s the workaround.</p>
<h3><span id="more-210"></span>Step 1:&nbsp; Create the Partition</h3>
<p>When you get to this screen during the install, click on New to create a partition. I decide to leave 2GB unallocated on the first VHD in case I want to set up Bitlocker later: (Remember this is Server 2008, not R2, which automatically creates an extra system partition in advance.)</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup1.png"><img style="display: inline; border-width: 0px;" title="SBS08 Setup 1" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup1_thumb.png" border="0" alt="SBS08 Setup 1" width="244" height="184" /></a></p>
<h3>Step 2:&nbsp; Click Shift-F10 to Format</h3>
<p>Here’s the “trick”:&nbsp; click on <strong>Shift-F10</strong> to get a command prompt. Then enter the following commands to format the drive&nbsp; (making sure that you select the correct partition once inside <strong>diskpart</strong>):</p>
<p style="padding-left: 30px;">diskpart<br />
list disk<br />
select disk 0<br />
list partition<br />
select partition 1<br />
format fs=ntfs label=&#8221;SBS-os&#8221; quick unit=16K<br />
assign letter=C<br />
exit [from diskpart]<br />
exit [from the command prompt]</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup2.png"><img style="display: inline; border-width: 0px;" title="SBS08 Setup 2" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup2_thumb.png" border="0" alt="SBS08 Setup 2" width="244" height="176" /></a></p>
<h3>Step 3: Select the Partition and Continue</h3>
<p>Click on Refresh or press F5 to confirm that your newly named partition is there, then click on Next to continue the installation. If you are asked about creating a system partition, click on OK.</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup3.png"><img style="display: inline; border-width: 0px;" title="SBS08 Setup 3" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/SBS08Setup3_thumb.png" border="0" alt="SBS08 Setup 3" width="244" height="183" /></a></p>
<p><strong>Note:</strong>&nbsp; the first time I tried this, I used the <strong>format</strong> command instead of <strong>diskpart</strong>. But for some reason that did not allow the 78GB partition to be recognized as a system partition, so the installation failed and I had to start over.</p>
<p><strong>Update:&nbsp;</strong> Even easier when working with a Server 2008 R2 host:&nbsp; before starting the installation of the client, <a title="Mount a VHD Within Windows 7 / Server 2008 R2 " href="http://thelazyadmin.com/blogs/thelazyadmin/archive/2009/01/15/mount-a-vhd-within-windows-7-server-2008-r2.aspx" target="_blank">attach the VHD in the host</a> and format there. The above should work if your host is Server 2008 (not R2) or for installation on (gasp!) a physical server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/06/custom-format-drive-during-server-2008-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hyper-V Core Configurator Does Not Show Paused VMs</title>
		<link>http://www.mcbsys.com/techblog/2010/06/hyper-v-core-configurator-does-not-show-paused-vms/</link>
		<comments>http://www.mcbsys.com/techblog/2010/06/hyper-v-core-configurator-does-not-show-paused-vms/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 19:15:57 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[Core Configurator]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[Paused Virtual Machine]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2010/06/hyper-v-core-configurator-does-not-show-paused-vms/</guid>
		<description><![CDATA[I’ve been running PBX in a Flash under the free version of Microsoft Hyper-V Server 2008 R2 for several months (blogged earlier). This week, I’ve added a couple test machines to the Hyper-V server.
Today I came in to see monitoring emails telling me that PBX had gone off- and online several times overnight. Sure enough, [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been running PBX in a Flash under the free version of Microsoft Hyper-V Server 2008 R2 for several months (<a href="http://www.mcbsys.com/techblog/2010/02/pbx-in-a-flash-as-a-virtual-machine-take-2-hyper-v/" target="_blank">blogged</a> earlier). This week, I’ve added a couple test machines to the Hyper-V server.</p>
<p>Today I came in to see monitoring emails telling me that PBX had gone off- and online several times overnight. Sure enough, when I pick up the phone:&nbsp; no dial tone. What happened?</p>
<p><span id="more-191"></span>I logged on to the Hyper-V host and started <a href="http://coreconfig.codeplex.com/" target="_blank">Core Configurator 2.0</a> and was a little alarmed to see that my PBX isn’t even listed as a virtual machine at all:</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/HyperV.CoreConfig.MissingVMsandNetwork.png"><img style="display: inline; border-width: 0px;" title="Hyper-V.CoreConfig.Missing VMs and Network" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/HyperV.CoreConfig.MissingVMsandNetwork_thumb.png" border="0" alt="Hyper-V.CoreConfig.Missing VMs and Network" width="239" height="244" /></a></p>
<p>What? The PBX has disappeared entirely? Fortunately I also have Hyper-V Manager set up on a Windows 7 machine. This gave me the more complete picture:&nbsp; the PBX, and a Vista Business test machine, were in a “Paused” state:</p>
<p><img style="display: inline; border: 0px;" title="Hyper-V.Manager.VMs Paused" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/HyperV.Manager.VMsPaused1.png" border="0" alt="Hyper-V.Manager.VMs Paused" width="500" height="128" /></p>
<h2>Lost in Space</h2>
<p>Next I fired up Server Manager, attached to the Hyper-V host, and started wading through the Hyper-V logs. Finally I found what I was looking for under</p>
<p style="padding-left: 30px;">Applications and Services Logs &gt; Microsoft &gt; Windows &gt; Hyper-V-VMMS &gt; Admin</p>
<p>where I saw this event:</p>
<p style="padding-left: 30px;">Log Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Hyper-V-VMMS-Admin<br />
Source:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Hyper-V-VMMS<br />
Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/18/2010 4:15:52 AM<br />
Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16060<br />
Level:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error<br />
User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYSTEM<br />
Computer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HYPERVSERVER01<br />
Description: &#8216;PBX&#8217; has been paused because it has run out of disk space on &#8216;D:\Virtual Machines\pbx\Virtual Hard Disks\&#8217;. (Virtual machine ID 8FD97E3F-90A2-45B6-8A35-58C1EEBA8B3C)</p>
<p>Sure enough, drive D was full. That Vista Business test machine had expanded its drive overnight during auto-updates. I moved some VHDs to another drive and was able to get the PBX running again. What I don’t fully understand is why the PBX, which has a fixed-size VHD, was paused due to space issues on the host volume.</p>
<h2>Core Configurator Limitations</h2>
<p>Looking more closely at the Core Configurator, I see that it only shows Running and Stopped Virtual Machines, so Paused machines are not included. It would be nice if that bottom window would show Paused <em>and</em> Stopped Virtual Machines.</p>
<p>In the same dialog, I also noticed that Core Configurator only lists one Network Switch, even though I have two installed, as seen in Hyper-V Manager:</p>
<p><img style="display: inline; border-width: 0px;" title="Hyper-V.Manager.Networ Switcheks" src="http://www.mcbsys.com/techblog/wp-content/uploads/2010/06/HyperV.Manager.NetworSwitcheks_thumb.png" border="0" alt="Hyper-V.Manager.Networ Switcheks" width="244" height="114" /></p>
<p>I assume Core Configurator is not showing the second switch because I have unchecked “Allow management operating system to share this network adapter”. Again it would be nice to see the same information in Core Configurator as shown in Hyper-V Manager.</p>
<p>Core Configurator adds a wealth of features that would otherwise be very difficult to access on a Hyper-V Server machine. But you’ll still need a remote management machine running Hyper-V Manager to get the complete picture of the virtual machines, and remote Server Manager to see the host’s event logs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/06/hyper-v-core-configurator-does-not-show-paused-vms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PBX in a Flash as a Virtual Machine, Take 2: Hyper-V</title>
		<link>http://www.mcbsys.com/techblog/2010/02/pbx-in-a-flash-as-a-virtual-machine-take-2-hyper-v/</link>
		<comments>http://www.mcbsys.com/techblog/2010/02/pbx-in-a-flash-as-a-virtual-machine-take-2-hyper-v/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:21:20 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freepbx]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pbx]]></category>
		<category><![CDATA[pbx in a flash]]></category>
		<category><![CDATA[piaf]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">/mark/post/PBX-in-a-Flash-as-a-Virtual-Machine-Take-2-Hyper-V.aspx</guid>
		<description><![CDATA[Back in November 2008, I blogged&#160; about Setting Up PBX in a Flash, Part 1: Configuring a Virtual Machine. That article discussed running PBX in a Flash (PiaF) under Microsoft Virtual PC or Virtual Server 2005. Within a couple weeks, I abandoned the virtual machine approach and published Moving PBX in a Flash from a [...]]]></description>
			<content:encoded><![CDATA[<p>Back in November 2008, I blogged&nbsp; about <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-1-Configuring-a-Virtual-Machine.aspx" target="_blank">Setting Up PBX in a Flash, Part 1: Configuring a Virtual Machine</a>. That article discussed running PBX in a Flash (PiaF) under Microsoft Virtual PC or Virtual Server 2005. Within a couple weeks, I abandoned the virtual machine approach and published <a href="http://blogs.mcbsys.com/mark/post/Moving-PBX-in-a-Flash-from-a-Virtual-to-a-Physical-Machine.aspx">Moving PBX in a Flash from a Virtual to a Physical Machine</a>.</p>
<p>Recently I&#8217;ve been testing Microsoft&#8217;s free bare-metal hypervisor, <a href="http://www.microsoft.com/hyper-v-server/en/us/default.aspx">Microsoft Hyper-V Server 2008 R2</a>. Especially now that <a href="http://www.microsoft.com/windowsserver2008/en/us/hyperv-supported-guest-os.aspx" target="_blank">Hyper-V supports Red Hat Enterprise Linux</a>, could Hyper-V be the answer to virtualizing PiaF on a Microsoft platform?</p>
<p>Let&#8217;s try it and see what happens.</p>
<p><span id="more-13"></span></p>
<h1>Setting Up CentOS under Hyper-V Server 2008 R2</h1>
<p>I&#8217;ll assume you have Hyper-V Server installed and running. Follow these steps to set up CentOS under Hyper-V Server using the PiaF installation ISO:</p>
<ol>
<li>Set up a new virtual machine with 512MB of memory, a 10GB virtual IDE hard disk (for servers, I&#8217;m told that fixed disks perform better than dynamic disks), and a connected <em>legacy</em> network card. Note that the fixed disk and legacy card cannot be configured through the New Virtual Machine Wizard; you&#8217;ll have to modify the settings once the virtual machine exists.</li>
<li><a href="http://www.pbxinaflash.com/downloads/" target="_blank">Download</a> the PBX in a Flash 1.4 ISO file. Attach the ISO to the virtual machine&#8217;s DVD-ROM drive (Media &gt; DVD Drive) and start the machine.</li>
<li>At the first install prompt, type <code>ksalt</code>. This starts the install in text mode, which avoids an issue with 24-bit video. It also does not use the LVM file system, which apparently adds unnecessary overhead (according to <a href="http://pbxinaflash.com/forum/showthread.php?t=2469" target="_blank">jroper</a>). I deliberately chose a very simple root password during the setup so I could take this virtual machine to client sites one day if needed.</li>
<li>Toward the end of the installation, you&#8217;ll see that CentOS is &#8220;Installing bootloader,&#8221; then the install reboots. As soon as the reboot starts, quickly select Media &gt; DVD Drive &gt; Eject. If you miss this, the install will start over.</li>
<li>After the boot completes, you&#8217;ll be prompted about which PiaF &#8220;payload&#8221; to use. Choose &#8220;A&#8221; for the latest stable release via the Internet. The download goes quickly but it does take awhile to compile Zaptel, Asterisk, etc. Once that completes, the system reboots again.</li>
<li>When this reboot completes (you&#8217;ll see the &#8220;pbx login&#8221; prompt), shut down the machine by sending a Ctrl-Alt-Del from Hyper-V Server and stopping the machine when it is at the BIOS startup stage. Use Hyper-V Manager to Export a copy of your virtual machine at this point, so you can come back to this point if you encounter problems with the steps below. (A snapshot would also work but an export can be imported at another location.) I&#8217;m testing the free <a href="http://www.7-zip.org/" target="_blank">7-Zip</a> for creating a compressed copy of the exported virtual machine. (To install the 64-bit version of 7-Zip 4.65 under Hyper-V Server 2008 R2, run the installer on the server by typing <code>msiexec /i 7z465-x64.msi</code>&nbsp; at a command prompt.) Name the compressed file something like &#8220;PiaF.1.Immediately after CentOS Install.zip&#8221;.</li>
<li>Start the virtual machine and log on to CentOS. Make sure that CentOS is connected to the network. At a command prompt:<br />
<code>/sbin/ifconfig</code> # check whether an IP address has been assigned; if so, skip the rest of this step<br />
<code>system-config-network</code> # if you need to check the network setup<br />
<code>nano -w /etc/sysconfig/network-scripts/ifcfg-eth0</code> # view network setup in text form<br />
<code>service network restart</code> # restart with updated network setup if you made changes<br />
<code>/sbin/ifconfig</code> # check that an IP address has now been assigned</li>
<li>Add the kernel options. I tried using <a href="http://kb.vmware.com/kb/1006427" target="_blank">VMWare&#8217;s recommendations</a>, since they have specific advice on CentOS 5.2. The <a href="http://bugs.centos.org/view.php?id=2189" target="_blank">CentOS bug report</a> seems to confirm that the kernel options <code>divider=10 clocksource=acpi_pm</code> should take care of the clock cycle issue without the need for a &#8220;vm&#8221; kernel (compiled with a 100Hz clock instead of 1000Hz). However, after making that change, I was getting <em>lots</em> of messages reading, &#8220;rtc lost some interrupts at 1024hz&#8221;. So I&#8217;m going back to my <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-1-Configuring-a-Virtual-Machine.aspx" target="_blank">original procedure posted in November 2008</a>:<br />
<code>nano -w /boot/grub/menu.lst</code>&nbsp;<br />
At the end of the &#8220;kernel&#8221; line, add this string:<br />
<code><code>clocksource=pit nosmp noapic nolapic</code></code></li>
<li>Update the kernel with the CentOS Virtual Machine kernel. This is <a href="http://www.pbxinaflash.com/vm/">outlined on the PiaF site</a>, but do <em>not</em> recompile Zaptel as instructed there. The &#8220;vm&#8221; kernels are available <a href="http://dev.centos.org/%7Etru/kernel-vm/5/RPMS/i386/">here</a>. Note:&nbsp; choose the version that matches your current kernel. Here are the download and install commands:<br />
<code>cd /root</code><br />
<code>uname -r</code> # Check your Linux version. Modify the next two lines to match.<br />
<code>wget http://dev.centos.org/~tru/kernel-vm/5/RPMS/i386/kernel-vm-2.6.18-92.1.22.el5.i686.rpm</code><br />
<code>wget http://dev.centos.org/~tru/kernel-vm/5/RPMS/i386/kernel-vm-devel-2.6.18-92.1.22.el5.i686.rpm</code><br />
<code>rpm -ivh kernel-vm*.rpm</code></li>
<li>Edit grub to make the new kernel load by default.<br />
<code>nano -w /boot/grub/menu.lst</code><br />
In this file, set <code>default=0</code> if the .e15vm kernel is listed first. After saving the file, reboot.<br />
<code>shutdown -r now<br />
</code></li>
<li>After the reboot, check the Linux version to make sure it ends in &#8220;vm&#8221;:<br />
<code>uname -r<br />
</code></li>
<li>You can confirm that the <code>clocksource</code> is set to <code>pit</code> using the method suggested in <a href="http://fixunix.com/hardware/243541-what-clock-source-my-kernel-using.html" target="_blank">this thread</a>:<br />
<code>cat /sys/devices/system/clocksource/clocksource0/current_clocksource</code></li>
</ol>
<p>After these changes, I no longer have any time errors appearing on the virtual machine console, even when left on overnight.</p>
<h1>Installing Microsoft Linux Integration Components for Windows Server 2008 Hyper-V R2</h1>
<p>You&#8217;ll need to <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c299d675-bb9f-41cf-b5eb-74d0595ccc5c&amp;displaylang=en" target="_blank">download</a> and install the Linux Integration Components for Windows Server 2008 Hyper-V R2. There are some significant differences here from the old VM Additions for Linux that worked with Virtual Server. Two notable changes are that the Integration Components for Hyper-V no longer include time synchronization or shutdown integration. However, we should benefit from the enhanced network and disk drivers.</p>
<p><span style="color: #0000ff;">Update 9/30/2010:</span>&nbsp; This article was written using V2 of the Linux Integration Components. See the comments for links to later version(s).</p>
<p>One &#8220;gotcha&#8221; right out of the gate:&nbsp; to extract the ISO needed to install the Integration Components, you must run the downloaded Linux_IC_v2.EXE file. In spite of its claim to be a Win32 Cabinet Self-Extractor, when I tried to run it on my 32-bit XP machine, it tells me that is is not &#8220;not a valid Win32 application.&#8221; Windows 7 (32-bit) gives a similar error. Once I copied the file to my 64-bit Hyper-V Server 2008 R2 machine, I was able to extract the ISO.</p>
<p>The package includes a helpful readme in PDF format. Since CentOS is based on Red Hat, follow the section titled, &#8220;Installing the Linux Integration Components Version 2 on Red Hat Enterprise Linux 5.&#8221; Here&#8217;s the trimmed-down version:</p>
<ol>
<li>Normally you would need to run <code>yum update kernel</code>, reboot, then run <code>yum install kernel-devel gcc</code> to get the kernel source. However, it seems that the PiaF already includes the kernel source, so this step is not needed with PiaF.</li>
<li>From Hyper-V Manager, start your PiaF virtual machine. Then select Media &gt; DVD Drive &gt; Insert Disk and load the extracted LinuxIC_v2.ISO file.</li>
<li>Log on to the virtual machine. Mount the drive and copy the files to a new directory as follows:<br />
<code>mkdir /media/cdrom</code><br />
<code>mount /dev/cdrom /media/cdrom</code><br />
<code>mkdir /usr/src/linux_ic_v2</code><br />
<code>cp /media/cdrom/* /usr/src/linux_ic_v2 -R</code> # -R to recursively copy directories<br />
<code>umount /dev/cdrom</code><br />
You can eject the ISO image from the virtual machine at this point.</li>
<li>Install the synthetic drivers. No reboot is required here.<br />
<code>cd /root&nbsp; </code># install won&#8217;t run if you are in the source folder, so make sure we&#8217;re at root folder<br />
<code>/usr/src/linux_ic_v2/setup.pl drivers<br />
</code></li>
<li>Verify that the installation succeeded.<br />
<code>/sbin/lsmod | grep vsc</code><br />
The output should look something like this:<br />
<code>netvsc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 45616&nbsp; 0</code><br />
<code>storvsc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 37028 0</code><br />
<code>vmbus&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 56520&nbsp; 2 netvsc,storvsc</code><br />
<code>scsi_mod&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 134605&nbsp; 3 storvsc,libata,sd_mod</code></li>
<li>Configure the synthetic network card (seth0).<br />
<strong>Note:</strong>&nbsp; do this from the Hyper-V Manager connection directly, not through a remote connection like Putty.<br />
So far you probably have one Legacy Network Adapter configured for the VM. From Hyper-V Manager, set that adapter to &#8220;Not connected&#8221;, then set a <em>non</em>-legacy network adapter to an active connection. (You can do this while the VM is online, but you&#8217;ll have to wait until shutdown to actually remove the legacy adapter.) Finally, make the corresponding changes inside the virtual machine.<br />
<code>nano -w /etc/sysconfig/network-scripts/ifcfg-eth0</code> #<br />
Disable the legacy card:&nbsp; set<br />
<code>ONBOOT=no<br />
</code>After saving the file:<br />
<code>service network restart</code> # restart with updated network setup<br />
<code>/sbin/ifconfig</code> # eth0 should be gone; check that an IP address has now been assigned to seth0</li>
<li>Check the Fastpath boot setup. When you run the following command, you should see that <code>hda=noprobe</code> and <code>hdb=noprobe</code> have been added to your kernel boot options. Copy these options to the non-vm kernel line in case you ever need to boot from it:<br />
<code>nano -w /boot/grub/menu.lst</code>&nbsp;</li>
</ol>
<p>As mentioned, the Linux Integration Components don&#8217;t support shutdown from the Hyper-V host. However Hyper-V is able to <em>save</em> a PiaF guest within a few seconds. I plan to try that as my Automatic Stop Action in Hyper-V Settings. Restarting a saved machine may cause problems until the clock is resynchronized (see NTP below), but it seems preferable to just &#8220;pulling the plug&#8221; if, for example, the UPS needs to shut down the host due to a power outage.</p>
<h1>Tweaking NTP</h1>
<p>With Virtual Server 2005, I disabled NTP and relied on the time to sync to the host. The Hyper-V extensions do not include time synchronization, so follow the instructions near the bottom of <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1006427" target="_blank">this VMWare document</a> for doing so:</p>
<p>Since we have conflicting advice, and nothing definitive for Microsoft Virtual Server, I&#8217;ve decided to try the following:</p>
<ol>
<li>Open the NTP configuration file:<br />
<code>nano -w /etc/ntp.conf</code></li>
<li>Add the following as the first line in the file (&#8220;instructs NTP not to give up if it sees a large jump in time&#8221;):<br />
<code>tinker panic 0</code></li>
<li>Comment out these two lines (prevent fallback to the &#8220;undisciplined local clock&#8221;):<br />
<code>#server 127.127.1.0 # local clock</code><br />
<code>#fudge 127.127.1.0 stratum 10</code></li>
<li>Restart the NTP daemon:<br />
<code>service ntpd restart</code></li>
</ol>
<p>At this point you should have a working CentOS installation under Hyper-V that can more or less tell time. Check the time by typing <code>date</code> at the command prompt and comparing it to the clock on your host system.</p>
<p>On startup I do see some NTP messages reading, &#8220;ntpd[1970]: frequency error 512 PPM exceeds tolerance 500 PPM,&#8221; but this does not seem to keep NTP from syncing the time. I&#8217;ll have to check this occasionally to make sure the clock isn&#8217;t drifting too much. This command will show the last 100 ntpd messages:</p>
<p><code>tail -100 /var/log/messages | grep ntpd --color</code></p>
<h1>Moving from Physical to Virtual</h1>
<p>Most of the remaining setup steps have been covered in other posts, but there&#8217;s a huge shortcut if you are just moving from one PiaF machine to another. Here are the steps you&#8217;ll want to follow.</p>
<h2>Finishing the CentOS Configuration</h2>
<p>Follow the steps in <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-2-Before-Running-FreePBX.aspx">Setting Up PBX in a Flash, Part 2:&nbsp; Before Running FreePBX</a> to complete the CentOS configuration. A few tips to keep in mind:</p>
<ul>
<li>You may want to temporarily give the new machine its own IP address in your router so you can have both the old and new machines online during the steps below. There should be no issue giving the new machine the same host name as the old machine.</li>
<li>You can use the temporary IP address to access the new machine, so you don&#8217;t need to set up a special name in your DNS server.</li>
<li>If you want to save your work as you go, shut down the virtual machine and user Hyper-V Manager to either take a snapshot and/or export the virtual machine.</li>
</ul>
<h2>Copying the tftp Setup</h2>
<p>If you&#8217;re using tftp, review <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-a-Polycom-IP-430-Phone-with-FreePBX.aspx">Setting Up a Polycom IP 430 Phone with FreePBX</a> for details on the tftp setup. Since my system is not open to the network, I allow writing to the tftpboot folder. Follow these steps to copy the tftp setup:</p>
<ol>
<li>Open access to tftpboot:<br />
<code>chmod 777 /tftpboot</code></li>
<li>Use <a href="http://winscp.net" target="_blank">WinSCP</a> to copy the contents of the tftp configuration file, <code>/etc/xinetd.d/tftp</code>, from your physical your Windows desktop, then paste it into the same file on the virtual machine.</li>
<li>Use WinSCP to copy all the files in <code>/tftpboot</code> from the physical machine to the virtual machine.</li>
</ol>
<h2>Updating the FreePBX Configurations</h2>
<p>The shortcut will be to copy the configuration from the old, physical machine to the new, virtual machine. To make sure this goes smoothly, let&#8217;s first get the base configuration of the two machines to match.</p>
<h3>Update the Physical Machine</h3>
<p>On the old, physical machine, update all installed modules to the latest versions:</p>
<ol>
<li>In a browser, open the IP address or DNS name of the old PBX.</li>
<li>From the PBX in a Flash menu, in the lower left corner, click on Admin. This adds a few buttons to the screen.</li>
<li>Click on the FreePBX Administration button. Type <code>maint</code> as the user name. Use the password that you assigned using <code>passwd-master</code> near the end of <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-2-Before-Running-FreePBX.aspx">part 2</a>. This loads the main FreePBX administration screen, which will be our starting point for the rest of the tasks this article. You might want to bookmark this page so you can return here directly without going through the PiaF button top-level screen.</li>
<li>The left column has two tabs, Setup and Tools. From the Setup tab, click on Module Admin. This shows the list of currently-installed modules.</li>
<li>At the top of the Module Administration page, click on the link Check for Updates Online. Now you will see <em>all</em> modules that are available.</li>
<li>Click on the Upgrade All link (<em>not</em> Download All). This simply selects all upgradable modules; it doesn&#8217;t start the download and upgrade process.</li>
<li>Scroll to the bottom of the page. Click on Process. Scroll to the bottom of <em>that</em> page. Click on Confirm. An orange popup window appears where you can monitor the progress of the installations. After a few minutes, when you scroll to the bottom of the orange popup, you&#8217;ll see a Return link. Click on Return.</li>
</ol>
<h3>Update the Virtual Machine</h3>
<p>Log on to the new, virtual machine, and follow the steps in the first section of the <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-3-Configuring-FreePBX.aspx" target="_blank">Step 3</a> article, &#8220;Updating and Adding FreePBX modules.&#8221; <em>Install the same modules on the new machine as are installed on the old machine.</em></p>
<p><strong>Tip:</strong>&nbsp; I found it simplest to install <em>all</em> the modules on the new machine, then go back and uninstall the ones that are not installed on the old machine.</p>
<p>Now that both machines have the same FreePBX modules installed, we are ready to copy the configuration.</p>
<h2>Copy the Configuration from Old to New</h2>
<p>Follow these steps to use the FreePBX Backup &amp; Restore utility to copy your entire configuration from the old to the new machine:</p>
<ol>
<li>On the old machine, from the FreePBX administration screen, go to the Tools tab, Backup &amp; Restore. Add a Backup Schedule named OnDemand. Back up all sections (Voice Mail, System Recordings, System Configuration, CDR, and Oeprator Panel). Set the Run Backup time to Now and click on Submit Changes.</li>
<li>Using WinSCP, copy the new backup file from <code>/var/lib/asterisk/backups/OnDemand</code> to your Windows desktop. The file will have a timestamp as its name and end in <code>.tar.gz.</code><br />
<strong>Note:</strong>&nbsp; Do not rename the backup file! I thought I would be clever and give it a more meaningful name. This caused the restore to fail, probably because the restore expects the <code>.tar</code> file inside the <code>.tar.gz</code> file to have the same name as the <code>.tar.gz</code> file.</li>
<li>On the new machine, from the FreePBX administration screen, also create a backup called OnDemand. This is mostly done so FreePBX will create the OnDemand directory and will know to look for backups in that directory.</li>
<li>Use WinSCP to copy the old machine&#8217;s backup file from your Windows desktop to <code>/var/lib/asterisk/backups/OnDemand</code> on the new machine.</li>
<li>On the new machine, from the FreePBX administration screen, , go to the Tools tab, Backup &amp; Restore. Click on Restore from Backup and navigate down to the OnDemand directory and to the old machine&#8217;s backup file (make sure the time stamp matches the backup from the old machine.) Choose Restore Entire Backup Set, and confirm that you want to overwrite all FreePBX and Asterisk files.</li>
<li>When the restore completes, click on the orange Apply Configuration Changes. Your new system should now match your old system exactly! In the Setup tab, check some known values (Extensions, Trunks, Inbound Routes) to be sure.</li>
<li>For some reason, the configuration backup/restore does not include the <code>/etc/amportal.conf</code> file. If you&#8217;ve customized this file (e.g. to specify the AMPWEBADDRESS or to send backups to an FTP server), copy the file from the old machine to the new machine using WinSCP.</li>
</ol>
<h2>Cut Over from Physical to Virtual</h2>
<p>If you manage your IP addresses through your router, this last bit is easy:</p>
<ol>
<li>Shut down both your old, physical machine and your new, virtual machine.</li>
<li>Optional:&nbsp; in Hyper-V Manager, Export the fully-configured virtual machine. Back up this export so you can return to this state later.</li>
<li>In your router, in the list that maps MAC addresses to IP addresses, note down the IP address of the physical machine and then delete it from the (or assign it an IP that is not in use).</li>
<li>Also in the router&#8217;s address map, update the MAC address of the virtual machine to map to the IP address that had heretofore been used by the physical machine.</li>
<li>Use Hyper-V Manager to start the new, virtual machine.</li>
<li>After the virtual machine is running, reboot or cycle power on your other telephony devices (SPAs, IP phones) to force them to register with the new machine. Note that as far as these devices are concerned, the PBX server hasn&#8217;t moved, since it has the same IP address as the old, physical machine.</li>
</ol>
<p>Now you are finally ready to make some test calls and see how they sound! In my initial tests, I hear no echo or jittery &#8220;cell phone&#8221; audio and can detect no difference from a physical machine. Maybe Hyper-V finally allows running Asterisk in a Window virtual environment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2010/02/pbx-in-a-flash-as-a-virtual-machine-take-2-hyper-v/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

