Thursday, May 20, 2010

Check and Upgrade Tools before each power-on is greyed out

I needed an easy way to upgrade VMware tools without using Update Manager. There's an option under   Edit Settings  allowing you to upgrade / install VMware Tools automatically on reboot but it's disabled by default and can't be activated via Virtual Center unless the VM is shutdown.  Fortunately this option can be activated via PowerShell. Here's a nice little PowerShell script that will activate the setting without shutting down your VMs:

$ErrorActionPreference = "SilentlyContinue"
connect-viserver -server [VCServer or ESX Host] -user [user] -password [password]
get-vm | foreach-object {
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$vmConfigSpec.Tools.ToolsUpgradePolicy = "UpgradeAtPowerCycle"
(Get-View $_.ID).ReconfigVM($vmConfigSpec)
}

-Scott March

Monday, May 17, 2010

Unable to apply DRS resource settings on host error

You might run into this error while updating VMware tools:

"Unable to apply DRS resource settings on host (Reason: A general system error occurred: Invalid Fault). This can significantly reduce the effectiveness of DRS."

Here's the fix for ESX:

  1.  Recreate the pools.xml file:
    1. Log in as root to the ESX host with an SSH client.
    2. Issue the command: # mv /etc/vmware/hostd/pools.xml /tmp
    3. Run the following command to restart the hostd: service mgmt-vmware restart
  2. Check virtual machines for pending VMware Tools installations and cancel them.
  3. If there are no pending VMware Tools installations found, you may have to manually install VPXA.
To manually install the VPX Agent:
  1. Right-click on the host and click Disconnect in VMware Infrastructure (VI) Client.
  2. Log in to the ESX host service console and acquire root privileges.
  3. Run the following command to remove the VirtualCenter Agent RPM: rpm -e VMware-vpxa
  4. Run the following command to restart the hostd: service mgmt-vmware restart
  5. Caution: Ensure Automatic Startup/Shutdown of virtual machines is disabled before running this command or you risk rebooting the virtual machines.
  6. Reconnect the ESX host in VI Client
  7. Remove the ESX host from the DRS cluster, then re-add it to the cluster:
    1. Right-click on the host and click Disconnect in the VI Client.
    2. Right-click on the host and click Remove.
    3. Right-click on the cluster and click Add Host.
    4. Follow the wizard prompts to re-add the host to the cluster.
  8. Disable and re-enable DRS in the cluster:
    1. Right-click on the cluster and click Edit Settings.
    2. Deselect Enable VMware DRS. You receive a warning indicating that turning off DRS destroys all resource pools in the cluster.
    3. Click OK to turn off DRS and destroy all resource pools.
    4. Right-click on the cluster and click Edit Settings.
    5. Select Enable VMware DRS and click OK.
- Scott March






Thursday, May 6, 2010

VMware vCenter Update Manager Performance and Best Practices


VMware vCenter Update Manager provides a patch management framework for VMware vSphere. IT administrators can use it to patch and upgrade VMware ESX/ESXi hosts, apply patches to Windows and certain versions of Linux in virtual machines, upgrade VMware Tools and virtual hardware for virtual machines, and patch and upgrade virtual appliances.

Cool stuff right?  Just go ahead and install it on your vCenter Server and your good to go? Not exactly....You might want to read the Best Practices White Paper and Admin Guide before you just go ahead and install it.  I have to admit, I didn't do the RTFM thing and had to reinstall it a few times before I got it to work. With that being said, I'm publishing the summary from VMware's Best Practices guide and including links for other VUM related articles that might be of use.

Right out of the VMware Best Practices Doc:


  • Separate the Update Manager database from the vCenter database when there are 300+ virtual machines or 30+ hosts.
  • Separate both the Update Manager server and the Update Manager database from the vCenter server and the vCenter database when there are 1000+ virtual machines or 100+ hosts.
  • Make sure the Update Manager server host has at least 2GB of RAM to cache patch files in memory.
  •  Allocate separate physical disks for the Update Manager patch store and the Update Manager database.
  • Because the Windows guest agent is installed in each virtual machine the first time a powered-on scan is run, the first powered-on scan command can take longer than subsequent scans. It may therefore be desirable to run the first scan command when this additional time will not be an issue.
  • For a large setup, powered-on virtual machine scan is preferred if Update Manager server resources are constrained or more concurrency is needed for scans.
  • Upgrading virtual machine hardware is faster if the virtual machine is already powered off. Otherwise,Update Manager will power off the virtual machine before upgrading the virtual hardware. This could increase the overall latency.
  • Upgrading VMware Tools is faster if the virtual machine is already powered on. Otherwise, UpdateManager will power on the virtual machine before the VMware Tools upgrade. This could increase the overall latency.
  • For compliance view for all attached baselines, latency is increased linearly with the number of attached baselines. We recommend the removal of unused baselines, especially when the inventory size is relatively large.
  • Multiple vCPUs do not help Update Manager operations as the Update Manager guest agent is single threaded.
  • Configure each virtual machine with at least 1GB of RAM so large patch files can fit in the system cache.
  • Deploy the Update Manager server close to the ESX hosts if possible. This reduces network latency and packet drops.
  • On a high-latency network, powered-on virtual machine scans are preferred as they are not sensitive to network latency.
  • Check if on-access virus scanning software is running on the Update Manager server host. If it is, exclude the mounted disk on a high-latency network.
Here are the links for the Best Practices Document and Admin Guides:

VUM Best Practices Guide

VUM Administrators Guide

Stay tuned! - More to come

- Scott March