Windows 2008 R2 Xen domU Notes

From Alteeve Wiki
Jump to navigation Jump to search

 AN!Wiki :: How To :: Windows 2008 R2 Xen domU Notes

Installing a Windows 2008 R2 domU under Xen on an EL2 Cluster requires some extra planning to maintain optimal performance.

Storage Concerns

Pre-provision tasks:

FOR KVM

yum install virtio-win

Aligning Partitions

The first thing we need to do is make sure that the partition under the Windows VM starts on a cylinder that is an even 64KiB.

Warning: The following steps WILL DESTROY YOUR DATA! Do not do this on a production server. These steps must be done before using the partitions in any part of the cluster.

To do this, first run fdisk -u /dev/sda. If you have software RAID, you will need to delete any RAID arrays using the partition that will host your Windows VMs, then run the following steps on all drives in the array. For simplicity's sake, this tutorial will assume that you have a single disk (or are using a RAID controller that presents the array as a single disk).

fdisk -u /dev/sda
The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Print the current configuration.

Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      530144      265041   83  Linux
/dev/sda2          530145    84421574    41945715   83  Linux
/dev/sda3        84421575    92807504     4192965   82  Linux swap / Solaris
/dev/sda4        92807505   488392064   197792280    5  Extended
/dev/sda5        92807568   285603569    96398001   83  Linux
/dev/sda6       285603633   478399634    96398001   83  Linux
/dev/sda7       478399698   488392064     4996183+  83  Linux

We are going to put Windows on the /dev/sda5 partition, which is showing a start sector of 92807568. To determine if this is on a 64 KiB boundary, we need to do some math.

If we look at Units = sectors of 1 * 512 = 512 bytes, we know that each unit shown is itself 512 bytes long. That means that each 64 KiB block will use 128 sectors. So, our starting sector needs to be evenly divisible by 128.

92807568 ÷ 128 = 725059.125

We have a remainder, so it's not on an even 64 KiB block. Now we need to figure out what sector above 92807568 is evenly divisible by 128. To do that, lets add 127 (one sector shy of the next 64 KiB block), divide by 128 to get the number of 64 KiB blocks (with a remainder), remove the remainder to get an even number (do not round, you just want the bare integer), then finally multiply by 128 to get the sector number. This will give us the sector number we want our partition to start on.

92807568 + 127 = 92807695
92807695 ÷ 128 = 725060.1171875
int(725060.1171875) = 725060
725060 x 128 = 92807680

So now we know that sector number 92807680 is the first sector above 92807568 that falls on an even 64 KiB block. Now we need to alter our partition's starting sector. To do this, we will need to go into fdisk's extra functions.

Back in fdisk, type;

Extra options:

Command (m for help): x

Change the start block:

Expert command (m for help): b

Change partition number 5:

Partition number (1-7): 5

Set the start block to 92807680;

New beginning of data (92807568-285603569, default 92807568): 92807680

Return to the previous menu;

Expert command (m for help): r

Print the new partition configuration and confirm that the start of partition 5 is where we want it.

Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      530144      265041   83  Linux
/dev/sda2          530145    84421574    41945715   83  Linux
/dev/sda3        84421575    92807504     4192965   82  Linux swap / Solaris
/dev/sda4        92807505   488392064   197792280    5  Extended
/dev/sda5        92807680   285603569    96397945   83  Linux
/dev/sda6       285603633   478399634    96398001   83  Linux
/dev/sda7       478399698   488392064     4996183+  83  Linux

Voila! Now write out the changes.

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Now either run partprobe /dev/sda or reboot the server, which ever you feel more comfortable with. Personally, I like to reboot.

Note: As you layer on storage layers, make sure that whatever block size they use can evenly divide into 64 KiB blocks. How you do this will depend on the storage layers you use.

Creating a 64 KiB Aligned DRBD Resource

ToDo

Post-Install Steps for Windows 2008 R2 Server

Unlike Linux, which "just works", you will want to do a few things to optimize Windows on your cluster.

Install The GPLPV Drivers

  • Switch to "Test-signing" mode. This is required in order to install the drivers in the next step. DO NOT SKIP THIS STEP! Doing so could corrupt your Windows VM.

Open up a command prompt window and type:

Click in Start and the type cmd in the search bar.

bcdedit /set testsigning on
Enabling "testsigning" mode in Windows 2008 R2.

Once done, you must reboot.

  • Installing the drivers.

First, download the latest driver from here. You will want to pick the latest version with the name http://www.meadowcourt.org/downloads/gplpv_Vista2008x64_<version>.msi. At the time of this writing, the most recent version was gplpv_Vista2008x64_0.11.0.308.msi.

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.