送Vcenter数据库导出虚拟机主要信息报表

1、登陆虚拟机的数据库(大部分vcenter用的都是MSsqlserver)

2、输入脚本

use VIM_VCDB
select  D.NAME as 集群名称,C.* from (select  b.NAME as 主机名,a.* from (select NAME AS 虚拟机名称,HOSTID AS 主机ID,RESOURCE_GROUP_ID AS POOLID,MEM_SIZE_MB AS 内存,NUM_VCPU AS CPU核心数,round(AGGR_COMMITED_STORAGE_SPACE/1073741824,2) AS 硬盘空间 from dbo.VPXV_VMS)as a left join VPXV_HOSTS as b on a.主机ID = b.HOSTID) as C left join dbo.VPXV_COMPUTE_RESOURCE as D on C.POOLID = D.RESOURCEPOOLID+1

 

 

 

 

3、
select * from VPXV_HOST_CPU (查看主机cpu主频信息)

4、根据上面的信息整理excel表格

 

 

5、得出结果

 

 

你可能感兴趣的:(数据库,VM,VCenter)