VMware {code} Community
kpc
Contributor
Contributor

Web Based VM list

I'd like write a simple script / html webpage / webapp that displays a list of all my ESXi hosts and the VM's running on them.  I plan on using this as a backup if I lost my vcenter, just so I could tell which VM is hosted on which ESXi server.

I wrote something similar but very primitive a few years back using esxcli commands cobbled together with linux scripting which worked very well for my 10 or so ESX3.0 servers

I've seen there's some interesting web services tools out there, including VMRC API which opens up the possibility

What do people use for a backup to their vCenter's?

Are there any existing scripts out there that does what I'm looking for, or an alternative if I'm barking up the wrong tree.

Many thanks

Reply
0 Kudos
2 Replies
lamw
Community Manager
Community Manager

Hi kpc,

When you say backup of vCenter, what do you mean? All the inventory objects, configuration, folders, etc. are all stored in the vCenter DB. The database is what you should be backing up and if you lost the DB, you could restore and assuming all your hosts were still functional and you just lost your vCenter DB, the inventory would also be restored.

Are you currently using DRS? If so, capturing VMs on an ESX(i) host isn't too useful as DRS will automatically load-balance the workload and periodically move them based on load.

It is pretty trivial to get a list of VMs to Host mapping, but I don't know how useful that would be from a restore prespective. You should definitely be backing up your vCenter DB using the standard tools provided by the database that you are using.

Reply
0 Kudos
kpc
Contributor
Contributor

Hi William

When I say backup of vcenter I'm refering to an alternative for situations when the DB, for whatever reason has died.  In those situations the DB may take some time to restore/fix, in the meantime a vcenter user may want to access a VM but can't since vcenter is down.

I had this situation this week when my vcenter appliance, which only has 120 VM's on it stopped working.  Whilst I was looking into the issue I had users asking me how to access their VM's.  The only way I could think was to access the ESXi host directly using the VI client or use a tool like Boomerang but the user firstly needs to know which ESXi host their VM is on.

I thought if there was a secondary dynamic webpage that listed which VM was on which ESXi server.  A kind of poor mans vCenter. This is what I used when my firm was just starting out with VMware around 6 years ago and didn't want to stump up the cash for vCenter.  As you can guess managing 5+ hosts without vCenter is It was proving difficult to manage   Every 30 minutes each ESX server produced a list of VM's, this was then displayed on a central webpage.  It was really simple but very useful.

Interestingly I hadn't thought of the DRS issue but we don't use it.

Incidentally our backup team backs up the vCenter appliance using Acronis for VMware, which of course is no substitute for a proper DB backup.  Before that I used your backup script which worked great, then the backup team stepped in and decided to pay for Acronis.  I've yet to be convinced it's as good!

Cheers

Reply
0 Kudos