VMware Cloud Community
bernz
Enthusiast
Enthusiast

vSphere environment dashboard page

Hello guys,

I would like to implement on our environment a dashboard using htm page showing a search box for  virtual machine, host & datastore.

This will help us showing info of the object searched.

Is this possible?

0 Kudos
5 Replies
LucD
Leadership
Leadership

You could take a look at my vSphere Object by Path post.

It takes a path to an object (which would come from a treeview in your app) and returns the vSphere object, which will give you access to all properties for that object.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
bernz
Enthusiast
Enthusiast

Hi LucD

Basically, my expected output is the details of VM I searched. Like what Search My VM tool does before, it sends back VM vcenter, datacenter, cluster, config, host, vmx location, datastore.

0 Kudos
LucD
Leadership
Leadership

Not sure what you mean by 'config'.

For the others, try something like this

$vmName = 'MyVM'

Get-VM -Name $vmName |

Select Name,

    @{N='vCenter';E={$_.Uid.Split(“:”)[0].Split(“@”)[1]}},

    @{N='Datacenter';E={Get-Datacenter -VM $_ | select -ExpandProperty Name}},

    @{N='Cluster';E={Get-Cluster -VM $_ | select -ExpandProperty Name}},

    @{N='Host';E={$_.VMHost.Name}},

    @{N='VMX';E={$_.ExtensionData.Config.Files.VmPathName}},

    @{N='Datastore';E={(Get-View -Id $_.ExtensionData.Datastore -Property Name | Select -ExpandProperty Name) -join '|'}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Gsanty
Contributor
Contributor

Bernz,

Even i too looking for the same. By any chance did your requirement completed ?

0 Kudos
bernz
Enthusiast
Enthusiast

0 Kudos