From 0b33a5a29eaec3d83888aa717e8f42b91719ff21 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Jun 2026 17:40:26 +0300 Subject: [PATCH] 052 capacity section --- cloud_capacity.cfm | 87 +++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/cloud_capacity.cfm b/cloud_capacity.cfm index 86e3832..e6aa61f 100644 --- a/cloud_capacity.cfm +++ b/cloud_capacity.cfm @@ -55,7 +55,7 @@ - + select @@ -84,7 +84,9 @@ usage as ( select "Cluster" as cluster ,count("UUID_VM") as vms ,sum("VM_vCPU_count") as vm_cores +,sum("VM_vCPU_count"*"VM_is_ON") as vm_cores_on ,sum("VM_vCPU_count"*"VDC_CPU_Speed") as vm_ghz +,sum("VM_vCPU_count"*"VDC_CPU_Speed"*"VM_is_ON") as vm_ghz_on ,sum("VM_CPU_Reserv_GHz") as vm_ghz_reserved ,sum("VM_vCPU_count"*"VDC_CPU_Speed"*"VM_CPU_Reserv_perc"/100) as vm_ghz_reserved_c ,sum("VM_vCPU_count"*"VDC_CPU_Speed"*(case when "VM_CPU_Reserv_perc" IS null then 20 when "VM_CPU_Reserv_perc"<=20 then 20 else "VM_CPU_Reserv_perc" end)/100) as vm_ghz_promised @@ -94,6 +96,7 @@ select "Cluster" as cluster ,sum("VM_RAM_Used") as vm_ram_used ,sum("VM_CPU_Used_AVG") as vm_ghz_usage ,sum("VM_is_ON") as vms_on + from vmreports.compute where ts=(select max(ts) from vmreports.compute) group by "Cluster"), @@ -119,6 +122,7 @@ SELECT ,avg(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Speed" ELSE 0 END) as ghz ,max("CPUtoVM") as ghz_subtract_ha ,max("RAMtoVM") as gb_subtract_ha +,sum("RAM_Total")/sum("CPU_Cores") as gb_per_core ,CASE WHEN sum("CPU_Cores"*"CPU_Speed") > 0 THEN sum("CPU_Used_AVG")/sum("CPU_Cores"*"CPU_Speed")*100 ELSE NULL END as cpu_usage_perc FROM vmreports.host h LEFT OUTER JOIN ( @@ -151,36 +155,38 @@ select h.cluster_v2 n.commercial_name h.models - coalesce(h.hosts_total,0) as hosts_total - coalesce(h.hosts_ha,0) as hosts_ha - coalesce(h.hosts_in_maintenance,0) as hosts_in_maintenance - coalesce(h.hosts_in_service,0) as hosts_in_service - coalesce(h.cores,0) as cores - coalesce(h.cores_in_service,0) as cores_in_service - coalesce(h.ghz_in_service,0) as ghz_in_service - coalesce(h.host_ghz_usage,0) as host_ghz_usage - coalesce(u.vm_ghz_usage,0) as vm_ghz_usage - coalesce(h.ghz,0) as ghz - coalesce(h.ram_in_service,0) as ram_in_service - coalesce(h.cpu_usage_perc,0) as cpu_usage_perc + coalesce(h.hosts_total,0) as hosts_total + coalesce(h.hosts_ha,0) as hosts_ha + coalesce(h.hosts_in_maintenance,0) as hosts_in_maintenance + coalesce(h.hosts_in_service,0) as hosts_in_service + coalesce(h.cores,0) as cores + coalesce(h.cores_in_service,0) as cores_in_service + coalesce(h.ghz_in_service,0) as ghz_in_service + coalesce(h.host_ghz_usage,0) as host_ghz_usage + coalesce(u.vm_ghz_usage,0) as vm_ghz_usage + coalesce(h.ghz,0) as ghz + coalesce(h.ram_in_service,0) as ram_in_service + coalesce(h.cpu_usage_perc,0) as cpu_usage_perc - coalesce(h.cores,0) as cores_total + coalesce(h.cores,0) as cores_total - coalesce(h.ghz_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.ghz_subtract_ha END,0) as GHz_Provisioned - coalesce(h.gb_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.gb_subtract_ha END,0) as GB_Provisioned - coalesce(u.vm_ghz_reserved,0) as vm_ghz_reserved - coalesce(u.vm_ghz_promised,0) as vm_ghz_promised - coalesce(round((u.vm_ghz_promised/h.ghz_provisioned)::numeric,2)*100,0) as GHz_provision_rate - coalesce(u.vm_ram_alloc,0) as vm_ram_alloc - coalesce(u.vm_ram_alloc_on,0) as vm_ram_alloc_on - coalesce(u.vm_ram_used,0) as vm_ram_used - coalesce(round((u.vm_ram_alloc/h.gb_provisioned)::numeric,2)*100,0) as GB_alloc_perc - coalesce(round((u.vm_ram_used/h.gb_provisioned)::numeric,2)*100,0) as GB_usage_perc - coalesce(round((u.vm_cores/h.cores)::numeric,1),0) as oversubscription - coalesce(u.vm_cores,0) as vm_cores - coalesce(u.vms,0) as vms - coalesce(u.vms_on,0) as vms_on - coalesce(u.vm_ghz_usage/h.ghz_in_service*100,0) as vm_cpu_usage_perc + coalesce(h.ghz_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.ghz_subtract_ha END,0) as GHz_Provisioned + coalesce(h.gb_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.gb_subtract_ha END,0) as GB_Provisioned + coalesce(u.vm_ghz_reserved,0) as vm_ghz_reserved + coalesce(u.vm_ghz_promised,0) as vm_ghz_promised + coalesce(round((u.vm_ghz_promised/h.ghz_provisioned)::numeric,2)*100,0) as GHz_provision_rate + coalesce(u.vm_ram_alloc,0) as vm_ram_alloc + coalesce(u.vm_ram_alloc_on,0) as vm_ram_alloc_on + coalesce(u.vm_ram_used,0) as vm_ram_used + coalesce(round((u.vm_ram_alloc/h.gb_provisioned)::numeric,2)*100,0) as GB_alloc_perc + coalesce(round((u.vm_ram_used/h.gb_provisioned)::numeric,2)*100,0) as GB_usage_perc + coalesce(round((u.vm_cores/h.cores)::numeric,1),0) as oversubscription + coalesce(u.vm_cores,0) as vm_cores + coalesce(u.vm_cores_on,0) as vm_cores_on + coalesce(u.vms,0) as vms + coalesce(u.vms_on,0) as vms_on + coalesce(u.vm_ghz_usage/h.ghz_in_service*100,0) as vm_cpu_usage_perc + gb_per_core from cluster_stat h left outer join usage u on (h.cluster=u.cluster) @@ -446,6 +452,12 @@ from qRead

Техническая утилизация

+ @@ -457,6 +469,7 @@ from qRead + @@ -469,14 +482,15 @@ from qRead + - - + + @@ -493,6 +507,7 @@ from qRead + @@ -503,15 +518,17 @@ from qRead - + + - - - + + + +
RAM allloc вкл. ВМ %RAM allloc %RAM allloc ВКЛ % #hosts_total# #numberFormat(ghz,".0")##numberFormat(gb_per_core,".0")# #numberFormat(vms,"0")# #numberFormat(vms_on,"0")##numberFormat(ghz_provisioned,".0")# #numberFormat(vm_ghz_reserved,".0")# #numberFormat(vm_ghz_usage,".0")##vm_cores##vm_cores##vm_cores_on# #numberFormat(gb_provisioned,"0")# #numberFormat(vm_ram_alloc,"0")# #numberFormat(vm_ram_alloc_on,"0")# #numberFormat(vm_ram_used,"0")##numberFormat(vm_ram_alloc/ram_in_service*100,"0")##numberFormat(vm_ram_alloc_on/ram_in_service*100,"0")##numberFormat(vm_ram_used/ram_in_service*100,"0")##numberFormat(GB_alloc_perc,"0")##numberFormat(vm_ram_alloc_on/gb_provisioned*100,"0")##numberFormat(vm_ram_used/gb_provisioned*100,"0")#