Home > ESX, Flex-10, PowerCLI, Powershell, VMware > Updating Broadcom bnx2x Nic Drivers with PowerCLI

Updating Broadcom bnx2x Nic Drivers with PowerCLI

November 15th, 2010

Now that a new bnx2x driver has been released as detailed in my previous post you will obviously need to deploy it and add it as part of your hopefully scripted build.

I wish VMware Update Manager would be able to apply these driver updates so we can have a single depoyment mechanism but this doesn’t seem to be the case yet.  We live in hope!

So, without Update Manager, I always prefer PowerCLI rather than esxupdate for these kinds of deployments as it fits nicely into a PowerCLI scripted build, you don’t have to have SSH access to install and you can also roll it out easily to multiple ESX hosts.

Download the .ISO file, I’m going to use the 1.60 version for ESX 4.1 as detailed in my previous post.

Mount the .ISO file to a VM. In my VM it mounts as D:\

Extract the folder from the .ZIP file containing the offline bundle driver D:\offline-bundle\BCM-bnx2x-1.60.50.v41.2-offline_bundle-320302.zip to somewhere on your VM.

From the Datastore Browser upload the unzipped folder to a datastore visible to all hosts.  I use a datastore where I store .ISO files and have a subfolder for ESX Patches.

You should now have the folder containing the driver files uploaded to your shared datastore.

Inside the folder are two files:

Now onto the PowerCLI Magic where you use Install-VMHostPatch and point to the metadata.zip file

$VCServerName = "vCenter.local"
$VC = Connect-VIServer $VCServerName
$ESXHost = Get-VMHost "MYESXHost01.local"
$PatchRoot = "/vmfs/volumes/vmiso/ESXPatches/"

# Place host into Maintenance Mode
If ($ESXHost.State -notmatch "Maintenance") {$ESXHost | Set-VMHost -State Maintenance}

# Installing Patch
Write-Host $ESXHost.Name ": Installing Patch: vmware-esx-drivers-net-bnx2x-400.1.60.50.v41.2-1vmw.0.0.00000.x86_64"
Install-VMHostPatch -VMHost $ESXHost -HostPath $PatchRoot/BCM-bnx2x-1.60.50.v41.2-offline_bundle-320302/metadata.zip

#Restart Host
$ESXHost | Restart-VMHost -Confirm:$false

You could run this on a group of hosts at a time. For the sake of this example I’m going to assume that a whole cluster can be patched at once and it doesn’t have VMs running on it otherwise you would need to do a staged approach by doing a few hosts at a time so you had enough capacity in the cluster to keep VMs up and running.

$VCServerName = "vCenter.local"
$VC = Connect-VIServer $VCServerName
$PatchRoot = "/vmfs/volumes/vmiso/ESXPatches/"

Get-Cluster "Cluster01" | Get-VMHost | Sort Name | % {
	# Place host into Maintenance Mode
	If ($_.State -notmatch "Maintenance") {$_ | Set-VMHost -State maintenance}

	# Installing Patch
	Write-Host $_.Name ": Installing Patch: vmware-esx-drivers-net-bnx2x-400.1.60.50.v41.2-1vmw.0.0.00000.x86_64"
	Install-VMHostPatch -VMHost $_ -HostPath $PatchRoot/BCM-bnx2x-1.60.50.v41.2-offline_bundle-320302/metadata.zip

	#Restart Host
	$_ | Restart-VMHost -Confirm:$false
	}
  1. jkasal
    November 24th, 2010 at 22:27 | #1

    Another option is to use VMware update. Though it is not automatically downloaded from Shavlik, you can download the ISO, mount it, then upload the update via the vSphere Client with the Update Manager plugin.

  2. manish
    May 1st, 2012 at 15:33 | #2

    Can I use this information about PowerCLI to update the article for updating async drivers?

  3. WoodITWork
    May 2nd, 2012 at 10:18 | #3

    @manish

    Sure you can, just be nice and credit the source 🙂

  1. No trackbacks yet.
Comments are closed.