, , ,

Configure VMware Tools repository using the vSphere API

Here’s a good one for y’all…I’m going to walk thought how to update the location for VMware Tools (a.k.a. the Product Locker) and change/update it, without rebooting your ESXi host.

You may ask, “why would you want to do that??” Well, the main use case would be to centralize the repository and installation files of VMware Tools for your host/updates for a consistent installation experience.

This all can be done via PowerCLI of course, but in this vlog I’ll illustrate the use the MOB (Managed Object Browser) and the vSphere API to accomplish the task.

Let’s start: go to your browser and enter in “https://<your VCSA appliance>/MOB” get to the Managed Object Browser.

From there, we’ll need to take a look the Properties table, and begin to navigate down the hierarchy tree (content -> rootFolder -> childEntity -> hostFolder -> childEntity -> host), down to the area we need to change the Product Locker value.

Let’s start at the main page, Properties table, and click on the content value:

Then find the Name rootFolder – the value is the group name of your Datacenter – mine is called “group-d1“, click on it and drill down into the datacenters:

Note that the rootFolder name is referring to the value associated to your datacenter, which can also be found in the URL string when highlighting the menu item in vCenter:

From here we want to find and select our datacenter. I only have one single DC, so I’m going to look at the childEntity name and click on the value datacenter-2:

Once the DC is selected and clicked on it will then dig down into the hostFolder and select group-h4:

Now we selected the hostFolder, and I will click on the childEntity I want to dig into. I have two clusters – the host I want to edit is in the MW-MGMT cluster, which has a value of domain-c2797:

From here I need to find and click on my individual ESXi host. Again, I can find the value of the host in the URL:

And it should match the host value found in the MOB, mine is host-5090:

FINALLY I’m within the host and can now leverage the API to view/edit settings. This is where we leverage the API methods.

Scroll down past the Properties table and view the Methods table.

The methods are are wanting to invoke are: QueryProductLockerLocation and UpdateProductLockerLocation_Task, respectively:

Let’s start with verifying the location – click on the QueryProductLockerLocation link, and a new window will pop-up:

Click Invoke Method the value string and current path of the productLocker will be echoed out below in newly populated results table. Copy/paste that value or screen shot for reference later:

I’m going to put my VMtools repo out on some iSCSI shared storage, so I copied them over to the new location on to that shared volume:

Now I need to go into the host and update the product locker location.

Let’s go back to the MOB and find the string and value UpdateProductLockerLocation_Task, and click on it:

Just like before, a new window will pop up and we’ll click on Invoke Method:

Now I’m going to copy/paste the new path to the shared storage where I want the new productLocker repository: /vmfs/volumes/5e4e1b7d-8e579840-4d21-f04da2dd8258/ISOs/vmtoolsRepo

Then click on Invoke Method. The window will update, and below you’ll see the Method Invocation Result, like this:

From here the window can be closed, and we’ll go and verify the new location.

Find and click again on QueryProductLockerLocation:

Repeat the above steps and click Invoke Method:

And the result should return the new productLocker path:

Leave a Reply

Your email address will not be published. Required fields are marked *