5

I'm doing an inventory of both our physical and virtual machines. I'd like to export a list of virtual machines from vCenter instead of having to type everyone into a spreadsheet. Anybody know of an easy way to do this in vCenter 5.5? I've seen instructions for earlier versions of vCenter but they don't seem to apply to 5.5.

I'm also using the web client, not the full version of vSphere.

Dave M
  • 4,514
  • 22
  • 31
  • 30
natediggs
  • 107
  • 4
  • 5
  • 13

8 Answers8

7

In the Windows VMware vSphere Client program --

  1. Select your Datacenter, cluster or host.

  2. Select the Virtual Machines tab.

  3. Right click an empty area of the window and select "Export List".

  4. Type a file name and click the "Save" button.

  5. Done.

Note that the default file type when exporting the list is htm/html but you can change it to xls or csv (among others).

CPrescott
  • 25
  • 5
joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • 1
    I don't seem to have the "Export List" option in the web client. – natediggs Mar 03 '14 at 18:23
  • Sorry. I should have specified using the Windows vSphere client. – joeqwerty Mar 03 '14 at 19:06
  • 3
    In the new web client, which comes with vsphere 5.5, this can be done like this: select your hypervizor or cluster, go to related objects -> virtual machines and in the left bottom corner you'll see an export button. Click it, pick columns you want (you definitely want the 'Host' column among others) and then click 'generate CSV report' and then 'save'. – Roman Grazhdan Mar 04 '14 at 05:46
  • 1
    @RomanGrazhdan: In my Web client, the export button was in the right-bottom corner. – jobin Apr 07 '15 at 07:01
6

PowerCLI:

Add-PSSnapin Vim.VMwareAutomation.Core
Connect-VIServer $vCenterServer

Get-VM | Select -Property Name | Set-Content listOfVMs.txt

Somthing similar to that should get you started.

2

Edit: it's 2016 now and I still have to deal with these. I now think that cronjobs on the hosts are not reliable at all. The tool I now use to get lists and run basic tasks is govc, vmware's official open source project written in go (cross platform, single binary): https://github.com/vmware/govmomi/blob/master/govc/README.md


I have a cronjob doing this for me on a regular basis (ESXi comes with ESXi shell which might be more familiar for Linux users).

The command is

vim-cmd vmsvc/getallvms | grep -v Vmid | awk "{print \$2}" 

grep here just removes the header.

Both shell and ssh server should be enabled in order for this to work.

I also run this command before running ghettoVCB so that I always backup all of the machines, no matter if any of them had been migrated or created recently.

Roman Grazhdan
  • 334
  • 3
  • 15
2

In the bottom right of the main virtual machine screen there is an icon to export as a csv. you can select all the items or just one. it allows you to select the different columns for the export also.

Eric
  • 21
  • 2
1

We use RVtools. It is free, fast, reliable, and easy to use.

http://www.robware.net/

0

To Export a complete list of VMs in 5.5, open the Web Client. Then click on your data center then click on the Virtual Machines tab. Select all VMs then at the very bottom right of the list of VMs you'll see the number of objects. CTRl Click the Paper Icon to export your list. This works.

0

Now that vCenter 6.5 doesn't support the C# client I thought I would add to this. In the vSphere Web-client (Flash), you can select a list of VMs and click the export button at the bottom of the list. I don't see a way to do this in the host HTML5 client (aka just vSphere) now.

Cory Knutson
  • 1,876
  • 13
  • 20
0

This repository will help you to list all VMs and Snapshots information on vCenter, using AD credentials or username/password.

Swisstone
  • 6,725
  • 7
  • 22
  • 32