Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3621004
  • 博文数量: 738
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 8006
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(738)

文章存档

2024年(24)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客

分类: 虚拟化

2017-10-13 10:55:13

通过vcenter管理导出宿主机列表时可能信息不太全,可以通过内部数据查到想要的结果。

--host 宿主机信息
select * from vpxv_hosts;


--vm 虚拟机信息
select * from vpxv_vms;


--my vm 包含集群信息的虚拟机
select e2.name,
       v.DESCRIPTION,
       h.IP_ADDRESS host_ip,
       v.name,
       v.IP_ADDRESS,
       v.power_state,
       num_vcpu,
       round(mem_size_mb / 1024) mem_g,
       v.guest_os,
       v.guest_state,
       v.DNS_NAME,
       v.VMMWARE_TOOL,
       trunc(sysdate-v.BOOT_TIME) start_day
  from vpxv_vms v, vpxv_hosts h, vpx_entity e, vpx_entity e2
 where h.HOSTID = v.HOSTID
   and h.HOSTID = e.id
   and e.parent_id = e2.id
 order by e2.id;


--my host
select e2.name,
       h.ip_address,
       h.host_vendor,
       h.host_model,
       h.cpu_count,
       --h.cpu_model,
       round(h.mem_size / 1024 / 1024 / 1024) mem_g,
       h.nic_count,
       h.hba_count,
       trunc(sysdate-h.boot_time) start_days,
       h.product_fullname,
       case h.POWER_STATE when 0 then 'Off' when 1 then 'On' when 2 then 'Suspended' end as zt,
       CASE h.MAINTENANCE_MODE when 0 then 'NO' when 1 then 'YES' end as MMode 
  from vpx_host h, vpx_entity e, vpx_entity e2
 where h.id = e.id
   and e.parent_id = e2.id;


-- datastore used 使用率
select name,
       round(capacity / 1024 / 1024 / 1024) size_g,
       round(free_space / 1024 / 1024 / 1024) free_g
  from vpxv_datastore t
order by free_g;


--entity 条目(各类名称:数据中心名、集群名等)
select * from vpxv_entity;


-- user define label 自定义字段
select * from VPXV_VM_FIELDS t;



--查询日志文件大小
SELECT * FROM (select VM_ID,KEY_VAL,NAME,round(to_number(FILE_SIZE)/1024/1024/1024) FILE_SIZE,FILE_UNIQUESIZE,TYPE from vpxadmin.VPX_VM_FLE_FILE_INFO where type='log' ORDER BY to_number(FILE_SIZE) DESC) WHERE ROWNUM<11;

阅读(2842) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~