Forcing VMs to use the Flexible Network Adapter

One of my customers uses the Sophos UTM virtual appliance as a firewall/router.  It was originally set up as an Astaro version 8 virtual appliance and has been upgraded in place since then.  When that appliance was first made available, it used the Flexible network adapter by default, although the recommendation now is to use vmxnet3 for better performance.  Unfortunately, during the upgrade process, this change never went into place.

We’re trying to help this customer to resolve some performance problems and have identified that network adapter type as a potential bottleneck in their environment.  Before changing such a vital piece of a live environment, I decided to prototype it in the lab.  It turns out that Sophos no longer provides the virtual appliance, instead providing an ISO to install the software onto a VMware virtual machine.  No problem, I thought, and so I created the VM in my lab, aiming to match the appliance’s configuration settings.

As with so many other virtual appliances, this one’s OS type was “Other 2.6.x Linux (64-bit)” and so I built my VM to match.  Memory/vCPU count was no problem, but the network adapters gave me pause.  You can’t select Flexible for that OS type, yet the original appliance definitely had that adapter installed.  I knew that manually editing the VMX file for the VM was going to be the solution, but a bit of googleing didn’t reveal the appropriate syntax to use that particular adapter.  After a bit of head scratching, I realized the obvious solution – make a new DOS VM (which supports that adapter) and just compare the two VMX files myself.  Here’s what I saw:

On the UTM machine (with a e1000 adapter), the network adapter was defined like this:

ethernet3.present = "TRUE"
ethernet3.virtualDev = "e1000"
ethernet3.networkName = "VM-NetworkA"
ethernet3.addressType = "vpx"
ethernet3.generatedAddress = "00:50:56:b7:4b:ad"

On the DOS machine (with the flexible adapter), the network adapter was defined like this:

Ethernet0.present = "TRUE"
Ethernet0.networkName = "VM-NetworkA"
Ethernet0.addressType = "vpx"
Ethernet0.generatedAddress = "00:50:56:b7:3d:fe"

Notice that the line that defines the adapter type (the .virtualDev line) is just plain missing on the DOS machine.  It looks like the system defaults to a Flexible adapter when nothing else is specified… and if you actually want to use that adapter type for some reason, you just need to delete the statement that makes it another type.  So, I did the following:

1) Shutdown the UTM VM
2) Open the datastore browser that has my UTM VM and browse to the VM’s folder
3) Download the .vmx file onto my desktop
4) Edit the file in Wordpad
5) Delete the ethernet3.virtualDev = "e1000” line from the file and save
6) Upload the modified .vmx file back onto the datastore, overwriting the existing one (make a backup first!)
7) Find the existing VM in the inventory, right click on it and select Remove from Inventory
8) Right click on the modified .vmx file and select Add to Inventory and complete the wizard

And it worked!  What’s more, I was able to establish that the Flexible adapter only has between 1/4 and 1/5 the performance of the vmxnet3 adapter.  So, by simply removing the virtualDev line (that specifies the virtual device type) from that adapter in the VM’s configuration file, I was able to very easily force the VM to use the Flexible vmnic adapter type, even though it wasn’t available in the GUI for selection.


Popular posts from this blog

Orphaned VMDK Files

Migrating from one vCenter to Another, Improved

Deleting Orphaned (AKA Zombie) VMDK Files