VMware High Availability – How you can help …

In my job I often have the opportunity to work with some very smart people. And sometimes I don’t. I was helping recently with a VMware HA installation that wasn’t working well at all. Or rather, it was working, but only on one node. I’ve dealt with this site in the past and it’s been a nightmare to get straight answers when it came to various infrastructure configuration issues like “What’s your default gateway?”, “How would you like your VM network setup?”, “Do you know the security code to turn off the building alarm?”. So, we’d added some HBAs to resolve another issue and had problem with one of the nodes’ HA configurations.

When I do HA setups the conversation goes something like

“Do you have DNS working?”

“Yep.”

“Great! Forward and reverse lookups work then?”

“Uh-huh.”

“Great, so if I do nslookup on the shortname, fqdn and ip address it will work on each node.”

“Should do.”

But it didn’t. By this time I’m usually cranky that someone has lied to me. I don’t care that they don’t know any better. So I fix up their DNS – which should give anyone who knows me cause for alarm – that I’m working on Windows-based DNS servers – and HA still doesn’t work. But it should at this stage. So now I’m crankier, because what normally works still won’t. If I log in to AAM I can see both nodes, but I can’t log in to AAM from the broken node. Hmmm, sounds networky. So I poked around with their vSwitch config, which I notice with some discomfort is different between nodes, and notice that their SC vSwitches are set to “Route based on IP hash”. VMware have a most excellent document on Virtual Networking here. It gives a reasonable overview of what’s going on and why you’d have NIC Teaming on your vSwitches setup in different ways. There’s a fair bit of discussion on the forums regarding what settings work best. I’ve also found during the course of various engagements that different settings work well with different physical switches depending on whether they’re running EtherChannel, LACP or whatever. I wish I could give you some more insight but my switching knowledge is more fibre-channel than ethernet-based.

So, I disabled and re-enabled HA once I’d changed the vSwitch NIC Teaming settings and were good to go. For all the good you think that HA actually does. So here’s 3 things to remember:

1. Don’t lie to me about your DNS.

2. Don’t make me fix you DNS (especially if it’s Windows-based).

3. Make sure your NIC Teaming is setup with non-defaults _only_ if you need to.

VMware ESX Server 3.0.2 Update 1 is Now Generally Available! (and has a slight problem)

Well, it’s not without a few problems. But using the CLI is so Nineties anyway. Right? This just landed in my inbox:

<quote>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ESX Server 3.0.2 Update 1:
Issue, Workaround, and Fix regarding Two Command Line Utilities

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dear VMware ESX Server Customer,

VMware has discovered an issue with two command line utilities (vmkping and ramcheck) when ESX 3.0.2 Update 1 or ESX 3.0.2 patch bundle ESX-1001907 is installed.

What products are affected?
ESX Server 3.0.2 Update 1 (new installation or upgrade from a previous version of ESX Server).

ESX Server 3.0.2 Patch bundle ESX-1001907 (after installing patch ESX-1001907 on ESX Server 3.0.2).

What is the impact and symptom of this issue?
The “vmkping” command is a utility to help identify possible VMkernel network mis-configurations. The “ramcheck” command is a utility to run memory diagnostics while ESX Server is running.

Execution of the vmkping or ramcheck command in the Service Console fails with the following error message:

“syscall version mismatch (compiled: 0x7616c4e3, kernel: 0x50f63116)”

No other system utilities are affected. Additionally, ESX Server stability and reliability are not jeopardized.

What is the root cause of this issue?
VMware-esx-apps-3.0.2-61618.i386.rpm should have been included in the patch bundle ESX-1001907. The ISO and upgrade tarballs contain the ESX Server 3.0.2 GA version of this RPM while they should have contained the VMware-esx-apps-3.0.2-61618.i386.rpm version.

What is the fix and the timeframe for the fix?
A newer patch bundle that includes the appropriate version of this RPM will be released shortly. You will be notified via email when this patch has been posted, at which time it will be available for download from the following location:

ESX Server 3.0.2 Patch Download Page: http://www.vmware.com/download/vi/vi3_patches_302.html

Interim Workaround:
If you must use either of the utilities above before an official fix is delivered, please contact VMware Technical Support at 877-4-VMWARE for a temporary fix.

</quote>

It’s comforting to know that “ESX Server stability and reliability are not jeopardized”. As opposed to installing Windows as a guest VM …

VMware ESX Server 3.0.2 Update 1

This just arrived in my inbox – “VMware ESX Server 3.0.2 Update 1 is Now Generally Available!”. More details here. The FAQ is here. The release notes are here. Maybe it will go better than my aborted PROD upgrade to 3.0.2 this morning – but that was a VMotion issue – not a tarball upgrade patchy thing. Incidentally I just modified my update script to work with the latest 3.0.2 patches at a customer site. The timing of this release is impeccable.

October ESX patches

New ESX patches have been released for October. Get patch loving here. I haven’t had time to test these in DEV yet, but I’ll update this post later this week. There are also patches available for 3.0.0 and 3.0.1. Look out for new patch batches in early November.

VMware HA – It’s not you, it’s me

I had some kind of brain cramp at a customer site today and wasted time that I’ll never get back. I was finishing off an implementation which required some zoning, some storage provisioning, some networking, some VLANs, some HA and DRS configuration, and some testing. I’d put aside 4 hours to complete the work and had most all of it done in 1 hour. I then went to configure HA on the cluster and couldn’t for the life of me get one of the four hosts to participate in a cordial fashion. Whenever I enabled HA on the cluster I reconfigured HA on the host in question I was met with “An error occurred during configuration of the HA Agent on the host“. I’ve done a bit with HA previously and had seen this error when the customer had networking errors relating specifically to DNS. So I went through their DNS setup paying special attention to any possible typos or reverse-lookup problems but came up with nothing. I modified hosts files (ewww) on all of the hosts and even added them to the VC host. No dice. I scoured the vmtn forums and found

[Updated 16/09/2008] sorry it’s not that exciting – all I wanted to say was that I found this post – particularly johu’s use of the aam tools, to be very useful in troubleshooting some HA problems I had at the time. Sorry to keep you all hanging there …

VMware ESX patch upgrade tarball

I’ve been deploying VMware ESX 3.0.2 on a few sites around town recently and thought it was about time I upgraded our internal systems to reflect the latest patch levels. I took a few hours this week and upgraded the UDA build that I use here for our development environment. I was all ready to test out the new build on our systems when I realised that if something went wrong I wasn’t well-placed to waste time fixing it and retrieving any of my colleagues’ VMs that were being used at the time. So I reached for the ESX3 – 3.0.2 tarball (esx-upgrade-from-esx3-3.0.2-52542.tar.gz) and went through the process to see how it went. It was arguably just as risky, but that’s how I’m rollin’ at the moment. The process is a lot simpler than upgrading from ESX 2 (no rebooting into linux mode), but it still requires downtime for your VMs if you don’t have DRS running or N+1 capacity available.

Here’s how to do it:

Using username “root”.
root@vi3host’s
password:
Last login: Wed Sep 12 09:28:32 2007 from workstation
[root@vihost root]# tar xzvf esx-upgrade-from-esx3-3.0.2-52542.tar.gz
52542/
52542/acl-2.2.3-1.i386.rpm
52542/ash-0.3.8-16.i386.rpm

[…]

52542/yum-2.0.7-4vmw.noarch.rpm
52542/zip-2.3-16.1.i386.rpm
52542/zlib-1.1.4-10.EL3.i386.rpm
52542/descriptor.xml
[root@vi3host root]# cd 52542/
[root@vi3host 52542]# esxupdate -n update
INFO: No repository URL specified, going with file:/root/52542
INFO: Configuring…
INFO: Pre-installing [‘VMware-esx-scripts’]…
INFO: | Enabling repackaging capability…
INFO: | Gathering header information file(s) from server(s)
INFO: | Server: Esxupdate-compatible repository for VMware ESX Server 3.0.2-52542
INFO: | Finding updated packages

[…]

INFO: | Installed:  VMware-esx-drivers-net-forcedeth 0.60-52542.i386
INFO: | Transaction(s) Complete
INFO: Shutting down hostd…
INFO: Running esxcfg-boot to regenerate initrds…
INFO: Restarting hostd…
INFO: — TOTALS: 222 packages installed, 0 pending or failed, 1 removed, 0 excluded —
INFO: Install succeeded – please come again.
[root@vi3host 52542]# reboot

And you’re all done. For the complete log fanboys here’s a link to the, er, complete log.

Once the host has rebooted, you can fire up the VMs and proceed as normal. I also took the opportunity to ensure that my patching script worked with the new 3.0.2 September updates. It does, but funnily enough, the output of an esxupdate query command now looks like this:

[root@vi3host root]# esxupdate query
Installed software bundles:
  —— Name ——   — Install Date — — Summary —
         3.0.1-32039       11:39:36 07/09/07 Full 3.0.1 release of VMware ESX Server
         ESX-1006511    12:13:15 07/09/07 Fixing TX hang in 80003ES2LAN Controller
         ESX-1410076    12:15:59 07/09/07 BSOD 0x109 during 64-bit Windows install
         ESX-2158032    12:17:18 07/09/07 Add LFENCE for RWO on AMD K8 before RevF
         ESX-2066306    12:18:08 07/09/07 Patch for VM crashes and possible freeze
         ESX-6921838    12:20:18 07/09/07 hot removal of a virtual disk thru SDK
         ESX-8173580    12:21:36 07/09/07 Fix COS Oops running Dell OM5 w/ QLogic
         ESX-9986131    12:22:45 07/09/07 Updated openssh, python, and openssl
         ESX-1271657    12:23:41 07/09/07 Open IPMI improvement for slowness.
         ESX-1917602    12:24:23 07/09/07 To improve compatibility for Windows NT.
         ESX-2031037    12:25:07 07/09/07 To provide LUN an unique ID Name
         ESX-3996003    12:58:42 07/09/07 To support the latest time zone rules.
         ESX-5497987    13:00:00 07/09/07 Fixes a misleading locking message.
         ESX-6075798    13:01:01 07/09/07 Force vmxnet module to be installed 1st.
         ESX-3199476    13:02:03 07/09/07 VMXNET shutdown may lead to BSOD
         ESX-5031800    13:02:49 07/09/07 RHSA-2006:0749 tar security update
         ESX-5885387    13:03:33 07/09/07 RedHat Moderate: gzip security update
         ESX-6050503    13:05:45 07/09/07 Error on “network adapters” tab in VC UI
         ESX-6856573    13:06:31 07/09/07 PhysMem_Get() accesses wrong pages
         ESX-9865995    13:07:49 07/09/07 LUNs of MSA Array disappear and reappear
         ESX-1541239    13:08:42 07/09/07 Updates Emulex Fibre Channel driver.
         ESX-2257739    13:09:58 07/09/07 To deliver several fixes in vmkernel.
         ESX-2559638    13:10:45 07/09/07 Update info rpm for ESX 3.0.1.
         ESX-1161870    13:11:36 07/09/07 Several bug fixes in vmware-vmx.
         ESX-3416571    13:12:22 07/09/07 Potential Buffer Overflow.
         ESX-5011126    13:13:11 07/09/07 Potential Buffer Overflow.
         ESX-7737432    13:13:58 07/09/07 Potential Buffer Overflow.
         ESX-7780490    13:14:43 07/09/07 Potential Buffer Overflow.
         ESX-8174018    13:15:32 07/09/07 Potential Buffer Overflow.
         ESX-8852210    13:17:43 07/09/07 Potential Buffer Overflow.
         ESX-9617902    13:19:00 07/09/07 Potential Buffer Overflow.
         ESX-9916286    13:19:52 07/09/07 To update zlib library for ESX 3.0.1
         ESX-4825991    13:21:11 07/09/07 To deliver several fixes in vmkernel.
         ESX-5095559    13:22:19 07/09/07 This patch contains several fixes.
         ESX-5140477    13:24:02 07/09/07 SSL certificate verified by MKS plugins.
         ESX-6657345    13:24:56 07/09/07 iSCSI device failed with check condition
         ESX-6704314    13:25:47 07/09/07 Memory leaks in VMware Tools.
         ESX-7281356    13:26:43 07/09/07 To update tzdata rpm from Red Hat.
         ESX-7302867    13:27:41 07/09/07 console OS oops after aacraid_esx30 load
         ESX-7408807    13:28:34 07/09/07 Hang when booting with one local mirror.
         ESX-7557441    13:29:44 07/09/07 Each mgmt-vmware restart impacts all VMs
         3.0.2-52542       09:46:10 09/12/07 Full 3.0.2 release of VMware ESX Server
         ESX-1001735    12:14:18 09/14/07 To update tzdata rpm.
         ESX-1001725    12:19:54 09/14/07 Security update for the bind package.
         ESX-1001726    12:20:46 09/14/07 Security update for shadow-utils package
         ESX-1001727    12:21:37 09/14/07 Security update for openldap packages.
         ESX-1001728    12:22:34 09/14/07 Security update for pam packages.
         ESX-1001729    12:23:42 09/14/07 Security update for gcc packages.
         ESX-1001730    12:24:33 09/14/07 Security update for gdb packages.
         ESX-1001731    12:25:22 09/14/07 Security update for krb5 packages.
         ESX-1001732    12:26:21 09/14/07 Fix multicast extra packets in NIC Team.
For a differential list of rpms, use the -l/–listrpms option.
[root@vi3host root]#

Notice that the system was originally installed with 3.0.1, most all patches applied, and then the full release of 3.0.2 is treated as a super patch. I seem to recall some rambling on the forums about this, but I don’t recall exactly where. In any case, I’m fine with that, really.

So now our dev environment is up to date, and I’m looking forward to doing the same in production and seeing if that breaks anything.

Dynamic Disks

Those of you who’ve worked with me before are probably aware that I am not the greatest fan of Microsoft’s server platform for high-performance enterprise computing. That said, I acknowledge that it is not uncommon for people to use Windows Server 2003 as a core platform to run any number of applications in their business. Something that visibly agitates me is people who use Dynamic Disks without thinking through the consequences of their actions. Firstly, this article from Microsoft’s TechNet gives a good outline of how Dynamic Disks and Volumes work and this KB article defines what some of the differences are between Basic and Dynamic Disks while discussing Best Practice options for using Dynamic Disks in Production.

My opinion of Dynamic Disks thus far is that, while the technology has some neat features, a lot of the functionality can be had using hardware-based RAID and vmkfstools. To clarify, most people deploy Dynamic Disks to take advantage of disk spanning and RAID-like parity functionality. But this can be had easily with most Engenio and EMC-based hardware arrays. People also use it to get around the problem of sizing with relation to basic disks, but I think this enthusiasm needs to be tempered with some forethought and planning. For example, we recently babysat a Spanned Dynamic Volume that was comprised of 4 +1TB LUNs that kept appearing as Foreign when the user rebooted the host. The thing to remember with spanning is that it provides no parity, and thus no protection from failure. If you insist on using Dynamic Volumes, at least ensure that there is a level of parity involved to save you from the likely outcome of volume failure. Before you deploy a 5TB RAID-0 volume, think carefully about why you need to create this “superLUN of business discontinuity”, and what other mechanisms are available to achieve the same outcome.

If you’re working in a VMware ESX environment, you should normally be able to use SAN-based disk expansion technologies, combined with diskpart in Windows, or vmkfstools in VMware ESX, to achieve the desired result.

In Windows, run the following commands to extend a basic volume:

diskpart

list volume

select volume x (where x is the number of the volume you wish to extend)

extend

exit

In VMware ESX, run the following command to extend a vmdk disk file:

vmkfstools -X 50G disk.vmdk

Note that the 50G value is the new size of the disk, not the extra space you require.

If you find yourself needing to extend a boot volume in Windows Server 2003, diskpart won’t be any help. Before you reach for the gparted ISO file, think about combining vmkfstools with another (test) Virtual Machine. Here are the required steps:

1. Backup your VM (VM1).
2. Shutdown VM1 and run vmkfstools against VM1’s disk file.
3. Attach the disk to a second guest (VM2).
4. Run diskpart on the volume (in this case it will probably be D: or something similar).
5. Once the volume is extended, shutdown VM2 and remove (but don’t delete) the disk from VM2’s config.
6. Attach the newly expanded volume to VM1.
7. Boot VM1.
8. Profit.

I hope that’s provided a starting point for further investigation into basic and dynamic disks. Remember, before converting every volume in sight to Dynamic, think very carefully about the ramifications of doing this.

VMware ESX patch management

Before VMware released ESX Server 3.0.2 (and, for the time being, removed the need for me to patch it), I was looking for a solution to patching ESX that didn’t involve rebooting after every patch, and didn’t involve a lot of manual intervention. I came up with a script that copies the tarballs from the base directory to another spot, extracts them, puts the host in maintenance mode, and then patches sequentially until it’s all done. The trick was to get the patches in the right order, or you’d be left with a bit of cleaning up to do (refer to http://kb.vmware.com/kb/10230 for more on that). To that end, instead of importing a listing of the extracted directories, I use text files and break it into phases. It’s ugly, but it kind of works. I’m sure I won’t ever have to resort to something so cludgy once version 3.5 is released. VMware have also announced, incidentally, that version 3.0.2 esxupdate now has the ability to cope with patches being installed in non-chronological order. Which negates the need for a lot of what I did with this script, and will instead make it easier to use something like ls to give you the output you need. I couldn’t find a nice way to exit maintenance mode once the host rebooted, and tried a few things with rc.local that never really worked out. Life goes on. Copy the script, the two phase files, and the tarballs to a nominated directory on the host.
This is the script itself. I like to call mine barry.sh. Make sure it’s executable (chmod +x barry.sh).

[barry.sh]

#!/bin/bash

# Set some variables
dir=`pwd`

# Logging is for whimps

# Check to see if the update directory exists, if not, make it
echo “Creating updates directory”
if [ -d /var/updates ]
then
echo “Updates directory exists”
rm -rf /var/updates/*
else
mkdir /var/updates
echo “Created updates directory”
fi

# Copy the patches to the update directory
echo “Copying patches to updates directory”
cp –reply=y *.tgz /var/updates/
echo “Copied patches to updates directory”

# Get a list of patch files to extract
echo “Locating patch files to extract”
ls /var/updates >$dir/input.file
echo “Found ’em”

# Extract the files
echo “Extracting the patch files”
for i in `cat input.file`; do
cd /var/updates
tar xzvf $i
cd $dir
done
echo “Extracted patch files”

# Remove the tarballs
echo “Removing the source tarballs”
rm -rf /var/updates/*.tgz
echo “Tarballs gone”

# Enter maintenance mode
echo “Entering Maintenance Mode”
vimsh -n -e /hostsvc/maintenance_mode_enter
echo “vi3 Host now in Maintenance mode”

# Patch ’em – I like to call this Phase 1
echo “Running patches in Phase 1”
for i in `cat $dir/phase1`; do
cd /var/updates/
cd $i
esxupdate -n update
done

# This one’s nasty – also known as a phasebreaker
cd /var/updates/ESX-6431040/
./install_patches << FOO
all
y
n
FOO

# Patch ’em – I like to call this Phase 2
echo “Running patches in Phase 2”
for i in `cat $dir/phase2`; do
cd /var/updates/
cd $i
esxupdate -n update
done

reboot

The next two files are called, respectively, phase1 and phase2. They need to be in the same directory as barry.sh to be useful.

[phase1]

ESX-1006511
ESX-1410076
ESX-2158032
ESX-2066306
ESX-6921838
ESX-8173580
ESX-9986131
ESX-1271657
ESX-1917602
ESX-2031037
ESX-2092658
ESX-3996003
ESX-5497987
ESX-6075798
ESX-3199476
ESX-5031800
ESX-5885387
ESX-6050503
ESX-6856573
ESX-9865995
ESX-1541239
ESX-2257739
ESX-2559638

[phase2]

ESX-9916286
ESX-4825991
ESX-5095559
ESX-5140477
ESX-6657345
ESX-6704314
ESX-7281356
ESX-7302867
ESX-7408807
ESX-7557441
ESX-1000073
ESX-1000070
ESX-1000039

Thanks for reading …