Archive

Posts Tagged ‘Hyper-V’

Increase VMBus buffer sizes to increase network throughput to guest VMs – PowerShell Edition

September 23rd, 2010 No comments

In this article the title is explained. It also explains how to set it manually on all VM’s that you have. As lazy admin as I am I created a PowerShell script that can be ran manually when configuring/installing a VM or you can set is as shutdown script so every time a VM shuts down it is checked if a new “Microsoft Virtual Machine Bus Network Adapter” has been added to the VM.

RSBufferSize.ps1
if (Get-ItemProperty -Name “ReceiveBufferSize” -path “hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\*” -erroraction silentlycontinue | where {$_.DriverDesc -eq “Microsoft Virtual Machine Bus Network Adapter”}) {“Registry key ReceiveBufferSize already exists”} else {Get-ItemProperty -Name “DriverDesc” -path “hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\*” -erroraction silentlycontinue | where {$_.DriverDesc -eq “Microsoft Virtual Machine Bus Network Adapter”} | new-itemproperty -name ReceiveBufferSize -value 2048 -propertyType dword -erroraction silentlycontinue}if (Get-ItemProperty -Name “SendBufferSize” -path “hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\*” -erroraction silentlycontinue | where {$_.DriverDesc -eq “Microsoft Virtual Machine Bus Network Adapter”})

{“Registry key SendBufferSize already exists”}

else

{Get-ItemProperty -Name “DriverDesc” -path “hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\*” -erroraction silentlycontinue | where {$_.DriverDesc -eq “Microsoft Virtual Machine Bus Network Adapter”} | new-itemproperty -name SendBufferSize -value 2048 -propertyType dword -erroraction silentlycontinue}

Having written the script we want to use it! At this point you have a choice to make; there are two options:

1. Sign the script (you’ll need a Code Signing certificate and private key, then: $cert = @(gci cert:\currentuser\CodeSigningCert)[0]; Set-AuthenticodeSignature RSBufferSize.ps1$cert);

2. Set the script execution policy to Unrestricted (Set-ExecutionPolicy -ExecutionPolicy Unrestricted)

I strongly recommend option 1 for security, but in a lab or low security environment (i.e. you WANT your hosts to be compromised) option 2 might be acceptable.

Finally, you need to configure Group Policy or Local Policy for the host to have a Startup Script. You’ll find these settings under Computer Settings > Windows Settings > Scripts (Startup/Shutdown):

PowerShell Scripts tab (not the default Scripts tab):

Add a new script and set the script path to your saved file:

Why a Startup script? I tried a shutdown script but it didn’t work ;-) Reboot required to make settings effective!

It’s worth noting that scripts executed by Group Policy do not need to be signed – they bypass the script execution policy settings. Nevertheless you’re going to want to sign it so that:

  • If someone changes the script you will know when you run it manually;
  • You can test the script;
  • You can use it for reasons other than shutting down a host.

That’s all that needs to be done – now it’s testing time. The script is included in the text so you can just copy it, save it, sign it and test it.

Cluster Shared Volumes, Equallogic & Hyper-V

August 3rd, 2010 4 comments

Image posted by MobyPicture.com

So, what does this picture mean?

By default, volumes are spread across three members in one pool. So if you have six arrays in a pool, a different combination of three members will be used to handle different volumes.

There is a maximum of 16 nodes in a Hyper-V cluster which means every node in the cluster will get 6 persistent rervervations on a volume (96/16 = 6).

These 6 persistent reservations per node are then spread over a maximum of 3 members in a pool. We will then get 2 connections per member. If we apply redundancy this will result in 1 connection per NIC per Hyper-V cluster node.

If the above is correct then my previous post (http://www.delltechcenter.com/thread/4007957/Microsoft+Windows+2008+R2+CSV+and+Equallogic+SAN/ or http://www.martius.nl/?p=1896) on how to calculate the persistent reservations in wrong. This is because of the spread over max 3 members which actually means no mather how many Equallogics you are using(max. 16 in a pool) only 3 will be used to locate the volume.

The new calculation would then be:

Number of Equallogics   = 3 (max spread)
Number of NICs    = N
Number of MPIO    = M (default HIT = 2)
Number of Servers   = S

3 * N * M * S = 96

The numbers will then be:

3 * 2 * 1 * 16 = 96

Obvious question then is why should you use the DSM of Equallogic above the use of the standard Microsoft Multipath capabilities? The Equallogic DSM has a default MPIO per NIC of 2 while only one is available.

Another question is if this is the way Equallogic supports a 16 node Hyper-V cluster?

What are your thoughts? Please share them in getting this Equallogic – Persistent Reservation mystery clarified.

Hyper-V VM with Windows 7 and Apple Airport Express (802.11n) using a wired-wireless connection

July 12th, 2009 No comments

To start off! Out of the box Apple does not support the configuration of a wired-wireless connection to the Apple Express (AE). So this was challenge one!

The second challenge was to create a virtual machine of Windows 7 Build 7201 with the firewall enabled.

The last challenge was to create all this in a stable way so it would work “quick” and should be “easy” to set-up. ;-)

My used hardware/software is:

  • Normal x64 PC with Microsoft Windows Server 2008 R2 RC
  • Microsoft Hyper-V virtual machine with Windows 7 build 7201, fixed IP address, firewall enabled
  • Apple Express 802.11n with firmware 7.4.2. The AE is joined to my existing network (from the Davolink) with an WPA-TKIP configuration. No MAC address filtering is used. Fixed IP address.
  • Apple iTunes 8.2.0.23
  • Apple Airport Utility 5.4.2
  • Davolink DV-2020 WiFi AP, firmware unknown :-(

There is a wire from the PC to the Davolink WiFi AP. The link between the Davolink link and the Apple Express is wireless (DUHHH).

After setting up all the bits and hardware I ran into some nasty errors like:

An unknown error (-15006) occurred while connecting to the remote speaker“, “The remote speaker cannot be found on your network. Please verify your network settings and AirTunes configuration or select another speaker from the menu at the bottom of the iTunes window.” and the most nasty one (because there was no direct real error message) the loosing of sound and connection to the AE.

Than the troubleshooting started! Firewall on, firewall off, different versions of iTunes, upgrade firmware on AE, multiple reboots of all the hardware and software in many orders etc etc.

Then the EUREKA moment arrived eventually after 18 hours! What is it, what is it, what is it!!!

I found the magic sequence in how to get the sound blasting out of my speakers.

  1. Setup the AE to join an existing wireless network
  2. Boot all the hardware and software in a not-specific order.
  3. Fire-up the Apple Airport Utility and manually connect to the AE.
  4. Reboot or update the AE without making any changes!
  5. Start iTunes and check if you can select the remote speakers at the right bottom
  6. Stop the Bonjour service! (The holly grail!!!) but leave the start-up type at Automatic.

So….surprised?

In the end I was because the Bonjour service should keep the remote speakers discovered for eternity because that’s the whole point of the service, not to “disconnectâ€? them after an hourâ€?â€?.

This worked for me…will it work for you? Please let me know!

UPDATE:

After reading many, many, many postings on Apple forums I applied the folowing tip. This seems to make it even more stable.

Open iTunes > Edit > Preferences > Advanced Tab > Streaming Buffer Size > Set this to LARGE!

The larger the “chunks”, the lesser the posibility that set-recieve errors can occure…..sounds fine to me!

Migrate from Virtual Server to Hyper-V

May 3rd, 2009 No comments

This article is an edited version of an Microsoft TechNet article which can be found here (http://technet.microsoft.com/en-us/library/dd296684.aspx)

I have added some from “the field experiencesâ€? which hopefully will make your migration from Virtual Server to Hyper-V even easier as it is.

First of all I’d Like to start with some requirements and checks which you should do before you start.

  1. Make sure your CPU supports Intel® Virtualization Technology (Intel VT) or AMD Virtualization™ (AMD-V™) hardware assisted virtualization. If you go here (http://support.amd.com/us/Pages/AMDSupportHub.aspx) you can download the AMD Virtualization™ Technology and Microsoft® Hyper-V™ System Compatibility Check Utility;
  2. Make sure that the firmware of all the hardware components in your server are up-to-date;
  3. Internet connection. Before beginning to migrate and Virtual Server VM’s to Hyper-V make sure that your Windows Server 2008 installation is fully patched. Without it installing and configuring Hyper-V will be a headache. This is because of the “no-so-finished shipped Hyper-Vâ€? in the RTM version of Windows Server 2008. Essestial updates can be found here (http://technet.microsoft.com/en-us/library/dd430893.aspx);
  4. Lots of free disk space to make at least two copies of your Virtual Server VM’s and configurations files. One exact copy of the Virtual Server VM’s before migrating and one without the Virtual Machine Additions (also before mogration).

And then now the article from Microsoft with some additions from “the fieldâ€?.

This guide explains how to migrate virtual machines running on Virtual Server 2005 R2 Service Pack 1 (SP1) or Virtual PC to Hyper-V. A virtual machine running on Virtual Server consists of a configuration file (.vmc) and one or more data files. These data files can include virtual hard disks (.vhd files) and other media files, such as images (.iso files) and virtual floppy disks (.vfd files). Only the .vhd file can be used by Hyper-V. All of the other files used by Virtual PC or Virtual Server are incompatible with Hyper-V.
Migrating your virtual machines that are running on Virtual Server 2005 R2 SP1 or Virtual PC to Hyper-V is a straightforward process.

To migrate, you do the following general steps:

  1. Prepare the virtual hard disk in Virtual Server.
  2. Move the .vhd file (if necessary).
  3. Create a new virtual machine in Hyper-V using the .vhd file.

There is no import function in Hyper-V for virtual machines running on Virtual Server and Virtual PC.
Alternatively, you can use System Center Virtual Machine Manager (VMM) to convert and manage a virtual machine running on Virtual Server 2005 R2 SP1. VMM 2008 supports migrating virtual machines running on Virtual Server 2005 to Hyper-V (the virtual machines must have Virtual Machine Additions version 13.813 or later installed). VMM 2008 uninstalls Virtual Machine Additions, upgrades the hardware abstraction layer (HAL), and installs the integration components (called “virtual guest servicesâ€? in VMM). You cannot use VMM to migrate a virtual machine running in (or under) Virtual PC.

For more information about VMM, see http://go.microsoft.com/fwlink/?LinkId=135512. For more information about migrating and managing virtual machines running on Virtual Server, see Moving from Virtual Server to Virtual Machine Manager (http://go.microsoft.com/fwlink/?LinkId=135513).

Another way to “migrate” the virtual machines VMC file of Virtual Server and Virtual PC to Hyper-V is to use a tool called VMC2HV(http://blogs.technet.com/matthts/archive/2008/09/12/vmc-to-hyper-v-import-tool-available.aspx). This tool creates a VM in Hyper-V based on a VMC file. The tool isn’t perfect because it not always correctly ”migrates” the disk corresponding to a Virtual Server and Virtual PC virtual machine. The rest of the settings like CPU, memory and NIC’s are “migrated” as it should. The tool can be downloaded here (http://cid-7edf4c4ce8729f83.skydrive.live.com/browse.aspx/Public/VMC2HV). This tool is not supported by the way!

Tip
You should consider not migrating virtual machines running operating systems that cannot take advantage of Hyper-V integration services. For a list of operating systems that can take advantage of Hyper-V integration services, see About Virtual Machines and Guest Operating Systems (http://go.microsoft.com/fwlink/?LinkID=128037).

For planning help and best practice advice on migrating your infrastructure to Hyper-V, see the Microsoft Assessment and Planning Toolkit (http://go.microsoft.com/fwlink/?LinkID=110948). For additional Hyper-V planning information, see the Hyper-V Planning and Deployment Guide (http://go.microsoft.com/fwlink/?LinkID=108560). You can automate some parts of your migration prep using the PowerShell Management Library for Hyper-V (http://go.microsoft.com/fwlink/?LinkId=135684).

To migrate virtual machines to Hyper-V
Follow these steps to migrate your virtual machines running on Virtual Server 2005 R2 SP1 or Virtual PC to Hyper-V.

1. In Virtual Server, start the virtual machine you want to migrate so that you can document existing configuration settings if you need to recreate them on the new virtual machine in Hyper-V. Settings to review and document include:

  • Virtual machine settings—for example, memory, disk, disk type, and CPU settings.

Important
You cannot use a SCSI disk to boot a virtual machine in Hyper-V. If the boot disk of your virtual machine is not IDE, you should change it before migration. You can use a script for changing virtual machine disk type to automate changing the disk controller configuration type from SCSI to IDE. The script is available at http://go.microsoft.com/fwlink/?LinkId=135672.

  • Virtual network settings, including all configuration information. This means IP addresses, subnets, gateways, DNS’s….everything.
  • Network adapter settings—for example IP address, number of adapters, DNS gateway, and subnet settings.

2. Ensure that the operating system is up to date with all required software updates and hotfixes, according to your organization’s requirements. For virtual machines running Windows Server 2003, you must upgrade to Windows Server 2003 Service Pack 2 (SP2). For more information, see http://go.microsoft.com/fwlink/?LinkId=135673.

3. Uninstall Virtual Machine Additions. Hyper-V integration services replace the Virtual Machine Additions component used in Virtual Server. To install Hyper-V integration services, you must first remove Virtual Machine Additions. We recommend that you remove Virtual Machine Additions before migrating the virtual machine.

To remove Virtual Machine Additions

  1. On the virtual machine, in Control Panel, open Add or Remove Programs.
  2. Click Virtual Machine Additions, and then click Remove.
  3. Click Yes in the confirmation dialog box that appears.
  4. After Virtual Machine Additions is successfully removed, restart the virtual machine.

Caution
You can uninstall Virtual Machine Additions version 13.813 and later after you migrate the virtual machine to Hyper-V. Earlier versions of Virtual Machine Additions might fail to uninstall when started using Hyper-V.

To check the integration services version number

  1. On the virtual machine, in Control Panel, double-click Device Manager.
  2. Expand System Devices and then right-click Virtual Machine Bus.
  3. The version number is displayed on the Driver tab.

4. Shut down the virtual machine to prepare the virtual hard disk. You should back up and verify any data according to your organization’s data retention requirements and clean up any undo disks or differencing disks.

Note
Merging your disks can take some time.  Ensure a single .vhd file is all that remains. For detailed instructions on merging your virtual hard disks, see Merge a virtual hard disk at http://go.microsoft.com/fwlink/?LinkId=135675.

The virtual machine must be shut down without being in a saved state before you can enable or disable Undo Disks. Use the Commit Undo Disks or Discard Undo Disks option to prepare the virtual hard disk for migration. The Commit Undo Disks option updates the original virtual hard disk with all changes that were stored in the undo disk file.

Undo disks in Virtual Server are similar to differencing disks. However, a differencing virtual hard disk is associated with one virtual hard disk rather than with the virtual machine, and you are not prompted to decide what to do with the changes when you shut down a virtual machine. For more information, see Using differencing disks (http://go.microsoft.com/fwlink/?LinkId=135677).

For more information about virtual machine states, see Managing virtual machine state (http://go.microsoft.com/fwlink/?LinkId=135678).
 Important
If your virtual machine running on Virtual Server uses a shared SCSI bus as part of a test or development cluster, you must break your cluster, migrate one node, and move it to an alternate form of shared storage such as Internet SCSI (iSCSI) prior to migration.

5. Check hardware abstraction layer (HAL) compatibility. By default, Hyper-V installs an APIC MP HAL when integration services are installed on the virtual machine. If you choose to move the virtual machine to Hyper-V while it has a different HAL, you will be prompted to upgrade when you first start the installation of integration services. Change the HAL, if necessary, before you migrate the virtual hard disk.

To change the HAL

  1. Open the System Configuration utility (MSConfig.exe). To do this, click Start, click Run, type msconfig, and then click OK;
  2. Click the Boot tab, and then click Advanced options;
  3. Select the Detect HAL check box, click OK, and then restart the virtual machine.

Important
Changing the HAL will usually trigger an operating system reactivation.

6. Shut down the virtual machine, and then move the .vhd file (if required). For example, you may store the .vhd file in the VMM library if you are using VMM.

7. Create a new virtual machine. For detailed instructions on setting up a new virtual machine, see “Step 2: Create and set up a virtual machineâ€? in the Hyper-V Getting Started Guide (http://go.microsoft.com/fwlink/?LinkID=129921). If you have more virtual hard disks to add, do not start the virtual machine at the end of the wizard. Instead, open the settings for the newly created virtual machine and add each virtual hard disk to the configuration. If you need more than four virtual hard disks (or three plus a CD/DVD), attach a SCSI controller and attach the remaining virtual hard disks to the SCSI controller instead.

Alternatively you can use the ealier mentioned VMC2HV tool to create the VM’s you want to migrate (http://blogs.technet.com/matthts/archive/2008/09/12/vmc-to-hyper-v-import-tool-available.aspx.

Tip
For best practice recommendations for configuring your virtual machine for performance, see Performance Tuning Guidelines for Windows Server 2008 (http://go.microsoft.com/fwlink/?LinkId=135682).

8. Start your virtual machine in Hyper-V, log on with administrative credentials.

9. Removing old network adapters. After migrating a virtual machine and instaling the Hyper-V integration services the old network adapters are still present in the VM. To remove these nework adapters and so avoiding the message that a network adapter is already present with the prefered IP address the following steps might be usefull:

  1. Click Start, click Run, type cmd.exe, and then press ENTER.
  2. Type set devmgr_show_nonpresent_devices=1, and then press ENTER.
  3. Type Start DEVMGMT.MSC, and then press ENTER.
  4. Click View, and then click Show Hidden Devices.
  5. Expand the Network Adapters tree.
  6. Right-click the dimmed network adapter, and then click Uninstall.

10. Virtual switches. Because Hyper-V has a different network evironment as Virtual Server and Virtual PC, you need to configure the appropiate virtual switches to give the new VM’s network connectivity (http://technet.microsoft.com/en-us/library/dd581798.aspx). Once you are finished with configuring the virtual switches and after removing the old network adapters and configuring the new network adapers witrh the settings that you recorded in step 1 you are set to assign the corresponding virtual switch with the correct network adapter.

All done!