Update vSphere through VMware Update Manager with PowerCLI

I’m always amazed of what you can do with PowerCLI.

Actually I’m having version 4.1 of vCenter/vSphere

I’m using complete PowerCLI script to configure freshly installed vSphere. I was configuring everything but the last patches.

VMware released for some times already a VMware Update Manager PowerCLI. It needs to be installed in addition of the PowerCLI.

You can download the Update Manager PowerCLI installer package from the product landing page at https://www.vmware.com/support/developer/ps-libs/vumps

Beware of downloading the same release than the one you are using on your infrastructure.

I tried the release 5.0 against my 4.1 infra and it didn’t work at all…

I won’t put my vSphere hosts’ configuration script in this post but I’ve made a dedicated one for VUM PowerCLI.

Okay, it does what you can already do with the vSphere client but it includes the necessary cmdlets to integrate them into any script you like.

I made this script:

vCenter_Update_vSphere_w_VUM_dyn_listbox

In the script you have to change the credential used to connect to the vCenter server, set the correct vCenter address. You can also specify the Datacenter in which you want to work with.

The first thing this script does is to verify that the VUM’s snapin is loaded. If it is not the case the script exits.

When you are ready to go, the script will give you the list of ever hosts which are either connected or in maintenance.

Once the host selected the script will ask if you want to download the last patches.

Then the host will be scanned. After the compliance status is verified. If no baseline is somehow attached to the host, the script exits.

Only the baselines of type “patch” which are not compliant with the hosts are taken into considerations and will be remediating.

As I said earlier this code can be easily integrated in a another script

2 thoughts on “Update vSphere through VMware Update Manager with PowerCLI”

  1. Hello I am so glad I found your web site, I really
    found you by mistake, while I was browsing on Google for something else,
    Anyhow I am here now and would just like to say thanks a
    lot for a incredible post and a all round enjoyable blog (I also love the theme/design), I don’t have time to
    look over it all at the minute but I have saved it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the superb work.

    Reply
    • Hi, thank you very much for your comment. I really appreciate it. Several posts are coming around virtualization: Horizon View with vSGA (3D hardware), vShield endpoint with the Mcafee solution, etc…

      Reply

Leave a Comment