Category: Virtual Machines & Environments

Setting Virtual Disk QoS in Hyper-V
article #1042, updated 102 days ago

Disclaimer: this text is an draft combining references cited at the bottom with experiences. It is not authoritative.

Getting to the Settings

  1. In Hyper-V, enter Settings for a VM, click on a disk image under a controller, open the plus sign, and you’ll see Advanced Features.
  2. Click on that, and you’ll see a checkbox, “Enable Quality of Service management”.
  3. If you check that box, you can enter minimum and maximum IOPS numbers.
  4. If either number is zero, the configuration is inoperative, it reverts to automatic.
  5. It is a separate setting for each disk image of the guest.

Determining Good Values for the Settings

  1. In an administrative powershell on the virtual host, do this, just once forever:
    get-VM | Enable-VMResourceMetering
  2. Run Iometer on the virtual guest.
    • Choose one disk under Disk targets. Set Write IO Data Pattern “Pseudo random”. Set “Test Connection Rate” to 10.
    • Under Access Specifications, scroll to the bottom, choose All in one, and click Add.
    • If you want interesting GUI displays of the I/O readouts, make changes under Results Display.
    • Under Test Setup, open the Cycling Options dropdown and choose carefully. You’ll probably want to Cycle, but which other setting you want depends on the architecture of the guest and possibly the host.
    • Click the green flag button. The chosen disk image is now under load. You may want to try higher numbers for “Test Connection Rate”, but do realize this sets how hard we are trying to stress the server, and if we try too hard bad things can happen :-)
  3. While the disk image is under load, in administrative PowerShell, do this, where GUESTNAME is the name of the virtual guest:
    measure-VM GUESTNAME | fl
  4. You’ll see a number next to AggregatedAverageNormalizedIOPS. If your guest has just one disk image, this is the number you need to study (but do not just plug it into the setting!). If your guest has more than one, you’ll need to split them with the code below.
  5. Splitting the AggregatedAverageNormalizedIOPS number
    Paste the below into your PowerShell on the host, where GUESTNAME is the name of the guest. It will give you separate numbers, including IOPS Averages for every disk image in production.
$VMName  = "GUESTNAME" 
enable-VMresourcemetering -VMName $VMName 
$VMReport = measure-VM $VMName 
$DiskInfo = $VMReport.HardDiskMetrics
write-Host "IOPS info VM $VMName" -ForegroundColor Green
$count = 1
foreach ($Disk in $DiskInfo)
{
Write-Host "Virtual hard disk $count information" -ForegroundColor cyan
$Disk.VirtualHardDisk | fl  *
Write-Host "Normalized IOPS for this virtual hard disk" -ForegroundColor cyan
$Disk
$count = $Count +1 
}
  1. Once you have your Average Normalized IOPS number for the virtual disk, we need to think about it a bit.
    • On one particular setup with two virtuals having one disk image each, where the number showed at 20,000, I set Maximums all to 7000, and Minimums to 1000. This leaves the hypervisor with lots of headroom for its own maintenance, and causes the hypervisor to keep minimum reservation far from zero, to minimize latency. Obviously the Minimum will be much lower if the RAID on the host is less powerful, and just as obviously if load patterns become evident, maximum will be reduced or increased.
    • More variation will need to be employed, depending on observed numerical and practical performance, changes, and miscellaneous needs. A huge and heavily-used volume should deserve to be bumped up some. Early inspection has already shown that there are virtual hosts out there, otherwise nicely fledged servers, lacking in RAID throughput, where the reported average comes to less than 1,100! All of this has to come into consideration.

References

https://social.technet.microsoft.com/Forums/windowsserver/en-US/87f010a2-88c7-425d-a7a9-35dcf94d9a48/hyper-v-iops-calculation?forum=winserverhyperv

https://blog.workinghardinit.work/2014/01/08/how-to-measure-iops-of-a-virtual-machine-with-resource-metering-and-measurevm/

Categories:   Virtual Machines & Environments   

==============

Portable VirtualBox on Windows
article #1003, updated 279 days ago

VirtualBox, portable, on Windows. Amazing.

http://www.vbox.me/

Categories:   Virtual Machines & Environments   

==============

Virtualizing XP to KVM
article #377, updated 2057 days ago

Here’s a method which uses the VMware Converter.

http://moblog.bradleyit.com/2010/07/virtualizing-windows-xp-to-kvm-on.html

Categories:   Virtual Machines & Environments   

==============

Cloning Hyper-V Virtual Machines
article #374, updated 2061 days ago

A great article is here:

http://www.virtualizationadmin.com/articles-tutorials/general-virtualization-articles/cloning-hyper-v-virtual-machines-right-way-part1.html

Categories:   Virtual Machines & Environments   

==============

Hyper-V virtuals on QEMU/KVM
article #373, updated 2064 days ago

The following article is most interesting:

http://blog.allanglesit.com/2011/03/linux-kvm-migrating-hyper-v-vhd-images-to-kvm/

The file format used by Hyper-V in its VHD files, is actually exactly the same as the VPC format used in Virtual PC. And KVM and QEMU do know how to read VPC. So you can do it directly, without conversion; just import an existing disk image into a new KVM virtual and you are there.

But if you want to convert, you can use a utility called “kvm-img”. In some references and some systems, it’s called “qemu-img”. The idea is, that a command line much like this:

qemu-img convert -f vpc -O raw hyper-v-disk-image.vhd kvm-raw-disk.img

will convert your Hyper-V virtual disk image to the “raw” type image which is first on the list for KVM and QEMU.

Categories:   Virtual Machines & Environments   

==============

Linux KVM Drivers in Windows
article #369, updated 2077 days ago

There are disk and network drivers:

http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers

And some excellent articles on making them work:

http://www.linux-kvm.com/content/preview-redhat-54-windows-virtio-drivers-part-1

http://www.linux-kvm.com/content/redhat-54-windows-virtio-drivers-part-2-block-drivers

Categories:   Virtual Machines & Environments   

==============

Updating VirtualBox Guest Additions in Windows
article #308, updated 2267 days ago

Some very interesting methods here:

http://www.virtualbox.org/manual/ch04.html#additions-windows

Looks much better than overwriting the MSI, which has now failed on me twice.

Categories:   Virtual Machines & Environments   

==============

Advanced Memory Management, XP/2003/Vista/7, & virtuals
article #295, updated 2285 days ago

Start reading here:

http://msdn.microsoft.com/en-us/library/ff556232.aspx

and try /3GB and/or /PAE (search for it in the above) if you’re on XP or 2003. If you’re on Vista or 7, go here:

http://msdn.microsoft.com/en-us/library/ff542202.aspx

and try PAE and very possibly IncreaseUserVA.

I have found very good performance of 32-bit Windows as virtual guest, in a VirtualBox environment hosted on 32-bit Fedora 14 Linux, using the PAE kernel on Linux and /PAE (or BCDEdit /SET PAE) in the virtual. If you use PAE in the kernel, do make sure to use PAE in the virtual, or there will be an extra and expensive memory processing step required at all times. This is to be done even if the virtual is configured with smallish RAM, e.g., 1G.

Categories:   Memory Management   Virtual Machines & Environments

==============

Create a VHD (virtual hard drive) from a running server
article #242, updated 2413 days ago

The following:

http://technet.microsoft.com/en-us/sysinternals/ee656415

creates one or more Microsoft VHDs, suitable for use in Hyper-V and Virtual PC, from the drive(s) and/or RAID volume(s) of a running server or workstation.  Server 2003 / XP and up.

Categories:   Backup   Virtual Machines & Environments