Saturday, November 10, 2012

Setup Share Nothing Hyper-V Live Migration: Step-by-Step

Forward

Share nothing live migration in 2012 is pretty cool; it allows you to move a running VM from one Hyper-V host to the other with NO elements shared between the two prior to the move. For more information about the feature, see:

Microsoft: Live Migration Description
Aidan Finn: Live Migration Demo

How-To

Setup Constrained Delegation

First we need to setup constrained delegation so we don't run into permissions issues during this operation. For more information regarding constrained delegation, see Matthijs Seldam's description and this Technet description

Perform the following for each Hyper-V host in your environment: 
  1. Find the computer object in Active Directory Administrative Center (preferably) or AD Users and Computers
  2. Drill into the properties and locate the "Delegation" location/tab
  3. Select "Trust this computer for delegation to specified services only" and "Use Kerberos Only"
  4. (Repeat for EVERY Hyper-V host you intend to use other than the host you are editing) Click "Add" and type the machine name for the other Hyper-V host in question. Click "OK". 
  5. Select the following: (CTRL Click for multiple targets)
    1. Microsoft Virtual System Migration Service/COMPUTER
    2. Microsoft Virtual System Migration Service/COMPUTER.FQDN
    3. cifs/COMPUTER
    4. cifs/COMPUTER.FQDN
  6. (Optional if using file servers for ISOs or VHD storage) For each file server repeat step 4 and then 5 adding ONLY the cifs services
  7. Click "OK" to save & close the properties of the host. Ensure you repeat step 4&5 for each Hyper-V host. 

Setup Hyper-V

Important: repeat this process for each Hyper-V host.
  1. In the Hyper-V manager, open the properties of the host you want to edit. 
  2. Select "Live Migrations" on the left. 
  3. On the Live Migrations property page, Check "Enable incoming and outgoing live migrations". Under Authentication protocol, select "Use Kerberos", under Incoming Live Migrations select "Use these IP addresses for live migration" and then add each IP address on this host you would like to use for migrations. More IPs=more available bandwidth. 
  4. Click "OK" to accept changes and close the properties. Make sure to repeat these steps for each host.  

Move that thing!

  1. In Hyper-V manager, right click the guest you want to migrate and select "Move"
  2. Click "Next" on the Before you Begin page. 
  3. Keep "Move the virtual machine" selected and click "Next"
  4. Specify the name of the destination Hyper-V server and click "Next"
  5. Keep "Move the virtual machine's data to a single location" and click "Next"
  6. Select the destination folder on the target server and click "Next". 
  7. At this point the wizard will present you with any other decisions that need be made concerning the move; one common one is which HyperV Switch should be used on the target host
  8. Click "Finish"
It should migrate; (if not see below) the guest migration will trigger after the disk has copied over. Migration time will depend  on your disk read performance reading on the former host, writing perf on the target host, and network bandwidth. 

OH NO!


So let's say you're migrating between hosts with differing processors; they could even be the same brand. In my case, for example, I am migrating between a "Core 2 Quad" era Xeon and an "Ivy Bridge" Xeon. If the differences are substantial enough the machine won't move because the features exposed to the VM are missing on one of the platforms. Unfortunately you'll have to power down the guest to perform this fix, but it's a one time deal so next time the live migration will work. Lets do it: 

  1. Power down the guest. 
  2. Open the settings and expand the CPU specification
  3. Under "Compatibility" select "Migrate to a physical computer with a different processor version"
  4. Hit "OK" and start the guest back up. Live migration should now work. 

A Note on Performance: 

While the live migration performs well, the weakest link in your chain will be the speed things move at. Take this example: 

Read from: 4x 7200RPM SATA in RAID 10 
Write To: 6x 7200RPM SATA in RAID 5
LAN: 3x 1GB Full-Duplex w/Jumbo Frames


It does seem to automatically use SMB 3.0 Multi-Channel, but I am having a bit of problem scaling performance. While the screenshot above is held back by the source read speed, I didn't realize much more performance reading from the RAID 5 array, which has very good read speeds, to a different SSD-based RAID 10 array, which has crazy write speeds. I'll post any additional performance info I find. 

Tuesday, November 6, 2012

Installing .NET 3.5 on Windows10/8/Server 2012 With Powershell

Here's how to install .NET 3.5 (or another feature by subbing the feature name) on Windows 8/10 or Server 2012 from Powershell:
  • Launch Powershell as Admin
Install .NET 3.5 using default sources (Windows Update or defined in group policy)
  • 2012: Install-WindowsFeature –name NET-Framework-Core
  • Win8/10: Enable-WindowsOptionalFeature –Online –FeatureName NetFx3 –All
Install .NET 3.5 using a network SxS share: 
  • 2012: Install-WindowsFeature –name NET-Framework-Core -source \\server\share\source\sxs
  • Win8/10:Enable-WindowsOptionalFeature –Online –FeatureName NetFx3 –All -LimitAccess -Source \\server\share\source\sxs
    • On Windows 8, -all indicates that all parent features should be enabled as well and -LimitAccess prevents it from connecting to Windows Update. These options are not valid on Win 2012. 
Install .NET 3.5 using DVD-ROM 
  • 2012: Install-WindowsFeature –name NET-Framework-Core -source j:\sources\sxs    (See note below)
  • Win8:Enable-WindowsOptionalFeature –Online –FeatureName NetFx3 –All -LimitAccess -Source J:\sources\sxs
Make sure to run Windows Update after install if you're installing from a non-updated source!

Note: Depending on your configuration, on server 2012 you may need to use the install.wim on the install media and specify the index of the proper version of your install. To do so, execute:

Get-WindowsImage -ImagePath {OpticalDrive}:\sources\install.wim
This will display a list of images with associated indexes. Take note of the index of your install type.
Then, instead of the -source line above, use -source:wim:e:\sources\install.wim:X (where X is the number of the appropriate index. 

Update: Confirmed this works on Windows 10 as well!

Sunday, November 4, 2012

Server 2012 Fixes HyperV VM Import Process

When copying VHD files from one machine to another or re-creating a VM, Windows 2008r2 and 2008 required you to manually grant rights to the VM Specific SID after import to successfully start the VM. The import process wouldn't stamp the copied files with the proper machine ACLs resulting in a "General Access Denied" error. (fix here) Server 2012 seems to have fixed that problem. When importing a HyperV guest to 2012, the correct rights are automatically applied. This is a welcome time-saving fix and thus far I'm very impressed with the Hyper-V improvements in 2012. More to come on that... this is obviously small relative to the major functionality changes, but I'm happy they paid attention to the details as well.