This website use cookies to help you have a superior and more admissible browsing experience on the website.
Loading...
In a scaling VMware environment, knowing your resource status isn’t just a daily task; it’s a necessity for security, capacity planning, and disaster recovery. If your VM data remains trapped inside the vCenter UI, you’re one step behind.
This guide skips the fluff and provides four professional methods of how to export your entire VM list, from simple GUI exports to high-speed automation. Whether you need a quick status report or a deep-dive technical audit, these technician-tested methods will help you take control of your infrastructure data instantly.
For most administrators, the built-in vSphere Client GUI is the quickest way to perform a vSphere export virtual machine inventory. This method requires no scripting knowledge and works directly within your browser.
This method is best for quick audits, non-technical managers who need a status report, or small environments where automation isn’t yet a priority. It’s the perfect right-now solution for a clean inventory snapshot.
The steps vary slightly depending on your vCenter version. Here is how to handle modern environments:
If you are managing more than a handful of hosts, PowerCLI is the gold standard. It is VMware’s official command-line tool, built on PowerShell. PowerCLI allows you to customize specific data fields and handle thousands of VMs in seconds—tasks that would be tedious in a GUI.
Using PowerCLI to export the list from vCenter is a great way to ensure your inventory data is clean, repeatable, and ready for professional reporting.
Step 1: Install PowerCLI
If you haven’t used it before, open PowerShell as an Administrator and run:
Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Force
Step 2: Connect to your vCenter Server
Replace the placeholders with your actual server details:
Connect-VIServer -Server <vCenter-IP/FQDN> -User <Username> -Password <Password>
Step 3: Export All VMs (Basic List)
This command grabs the standard details and saves them to a CSV:
Get-VM | Export-Csv -Path "C:\vCenter_VM_List.csv" -NoTypeInformation -Encoding UTF8
Step 4: Export Custom Fields (The Professional Way)
Admins often need specific details like IP addresses and UUIDs for inventory mapping. Use this advanced script:
Get-VM | Select-Object Name, @{N="IP Address";E={$_.Guest.IPAddress -join ","}}, NumCpu, MemoryGB, VMHost, Datastore, UUID | Export-Csv -Path "C:\Custom_VM_List.csv" -NoTypeInformation -Encoding UTF8
Step 5: Disconnect (Best Practice)
Always close your session when finished to free up vCenter resources:
Disconnect-VIServer -Server * -Confirm:$false
For developers and DevOps engineers, using the vCenter REST API to export VM list is the most powerful choice. With the vSphere Automation API, you can integrate inventory data directly into custom dashboards, CMDBs, or CI/CD pipelines without relying on manual tools.
To use this method, you will need Python installed along with the requests library. This script handles authentication, data retrieval, and CSV generation.
Step 1: Authenticate and Get a Session Token
First, establish a secure session with vCenter to receive an authentication token.
import requests
import csv
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# Disable SSL warnings for self-signed certificates
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
vcenter_ip = "<vCenter-IP>"
username = "<Username>"
password = "<Password>"
# Get auth token
auth_url = f"https://{vcenter_ip}/rest/com/vmware/cis/session"
response = requests.post(auth_url, auth=(username, password), verify=False)
token = response.json()["value"]
headers = {"vmware-api-session-id": token}
Step 2: Fetch VM Data
Once authenticated, we query the vcenter/vm endpoint to pull the raw inventory data.
vm_url = f"https://{vcenter_ip}/rest/vcenter/vm"
vm_response = requests.get(vm_url, headers=headers, verify=False)
vm_data = vm_response.json()["value"]
Step 3: Parse and Export to CSV
Finally, loop through the JSON response and write the specific fields to a local CSV file.
with open("vCenter_VM_List_API.csv", "w", newline="", encoding="utf8") as f:
writer = csv.writer(f)
# Define headers
writer.writerow(["VM Name", "Power State", "CPU Count", "Memory (GB)"])
for vm in vm_data:
# Convert MiB to GB for better readability
memory_gb = vm.get("memory_size_MiB", 0) / 1024
writer.writerow([vm["name"], vm["power_state"], vm["cpu_count"], memory_gb])
print("Export Complete: vCenter_VM_List_API.csv")
For administrators who need more technical depth or platform-specific flexibility, these two tools are industry favorites for extracting vCenter data.
Exporting your VM list is the first step toward infrastructure visibility, but visibility alone doesn’t prevent data loss. Once you have identified your critical workloads through an inventory export, the next priority is ensuring they are protected.
i2Backup provides a seamless transition from “knowing what you have” to “protecting what you have” with a robust, agentless backup solution.
Choosing the right export method depends on your goal: use the vSphere Client for speed, PowerCLI for scale, the REST API for integration, or third-party tools for deep audits.
However, remember that a CSV file is just a snapshot. To truly master your environment, use that inventory to build a resilient data strategy. Transitioning from manual tracking to an automated, agentless solution like i2Backup ensures that every VM you’ve identified is not only accounted for but also fully protected and recoverable. Stop just listing your assets—start securing them.