ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

vSphere Capacity Report

2022-02-27 12:05:19  阅读:398  来源: 互联网

标签:vSphere Capacity script Create environment report Report capacity your


vSphere Capacity Report

Published: September 29, 2015 Automation

Purpose of the Script:

If you are an admin who manages a vSphere environment then you are in the right place. How many times did you wish for a report that would give you a holistic view of capacity of your environment? Well, I know you can get that from vRealize Operations Manager, but what about a simple script which can give you similar information but in more compact form. Imagine logging in to your system in the morning and opening a HTML report which gives you at a glance information of your environment. This script does exactly that.

What exactly does it do?

This is a script which generates a HTML report on overall capacity of a vSphere environment. For example, it can tell you what is the total available physical cores in your environment. What is the allocated vCPU and Used vCPU in your environment. Similar information for memory of the environment is also available. It will also tell you the total number of VM's in the environment. At the end it gives you view of all the datastores.

The script gives you a close approximation of the resources, since it does not calculate the memory overhead of the VM's or memory required by the hypervisor, so it is not an exact value, but would give you fair idea about your environment capacity.

The best part of this script is, it breaks down the information from overall capacity to Cluster level to Host level. So that you can get a fair idea of the environment.

How does it work?

This is a plain PowerShell script which you can run manually or schedule it in Windows Scheduler. There is a single script Get-Capacity.ps1 which when run will generate the report for the environment. To run the script, follow the following format: 

Get-Capacity -vcenter  -vcuser  -vcpassword  -consolidation 
Copy

Note the Consolidation parameter. Depending on the number of available physical cores, the script calculates Available vCPU count. This count is generated based on the CPU consolidation ratio that you want for your environment.

Sample Output:

A sample output is shown below.

vSphere Capacity Report

Areas of Improvement:

This is the first cut of the script and I plan to improve the following areas.

  • Create a front end form where users will be able to choose the Clusters on which the Capacity test will be done
  • Create separate functions for calculating capacity at different layers
  • Create separate function to get the HTML output
  • Create more proper Verbose and Debug output
  • Create more detailed logging
  • Take input from credential file

Also I plan to collaborate with my reader and take inputs for them. This script is more of educational value than practical value. So I want my readers to work on this and provide suggestions.

Where to get it?

You can download the main script as well as the sample HTML file from the GitHub repository at https://github.com/sajaldebnath/vsphere-capacity-report .

So let's start!!!!!!!!!!!!!!

标签:vSphere,Capacity,script,Create,environment,report,Report,capacity,your
来源: https://www.cnblogs.com/appdot/p/15941859.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有