VMware Stand-alone Inventory Agent for FlexNet Manager Suite
For secure environments (for example, VMware servers secured by firewalls), Flexera offers a stand-alone VMware inventory collection agent that can be installed on a Windows server.
This article explains what you need to know and do to use it.
Discovery and inventory information is a prerequisite to performing license consumption calculations in FlexNet Manager Suite. We recommend that you deploy one or more inventory beacons on your network, and use any of the supported inventory collection methods to collect VMware inventory. Each inventory beacon collects discovery and inventory information from the devices within its assigned subnet and sends this information to FlexNet Manager Suite. To collect inventory, each inventory beacon requires a network connection to the target VMware vCenter or ESX servers within its assigned subnet.
In secure environments (for example, VMware servers secured by firewalls), you may not be able to establish a network connection between each installed inventory beacon and the VMware servers within its assigned subnet, or you may not be able to install any inventory beacon at all. For such environments, Flexera offers a stand-alone VMware inventory collection agent that can be installed on a Windows server. Although capable of collecting inventory from individual VMware ESX servers, this agent works more efficiently with VMware vCenter servers, where it collects inventory for all VMware ESX servers registered with the target VMware vCenter server. In a clustered environment, the agent can collect VMware inventory for the entire VMware cluster through the target VMware vCenter server. The stand-alone agent saves the collected VMware inventory information (as .ndi files) to a specified location. You will have to export the collected data to FlexNet Manager Suite for performing license consumption calculations.
The stand-alone VMware inventory agent has been designed to remotely collect VMware (ESX or vCenter) inventory when you cannot use any of the inventory collection methods recommended by Flexera. You can deploy this agent on any computer with Windows desktop (Windows 7 or higher) or Server (2008 or 2012) edition. To collect VMware inventory, the agent needs credentials for an account with read access to VMware SDK URL on each of the target VMware servers. When you run the agent after configuring it with the details of the target VMware servers, the agent collects VMware inventory using API calls. The collected information is saved to a configured location from where it can be uploaded to FlexNet Manager Suite for license consumption calculations. The following diagram illustrates the process of VMware inventory collection through the stand-alone VMware Inventory agent:
To collect VMware inventory through the stand-alone VMware inventory agent, complete the following steps:
- Verify the prerequisites. See the Prerequisites section below.
- Deploy the inventory agent. See the Deploying the Agent section below.
- Configure the inventory agent. See the Configuring the Agent section below.
- Collect VMware inventory. See the Collecting Inventory section below.
- Export the collected inventory to FlexNet Manager Suite. See the Exporting Inventory section below.
- (Optional) Uninstall the inventory agent. See the Uninstalling the Agent section below.
The following are the prerequisites for inventory collection using the stand-alone VMware inventory agent:
- A VMware vSphere/vCenter/ESXi server, supporting versions from 5.0 to 6.7 inclusive.
Note: Inventory is not possible on the free license versions of ESXi.
- The following software products are required on the server where the agent is to be deployed:
- Windows desktop (Windows 7 or higher) or Server (2008 or 2012) edition
- Microsoft .NET Framework version 4.0 or later.
- Network access to the target VMware vCenter or ESX hosts.
- An account with read access to the VMware SDK URL is required on each target vCenter or ESX host.
Deploying the Agent
The stand-alone VMware inventory agent is shipped as a zip archive. Follow these steps to deploy the agent:
- Create a folder (for example, VMwareInventory) on the Windows desktop or any other location.
- Extract the contents of the Flexera-supplied stand-alone inventory agent file FNMS-VMware-Scanner.zip into this folder.
- Using Windows Explorer, create a folder to save the collected inventory information (for example, C:\Inventories\). You should add this path to the OutputDir parameter in the esxquery.ini file.
Configuring the Agent
To enable the stand-alone VMware inventory agent to collect inventory from target VMware servers, register every target VMware server with the agent, and record the VMware server name in the esxquery.ini file. Follow these steps to configure the agent:
- On the computer where you deployed the agent, launch the Windows command prompt with the "Run as administrator" option enabled and browse to the VMwareInventory folder.
- Invoke the agent by using the following command. The agent should display a list of available options:
server Query specified server -a Query all configured servers -l List configured servers and credentials -s Set logon credentials for server -d Delete logon credentials for server -c Use existing logon session cookie -f Set VMware license flag for server
- When the agent is not being run for the first time, use the following command to list any previously-targeted VMware servers that are still registered with the agent:
- If any undesired VMware servers are registered with the agent, use the following command with the name of the VMware server whose registration is to be deleted:
esxquery.exe -d <server name>where <server name> is the VMware server name.
- Use the following command to register a target VMware server with the stand-alone VMware inventory agent. The agent will collect inventory only from the VMware servers registered with it:
esxquery.exe -s <server name>where <server name> is the name of the target VMware server that is to be registered with the agent. The agent prompts you to enter the credentials for this server.
- Enter the credentials for the account with read access to the VMware SDK URL <https://<server name>/sdk>> created on this VMware server.
- Repeat step 5 for each of the target VMware servers. The agent records each server name with its username and encrypted password in the esxquery.ini file in the VMwareInventory folder.
- Set the OutputDir parameter to the path where you want the agent to store the collected inventory files. The following code example sets the output directory to the .\Inventories sub-folder under the VMwareInventory folder. The following code also describes how two VMware servers, server1 and server2 have been recorded in the esxquery.ini file.
[Global] OutputDir=.\InventoriesThe esxquery.exe tool encrypts the password automatically, before saving it to the esxquery.ini file.
[server1] Username=<domain\user name> Password=CtCi3795PXgxC3W8W7gdSg==
[server2] Username=<domain\user name> Password=EEfoiY3pmz0xC3W8W7gdSg==
- Use the following command to review the list of VMware servers registered with the stand-alone agent:
Your agent is now ready to collect inventory from the target VMware servers.
When you have registered all target VMware servers with the stand-alone VMware inventory agent, you can run the agent to collect VMware inventory from the registered VMware servers. Follow these steps:
- Use the following command to run the stand-alone VMware inventory agent. The agent executes, collects inventory from each of the servers listed in the esxquery.ini file, and saves the inventory files (.ndi) in the output folder specified in the esxquery.ini file.
esxquery.exe -aThe agent runs and displays inventory success messages. The following code shows an example output:
C:\Flexera\VCenter Query>esxquery.exe -a
servername: found VMware vCenter Server v4.1.0
servername: inventory generated successfully
- Using Windows Explorer, navigate to the output folder (C:\VMwareInventory\Inventories). You should see an .ndi file for each of the target ESX servers. Each .ndi file contains inventory for a target ESX server, as well as all of the virtual machines registered with it.
Note: The stand-alone VMware inventory agent also collects inventory for the virtual machines that were switched off during the inventory collection process.
The license consumption calculation process of FlexNet Manager Suite requires the collected .ndi files for calculating your VMware license position.
If you have installed FlexNet Beacon, you can manually transfer the collected inventory (.ndi) files to the Incoming\Inventories folder. The FlexNet Beacon uploads the inventory to FlexNet Manager Suite.
If you have not installed any inventory beacons, you can use any third-party methods to export the imported inventory to the "C:\ProgramData\Flexera Software\Incoming\Inventories" folder on the FlexNet Manager Suite server.
Uninstalling the Agent
You can easily uninstall the stand-alone VMware inventory tool by deleting the:
- Deployment folder (VMwareInventory)
- Output folder (Inventories).
Appendix: API Calls for VMware Inventory Collection
The stand-alone VMware inventory agent connects to the VMware SDK URL (https://<servername>/sdk) on each target VMware server. This connection requires an account with read access to the SDK URL. Once a connection is established with the target VMware server, the agent makes the following API calls through the SDK:
|GetServiceContent||A single call is made to this API to retrieve the ServiceInstance to enable further queries.|
|RetrieveProperties: Host Information||A single call is made against the root folder to return information about each host server with the following attributes:
|RetrieveProperties: VM Information||A call is made against each returned HostSystem to obtain the following attributes for each virtual machine that exists on the host: