VMware Cloud Community
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

Reg: inventory

HI All,

how to get the VC inventory ?

share the scripts

Need the following formats

Volume Name LUN Name Storage Controller Cluster Name Virtual Machine Name

Thansk & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You save the attached file as .ps1 file.

From the PowerCLI prompt, you connect to vCenter with Connect-VIServer.

Then you execute the script with

.\the-script.ps1

provided you're position in the folder where the .ps1 was saved.

You can find a good intro on using PowerCLI in this Introduction to using VMware vSphere PowerCLI post.

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
14 Replies
lamw
Community Manager
Community Manager
Jump to solution

Please try not to post the same question in multiple forums, duplicated thread from -

Can you provide a little more details on the "type" of script? Are you working in a Windows/Unix/Linux environment? What language do you plan on using?

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

HI William Lam,

i am using vi-toolkit - windows powershell .

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

Moved to the PowerCLI forum. Your other thread has been deleted.




Dave

VMware Communities User Moderator

Now available - vSphere Quick Start Guide

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

Thanks a lot

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you already check the scripts in ?

And I'm not sure what you mean with the 'Virtual Machine Name".

LUNs, controllers... are connected to ESX(i) servers.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

HI Lucd ,

Thanks for storage script. i have 50 data stores . i want know each data store how many VM'sare stored at a time .

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership
Jump to solution

What do you mean with "Volume Name" ? Is that the Datastore name ?

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

S . DATA STORE NAME

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

Hi Lucd ,

i want output as

Volume NAME/ DATASTORENAME LUN NAME ( LUN PATH) CONTROLLER CLUSTER NAME VM's Name

i am using Netapp Ontap 7.3 storage Let me know any confusions

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The script became a bit more complex then I originally thought it would be.

Give the attached script a try.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

Hi Lucd,

Thanks a lot .. let me know how to exceute this script... i am using windows powershell

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You save the attached file as .ps1 file.

From the PowerCLI prompt, you connect to vCenter with Connect-VIServer.

Then you execute the script with

.\the-script.ps1

provided you're position in the folder where the .ps1 was saved.

You can find a good intro on using PowerCLI in this Introduction to using VMware vSphere PowerCLI post.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
BSRKrishna
Enthusiast
Enthusiast
Jump to solution

HI Lucd ,

Thanks a lot for inventory script ..

one more query . I want know daily how many vms are rebooting and how many are not rebooting( Because in my infrastructure daily basis windows patches will be install. after installation VM s will reboot .. )...

Is there any way we can find guest os patches ..

i) when the patch was installed

ii) Last time vm reboot

iii) Health monitor of VM ..

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership
Jump to solution

1) To know when patches are installed you could query the eventlog of the guest itself.

With the Get-Event cmdlet and by using the Invoke-VMScript cmdlet this should not be too diffcult.

2) For the last reboot have a look at the When was the last time that VM was powered on? post on the PowerCLI blog.

3) Not sure what you mean with 'health monitor'. What exactly do you want to monitor ?

____________

Blog: LucD notes

Twitter: lucd22


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