通过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;
阅读(2766) | 评论(0) | 转发(0) |