GeekAfterFive

Infrastructure as Code

home

Flexible Adapters and the importance of VMware Tools

02 Feb 2012

a picture
I was asked recently to write a script to get a count of virtual machines with Flexible adapters that did not have VMware tools installed. The number was surprising to me. 10% of all VMs were Flexible with no VMware Tools. While having a Flexible type network adapter is fine and not having VMware tools installed is sorta fine, but together they force your NICs to 10Mb. TEN MEGABIT, PEOPLE! It's like we're back in 1995! I decided to turn to the KB Article on VM Network Adapters for verification. I mean, who even thinks about that anymore? Just set it to VMXNET3 and be done with it, right? Our VMXNET3 adapters are 10Gb. That's TEN GIGABIT! 1000x more bandwidth! Sure enough, from the KB:
"With VMware Tools installed, the VMXNET driver changes the Vlance adapter to the higher performance VMXNET adapter."
So, now the question is WHY. Why would someone not change their network adapter to E1000 (which is supported on everything you'd want to run), or at least install VMware tools to take advantage of VMXNET?

vCloud Director

vCD 1.0 gives you no option to change your adapters. In order to do so, you will have to call your provider (internal, or public cloud provider) and have their admin power off the machine, remove the flexible adapter, and change it to either E1000 or VMXNET3. Of course there is nothing from stopping you from installing VMware tools on the guest machine, but we'll get to that in a second.

Blaming vCD 1.0 of course is a terrible excuse. "Well, upgrade to 1.5!" you say. "vCD 1.5 gives you the control of adapter types!" Yes, yes it does, but you still have to be careful. The adapter type is still flexible by default, and the adapter types are not displayed without checking the box to show them. Take the following screenshot... I have just added a NIC, and am about to click the OK button.

a picture

See that little check box up there? I was about to create a new NIC with a flexible adapter. Lets click it...

a picture

Ahh, that's better. Yep, Flexible. Good thing I checked, huh? :D

VMware Tools Support

It's probably eating you up inside that the easy fix is just to install VMware Tools. Who cares if it's flexible, as long as you install VMware tools? Well, I hate to say it, but not all Operating systems support VMware tools, or in part VMXNET.

I'll call Checkpoint Software out on this one as an example. Checkpoint Security Gateways run on an OS called SecurePlatform, or SPLAT for short. This highly secure distro of Linux did not have the VMware virtual machine in mind when it was first created. While I haven't tried *too* hard to get VMware tools to build on it, I will say that Checkpoint doesn't support it anyway. It suffices it to say that it works fine with the E1000 adapter. (As long as you can remember to change it. ;))

Why now?

The first theory is that more and more we are creating our VMs from scratch in vCloud Director. By doing so, our network adapter will automatically become flexible. In addition to that, a theory is once the machine is created, it is moved to the catalog and used to clone out a number of other machines, all with Flexible adapters.

Forget to install VMware Tools on our template, and it becomes a pain in the neck to deploy from the catalog, boot it, install tools, "re-templatize" it by fixing any guest customization setup we had, power it down and then copy it back to the catalog.

Last theory, again about VMware tools...I have to hand it to VMware Workstation. They bug you to death about installing VMware Tools installation with the slide up/down bar. That thing is annoying, but effective. I guarantee VMware tools is installed on all my workstation VMs. Where is that annoy-bar in vCloud Director? Not everyone using vCloud Director is going to be an expert and know the importance of VMware tools.

Script!

What's a geekafterfive.com blog post without some insane PowerCLI script? This script nicely outputs a list of VMs for you with flexible adapters that are missing VMware Tools. I'd be interested to know the percentages everyone else is seeing on both vSphere implementations and vCloud implementations. If it's a little crazy looking, it is because I preferred fast runtime over readability.

# Get all VM objects
$vms = get-view -viewtype virtualmachine

# Set up an empty array
$table = @()

# For Every Vm...
Foreach ($vm in $vms)
{
    # If Tools aren't installed and there is a PCNet32 adapter in the hardware list...
    if ($vm.guest.toolsstatus -eq "toolsNotInstalled" -and (($vm.config.hardware.device | %{$_ -is [VMware.Vim.VirtualPCNet32]}) -contains $true))
    {
        # Then output it to an object and add it to the array
        $table += New-Object PSObject -Property @{"Name"=$vm.name; "ToolsStatus"=$vm.guest.toolsstatus; "NicType"="Flexible"}
    }
}

# Output the table. You can Export to a CSV or whatever here.
$table

Epilogue

So, Dear Reader, If you have read all the way through this epic post, or just scrolled down past all the tl;dr stuff , let me summarize what you need to know:
  • Flexible adapters on your VMs in combination with a lack of VMware Tools is BAD.
  • Install VMware tools
  • Change your adapter type to E1000
  • Or do both, and you have the option for VMXNET3. ;)
comments powered by Disqus