VMware {code} Community
asp24
Enthusiast
Enthusiast

Storage vmotion webpage (perl, php, html). How to get progress bar?

I have created a "dirty" web page using PHP (I do not know Perl well) that does the following:

Log in to VirtualCenter (2.5) and get the storage/config file paths for all registered VM's (like this: vm/vm.vmx)

Put the list into a dropdown menu and have an input field for the target storage location. And a move-button to start svmotion.

This is a very dirty solution right now, but it works for me!

The question now is: How can I get a progress bar for the svmotion?

I have included the neccessary files. I have installed this on my apache (linux) webserver with php and perl configured. You will have to install the Remote Client and Perl API to run this.

(VMware-RCLI-1.1.0-64577.i386.tar.gz and VMware-VmPerlAPI-2.3.2-39850.tar.gz used)

Sorry about the bad programming! I'm not exactly a programmer...

Reply
0 Kudos
4 Replies
asp24
Enthusiast
Enthusiast

By the way.. I'm looking for a small script to list ALL datastores in VC. I want ONLY the friendly names, one name per line.

Like this:

Iscsi1_1

Iscsi1_2

Iscsi2_1

etc

I have found some scripts that will list the datastores, but they also list a lot of other info I do not need. I have not been able to modify them to only output what I want. Can someone please give me an example of how to do this ?

Reply
0 Kudos
vmwaredude1
Contributor
Contributor

You can use the vifs command

vifs --server VC server --username administrator --password XYZ -Z 'New Datacenter' --listds

I think, this syntax should work for u

Let, me know the results

Thanks

asp24
Enthusiast
Enthusiast

Thank you! that worked like I wanted it. Now I can have a dropdown menu for destination datastore also.

Now, if I just could find a way to poll the relocate status from vc...

Reply
0 Kudos
asp24
Enthusiast
Enthusiast

The result for now (no progress bar)

Not pretty, but works every time. Smiley Happy

All files should be in the same directory on the webserver. svmotion.html is the start-page.

Change it to your own needs.

edit: a small typo in the vmquery.php page. Missed one =

select name='newpath'

Reply
0 Kudos