Configuration (Virtual Machine)

From vWiki
Jump to navigation Jump to search

Performance Settings

The lists here are not exhaustive, there may be more that you can tweak without adversely affecting system performance. Similarly some settings here may cause problems depending on how your systems operate.

Additionally, see the following resources

Windows 2008

In order to be able to squeeze the most of a virtual infrastructure its imperative that VM's are configured for best performance.

  • System Performance - Set the OS for best performance
    • In Server Manager, go to to Change System Properties | Advanced tab, and then Settings...
      1. Visual Effects tab - Adjust for best performance
      2. Advanced tab - Tailor for the application/service the server is running - set for programs to reduce memory caching for services
      3. Virtual memory/page file - Should be set to a fixed size, and ideally as small as possible so as to conserve disk space usage. You need to know what you're doing when you set this. Do you expect your systems to be starved of memory and need to page? Whilst I personally try to keep the page file down to 1GB in size, this can be catastrophic for some workloads (especially if an application needs to map large files, which would normally be backed by page file).

Windows 2003

In order to be able to squeeze the most of a virtual infrastructure its imperative that VM's are configured for best performance.

  • System Performance - Set the OS for best performance
    • Go to to System Properties | Advanced
      • Visual Effects - Disable/Adjust for best performance
      • Advanced - Tailor for the application/service the server is running
      • Virtual memory/page file - Should be set to a fixed size, and ideally as small as possible so as to conserve disk space usage. You need to know what you're doing when you set this. Do you expect your systems to be starved of memory and need to page? Personally for a VM with 4GB RAM assigned, I'd keep the page file down to 1GB in size.

Windows XP

The following changes are performance based, intended to ensure XP isn't unnecessarily wasteful

  1. Display simplifications
    • Right-click over the desktop and got to Properties
      1. Switch to Classic theme
      2. Disable screen-saver
      3. Disable monitor power save
  2. Disable Indexing Services
    • Go to Control Panel | Add or Remove Programs | Add/Remove Windows Components and uncheck Index services
  3. Disable paging of the executive
    • HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management set DisablePagingExecutive to 1
  4. Set for best performance
    • My Computer | Properties go to Advanced Tab, Performance Settings, and Adjust for best performance
  5. Disable all sounds
  6. Defragment prefetch
    • defrag c: -b
  7. Turn off disk perf counters
    • diskperf -n

Windows 7

See also http://communities.quest.com/community/vworkspace/blog/2011/09/08/introducing-the-free-quest-vworkspace-desktop-optimizer

  1. Set for best performance
    • Go to Control Panel\All Control Panel Items\Performance Information and Tools, then Adjust visual effects, and select Adjust for best performance
  2. Disable IPv6 on NIC
  3. Disable sounds
  4. Change power plan to High Performance and change Turn off the display to Never
  5. Disable the following services
    • BitLocker Drive Encryption Service
    • Block Level Backup Engine Service
    • Desktop Window Manager Session Manager
    • Diagnostic Policy Service
    • HomeGroup Listener
    • HomeGroup Provider
    • IP Helper
    • Microsoft iSCSI Initiator Service
    • Microsoft Software Shadow Copy Provider
    • Secure Socket Tunneling Protocol Service
    • Security Center
    • SSDP Discovery
    • Superfetch
    • Tablet PC Input Service
    • Themes
    • UPnP Device Host
    • Volume Shadow Copy
    • Windows Backup
    • Windows Firewall
    • Windows Media Center Receiver Service
    • Windows Media Center Scheduler Service
    • Windows Search
    • WLAN AutoConfig

Disable Shutdown Event Tracker

If the ESX servers are running as a HA cluster then they MUST be able to fully startup automatically after a re-boot. The Windows OS Shutdown tracker asks why you're shutting down or rebooting a system, or following an unexpected shutdown, halts the starting of a system pending information from the user. Not a problem for servers where all applications run as a service, but would impede VMware HA operating effectively where (GUI) applications need to start by stopping systems being restarted fully.

To disable...

  1. Start Group Policy Object Editor (Start | Run | gpedit.msc)
  2. Go to Computer Configuration\Administrative Templates\System
  3. Set Display Shutdown Event Tracker to Disabled

Set Low Risk File Types

If mapped drives are being used, .bat and .exe files need to be declared as low risk file types to stop Open file - Security Warning prompts being displayed when trying to run from mapped drives. This is particularly a problem if software is set to auto-start by placing shortcuts in the StartUp directory, as the software won't auto start.

To disable...

  1. Start Group Policy Object Editor (Start | Run | gpedit.msc)
  2. Go to User Configuration\Administrative Templates\Windows Components\Attachment Manager
  3. Set the "Default risk level for file types" to Enabled
  4. Specify the low extensions as .bat;.exe

Console Clipboard Integration

In the good old days this was always enabled by default, so you could copy and paste between your desktop and VM's console. Since ESX 4.1, its been disabled by default. There are two routes in order to be able to use again

  • Enable for VM - Permanent, requires VM downtime
    1. Shutdown the VM
    2. Go to Edit Settings, Options tab, then Advanced / General and hit Configuration Parameters
    3. Use Add Row to add the following new config items
      • Set isolation.tools.copy.disable to false
      • Set isolation.tools.paste.disable to false
    4. Restart the VM
  • Enable for VM's on an ESX - Temporary (won't survive ESX software upgrade), VM's can be vMotioned on to allow clipboard integration funkiness
    1. SSH to the ESX and then edit the /etc/vmware/config file, appending the following...
      • isolation.tools.copy.disable="FALSE"
      • isolation.tools.paste.disable="FALSE"

Disable Balloon Driver

You should not disable the balloon driver !
There are generally better ways to achieve whatever it is you're trying to achieve - memory reservations will normally work instead.

Certain applications (such as MS SQL and Java) can lock the amount of 'physical' memory they want, and stop the OS being able to page it out to disk, in order tyo protect that applications performance. However, if a virtual environment becomes memory constrained, VMTools may attempt to force the OS to page memory to disk, but the OS will be unable to do so, and so will page itself out to disk, impacting the entire machines performance.

By using memory reservations its possible to ring-fence physical RAM for a machine, meaning that if contention for memory occurs, the ESX will prioritise on other virtual machines 1st in order to reduce overall physical memory usage. Ideally, some dynamic memory should still be left, eg allocate a VM with 4 GB of RAM with 3 GB reserved, 3GB being enough to allow the OS and memory locking application to stay in RAM, with an additional 1GB available to be used should there be available capacity.

To disable the balloon driver

  1. Shutdown the VM
  2. Go to Edit Settings, Options tab, then Advanced / General and hit Configuration Parameters
  3. Use Add Row to add a new config item
  4. Set sched.mem.maxmemct to 0
  5. Restart the VM

sched.mem.maxmemct configures the amount of memory (in MB) that balloon driver can expand to in order to conserve ESX RAM usage.

Creating MSCS Machines

There are various different configuration options for creating MS clusters. For production standard clusters you must use RDM, otherwise you're forced to host both your VM's on the same ESX (and you can't vMotion them!).

  • You can't snapshot disks that are configured to use SCSI Bus Sharing.
Disk Type SCSI Bus Sharing Cluster in a Box
2 VM's / 1 fixed ESX
Cluster Across Boxes
2 VM's / multi ESX
Virtual/Physical Hybrid
1 VM + 1 Physical
Normal VMDK Virtual Yes No No
RDM Virtual Yes Yes - Win2k3 only No
RDM Physical No Yes Yes
  • Window 2003 servers must use LSI Logic Parallel SCSI controller for shared disks
  • Window 2008 servers must use LSI Logic SAS SCSI controller for shared disks

See the following for further info

Cluster in a Box

Procedure assumes you're creating a VM cluster using 2 VM's on the same server sharing standard VMDK disks (not RDM's)

  1. Create a new private vSwitch on the ESX to host the VM's called "MSCS Heartbeat"
  2. Create two VM's...
    • Don't create the shared disks yet
    1. With 2 NIC's, 1st attached to normal (externally accessible) network, 2nd attached to private "MSCS Heartbeat" network
    2. Boot up and ensure they're working as expected (not as a cluster yet), then shutdown
  3. On the 1st VM...
    1. Create the required shared disks on a new SCSI Bus ID
      • Tick Support clustering features such as Fault Tolerance, which ensures the disks are created in eagerzeroedthick format
      • Select a new SCSI Bus ID in the Virtual Device Node drop-down box, which creates the disks on a new SCSI Controller
    2. Change the new SCSI Controller's config...
      • SCSI Controller Type should be set to LSI Logic SAS (Win2k8) or LSI Logic Parallel (Win2k3)
      • SCSI Bus Sharing should be set to Virtual
  4. On the 2nd VM...
    1. Create the required shared disks on a new SCSI Bus ID, selecting Use an existing virtual disk (you'll need to locate the shared disks already created)
    2. Change the SCSI Bus Sharing mode of the new SCSI Controller to Virtual
  5. Boot the VM's up, disks should be visible from Disk Management from both VM's
    • Only format from one machine, NTFS doesn't support access from more than one host, MSCS needs to manage volume access/ownership