52 utilization and bugfixes

This commit is contained in:
2026-06-29 16:11:34 +03:00
parent 1f7ea5c3b1
commit 776abc1cc3
4 changed files with 142 additions and 43 deletions
+2 -2
View File
@@ -75,8 +75,8 @@
<!--- global settings ---> <!--- global settings --->
<cfset request.RECORDS_PER_PAGE=500/> <cfset request.RECORDS_PER_PAGE=500/>s
<cfset request.APP_VERSION="0.00.051"/> <cfset request.APP_VERSION="0.00.052"/>
<cfset request.STAND=getStand()/> <cfset request.STAND=getStand()/>
<cflock scope="application" type="readonly" timeout=3> <cflock scope="application" type="readonly" timeout=3>
+114 -34
View File
@@ -89,9 +89,11 @@ select "Cluster" as cluster
,sum("VM_vCPU_count"*"VDC_CPU_Speed"*"VM_CPU_Reserv_perc"/100) as vm_ghz_reserved_c ,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 ,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
-- promised - зарезервированные ГГц, если включить минимальное согласованное резервирование -- promised - зарезервированные ГГц, если включить минимальное согласованное резервирование
,sum("VM_RAM_Allocated"*"VM_is_ON") as vm_ram_alloc_on
,sum("VM_RAM_Allocated") as vm_ram_alloc ,sum("VM_RAM_Allocated") as vm_ram_alloc
,sum("VM_RAM_Used") as vm_ram_used ,sum("VM_RAM_Used") as vm_ram_used
,sum("VM_CPU_Used_AVG") as vm_ghz_usage ,sum("VM_CPU_Used_AVG") as vm_ghz_usage
,sum("VM_is_ON") as vms_on
from vmreports.compute from vmreports.compute
where ts=(select max(ts) from vmreports.compute) where ts=(select max(ts) from vmreports.compute)
group by "Cluster"), group by "Cluster"),
@@ -110,9 +112,11 @@ SELECT
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Cores"*"CPU_Speed" ELSE 0 END) as ghz_in_service ,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Cores"*"CPU_Speed" ELSE 0 END) as ghz_in_service
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPUtoVM" ELSE 0 END) as ghz_provisioned ,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPUtoVM" ELSE 0 END) as ghz_provisioned
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "RAMtoVM" ELSE 0 END) as gb_provisioned ,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "RAMtoVM" ELSE 0 END) as gb_provisioned
,sum("CPU_Used_AVG") as host_ghz_usage --,sum("CPU_Used_AVG") as host_ghz_usage
,(sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "RAM_Total" ELSE 0 END)) as ram_in_service --,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Used_AVG" ELSE 0 END) as host_ghz_usage
,(avg(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Speed" ELSE 0 END)) as ghz ,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Used" ELSE 0 END) as host_ghz_usage
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "RAM_Total" ELSE 0 END) as ram_in_service
,avg(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Speed" ELSE 0 END) as ghz
,max("CPUtoVM") as ghz_subtract_ha ,max("CPUtoVM") as ghz_subtract_ha
,max("RAMtoVM") as gb_subtract_ha ,max("RAMtoVM") as gb_subtract_ha
,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 ,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
@@ -154,27 +158,29 @@ select
<d:field title="Cores Total">coalesce(h.cores,0) as cores</d:field> <d:field title="Cores Total">coalesce(h.cores,0) as cores</d:field>
<d:field title="Cores in service">coalesce(h.cores_in_service,0) as cores_in_service</d:field> <d:field title="Cores in service">coalesce(h.cores_in_service,0) as cores_in_service</d:field>
<d:field title="GHz in service">coalesce(h.ghz_in_service,0) as ghz_in_service</d:field> <d:field title="GHz in service">coalesce(h.ghz_in_service,0) as ghz_in_service</d:field>
<d:field title="Host GHz usage">coalesce(h.host_ghz_usage,0) as host_ghz_usage</d:field> <d:field title="Host GHz used">coalesce(h.host_ghz_usage,0) as host_ghz_usage</d:field>
<d:field title="VM GHz usage">coalesce(u.vm_ghz_usage,0) as vm_ghz_usage</d:field> <d:field title="Payload GHz used">coalesce(u.vm_ghz_usage,0) as vm_ghz_usage</d:field>
<d:field title="CPU GHz">coalesce(h.ghz,0) as ghz</d:field> <d:field title="CPU GHz">coalesce(h.ghz,0) as ghz</d:field>
<d:field title="RAM GB in service">coalesce(h.ram_in_service,0) as ram_in_service</d:field> <d:field title="RAM GB in service">coalesce(h.ram_in_service,0) as ram_in_service</d:field>
<d:field title="Host CPU usage %">coalesce(h.cpu_usage_perc,0) as cpu_usage_perc</d:field> <d:field title="Host CPU usage %">coalesce(h.cpu_usage_perc,0) as cpu_usage_perc</d:field>
<!--- <d:field title="Hosts in use">h.hosts</d:field> ---> <!--- <d:field title="Hosts in use">h.hosts</d:field> --->
<d:field title="Cores Capacity">coalesce(h.cores,0) as Cores_Capacity</d:field> <d:field title="Cores Total">coalesce(h.cores,0) as cores_total</d:field>
<!--- <d:field title="GHz Capacity">c.ghz as GHz_Capacity</d:field> ---> <!--- <d:field title="GHz Capacity">c.ghz as GHz_Capacity</d:field> --->
<d:field title="GHz Provisioned">coalesce(h.ghz_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.ghz_subtract_ha END,0) as GHz_Provisioned</d:field><!--- за вычетом согласованных резервов на хосте и на HA ---> <d:field title="GHz Provisioned">coalesce(h.ghz_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.ghz_subtract_ha END,0) as GHz_Provisioned</d:field><!--- за вычетом согласованных резервов на хосте и на HA --->
<d:field title="GB Provisioned">coalesce(h.gb_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.gb_subtract_ha END,0) as GB_Provisioned</d:field><!--- за вычетом согласованных резервов на хосте и на HA ---> <d:field title="GB Provisioned">coalesce(h.gb_provisioned - CASE WHEN hosts_in_maintenance > 0 THEN 0 ELSE h.gb_subtract_ha END,0) as GB_Provisioned</d:field><!--- за вычетом согласованных резервов на хосте и на HA --->
<d:field title="VM GHz reserved">coalesce(u.vm_ghz_reserved,0) as vm_ghz_reserved</d:field> <d:field title="Payload GHz reserved">coalesce(u.vm_ghz_reserved,0) as vm_ghz_reserved</d:field>
<d:field title="VM GHz обещанные">coalesce(u.vm_ghz_promised,0) as vm_ghz_promised</d:field> <d:field title="GHz обещанные">coalesce(u.vm_ghz_promised,0) as vm_ghz_promised</d:field>
<d:field title="CPU GHz provision rate %">coalesce(round((u.vm_ghz_promised/h.ghz_provisioned)::numeric,2)*100,0) as GHz_provision_rate</d:field> <d:field title="CPU GHz provision rate %">coalesce(round((u.vm_ghz_promised/h.ghz_provisioned)::numeric,2)*100,0) as GHz_provision_rate</d:field>
<d:field title="VM RAM GB alloc">coalesce(u.vm_ram_alloc,0) as vm_ram_alloc</d:field> <d:field title="Payload RAM GB alloc">coalesce(u.vm_ram_alloc,0) as vm_ram_alloc</d:field>
<d:field title="VM RAM GB used">coalesce(u.vm_ram_used,0) as vm_ram_used</d:field> <d:field title="Payload RAM GB alloc ВКЛ">coalesce(u.vm_ram_alloc_on,0) as vm_ram_alloc_on</d:field>
<d:field title="Payload RAM GB used">coalesce(u.vm_ram_used,0) as vm_ram_used</d:field>
<d:field title="RAM alloc %">coalesce(round((u.vm_ram_alloc/h.gb_provisioned)::numeric,2)*100,0) as GB_alloc_perc</d:field> <d:field title="RAM alloc %">coalesce(round((u.vm_ram_alloc/h.gb_provisioned)::numeric,2)*100,0) as GB_alloc_perc</d:field>
<d:field title="RAM usage %">coalesce(round((u.vm_ram_used/h.gb_provisioned)::numeric,2)*100,0) as GB_usage_perc</d:field> <d:field title="RAM usage %">coalesce(round((u.vm_ram_used/h.gb_provisioned)::numeric,2)*100,0) as GB_usage_perc</d:field>
<d:field title="Пере подписка vCPU">coalesce(round((u.vm_cores/h.cores)::numeric,1),0) as oversubscription</d:field> <d:field title="Пере подписка vCPU">coalesce(round((u.vm_cores/h.cores)::numeric,1),0) as oversubscription</d:field>
<d:field title="VM cores">coalesce(u.vm_cores,0) as vm_cores</d:field> <d:field title="Payload cores">coalesce(u.vm_cores,0) as vm_cores</d:field>
<d:field title="VM">coalesce(u.vms,0) as vms</d:field> <d:field title="VMs">coalesce(u.vms,0) as vms</d:field>
<d:field title="VM CPU Usage %">coalesce(u.vm_ghz_usage/h.ghz_in_service*100,0) as vm_cpu_usage_perc</d:field> <d:field title="VMs ON">coalesce(u.vms_on,0) as vms_on</d:field>
<d:field title="Payload CPU Usage %">coalesce(u.vm_ghz_usage/h.ghz_in_service*100,0) as vm_cpu_usage_perc</d:field>
</d:field_set> </d:field_set>
from cluster_stat h from cluster_stat h
left outer join usage u on (h.cluster=u.cluster) left outer join usage u on (h.cluster=u.cluster)
@@ -189,6 +195,7 @@ select
,sum(hosts_ha) as hosts_ha ,sum(hosts_ha) as hosts_ha
,sum(hosts_in_maintenance) as hosts_in_maintenance ,sum(hosts_in_maintenance) as hosts_in_maintenance
,sum(host_ghz_usage) as host_ghz_usage ,sum(host_ghz_usage) as host_ghz_usage
,sum(cores_total) as cores_total
,sum(cores_in_service) as cores_in_service ,sum(cores_in_service) as cores_in_service
,sum(ghz_in_service) as ghz_in_service ,sum(ghz_in_service) as ghz_in_service
,sum(ghz_provisioned) as ghz_provisioned ,sum(ghz_provisioned) as ghz_provisioned
@@ -202,7 +209,7 @@ select
,sum(vm_ram_alloc) as vm_ram_alloc ,sum(vm_ram_alloc) as vm_ram_alloc
,sum(vm_ram_used) as vm_ram_used ,sum(vm_ram_used) as vm_ram_used
,sum(vms) as vms ,sum(vms) as vms
,sum(cores*ghz)/sum(cores) as ghz ,sum(cores*ghz)/sum(cores) as ghz <!--- рискованно все же делить --->
from qRead from qRead
</cfquery> </cfquery>
@@ -232,28 +239,25 @@ from qRead
<table class="worktable"> <table class="worktable">
<thead> <thead>
<tr>
<layout:grid_head titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray#> <layout:grid_head titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray#>
<th width="5%"><layout:column_head name="cluster_v1"/></th> <th width="5%" rowspan="2"><layout:column_head name="cluster_v1"/></th>
<th width="5%"><layout:column_head name="cluster_v2"/></th> <th width="5%" rowspan="2"><layout:column_head name="cluster_v2"/></th>
<th width="10%"><layout:column_head name="commercial_name"/></th> <th width="10%" rowspan="2"><layout:column_head name="commercial_name"/></th>
<!--- <th width="3%"><layout:column_head name="ghz"/></th> ---> <th width="3%" rowspan="2"><layout:column_head name="hosts_total"/></th>
<th width="3%"><layout:column_head name="hosts_total"/></th> <th colspan="6">Свободно</th>
<th width="5%">RAM GB by alloc</th> <th width="3%" rowspan="2">ВМ размещено</th>
</layout:grid_head>
</tr>
<tr><th width="5%">RAM GB by alloc</th>
<th width="5%">RAM GB by usage</th> <th width="5%">RAM GB by usage</th>
<th width="5%">CPU GHz (текущий резерв)</th> <th width="5%">CPU GHz (текущий резерв)</th>
<th width="5%">Ядра 20% (текущий резерв)</th> <th width="5%">Ядра 20% (текущий резерв)</th>
<th width="5%">Ядра 50% (текущий резерв)</th> <th width="5%">Ядра 50% (текущий резерв)</th>
<th width="5%">Ядра 80% (текущий резерв)</th> <th width="5%">Ядра 80% (текущий резерв)</th>
</tr>
<!--- <th width="5%">CPU GHz (жесткий резерв)</th>
<th width="5%">Ядра 20% (жесткий резерв)</th>
<th width="5%">Ядра 50% (жесткий резерв)</th>
<th width="5%">Ядра 80% (жесткий резерв)</th> --->
<th width="3%">ВМ размещено</th>
</layout:grid_head>
</thead> </thead>
<cfoutput query="qRead"> <cfoutput query="qRead">
@@ -285,7 +289,7 @@ from qRead
</table> </table>
<!--- <i>Жесткий резерв - если включим минимальное резервирование 20%</i><br/> <!--- <i>Жесткий резерв - если включим минимальное резервирование 20%</i><br/>
<i>Доступная память указана по выделенному объему (используется меньше, доступно больше)</i><br/> ---> <i>Доступная память указана по выделенному объему (используется меньше, доступно больше)</i><br/> --->
<i>Емкость HA вычитается из Capacity, если нет хостов в Maintenance, в противном случае вычитается ресурс хостов в Maintenance. За объем для HA принимается размер наибольшего хоста в кластере по каждому ресурсу (поэтому при выводе в Maintenance маленького хоста расчетная емкость может временно увеличиться, но это только если хосты в кластере разные)</i> <i>Емкость HA вычитается из Capacity, если нет хостов в Maintenance, в противном случае вычитается ресурс хостов в Maintenance. За объем для HA принимается размер наибольшего хоста в кластере по каждому ресурсу (поэтому при выводе в Maintenance маленького хоста расчетная емкость может временно увеличиться, но это только если хосты в кластере разные. Понятнее будет, если мы как резерв будем брать максимальное значение из наибольшего хоста и суммы выведенных в Maintenance хостов)</i>
<h3>Использование подробно</h3> <h3>Использование подробно</h3>
@@ -316,7 +320,7 @@ from qRead
<th width="3%"><layout:column_head name="cpu_usage_perc"/></th> <th width="3%"><layout:column_head name="cpu_usage_perc"/></th>
<th width="3%"><layout:column_head name="vm_cpu_usage_perc"/></th> <th width="3%"><layout:column_head name="vm_cpu_usage_perc"/></th>
<th width="3%"><layout:column_head name="oversubscription"/></th> <th width="3%"><layout:column_head name="oversubscription"/></th>
<th width="3%"><layout:column_head name="Cores_Capacity"/></th> <th width="3%"><layout:column_head name="cores_total"/></th>
<th width="3%"><layout:column_head name="ghz_provisioned"/></th> <th width="3%"><layout:column_head name="ghz_provisioned"/></th>
<th width="3%"><layout:column_head name="vm_ghz_reserved"/></th> <th width="3%"><layout:column_head name="vm_ghz_reserved"/></th>
<th width="3%"><layout:column_head name="vm_ghz_promised"/></th> <th width="3%"><layout:column_head name="vm_ghz_promised"/></th>
@@ -351,7 +355,7 @@ from qRead
<td class="c" style="font-size:130%;">#numberFormat(cpu_usage_perc,"0")#</td> <td class="c" style="font-size:130%;">#numberFormat(cpu_usage_perc,"0")#</td>
<td class="c" style="font-size:130%;">#numberFormat(vm_cpu_usage_perc,"0")#</td> <td class="c" style="font-size:130%;">#numberFormat(vm_cpu_usage_perc,"0")#</td>
<td class="r">#oversubscription#</td> <td class="r">#oversubscription#</td>
<td class="r">#Cores_Capacity#</td> <td class="r">#cores_total#</td>
<td class="r">#numberFormat(ghz_provisioned,".0")#</td> <td class="r">#numberFormat(ghz_provisioned,".0")#</td>
<td class="r">#numberFormat(vm_ghz_reserved,".0")#</td> <td class="r">#numberFormat(vm_ghz_reserved,".0")#</td>
<td class="r">#numberFormat(vm_ghz_promised,".0")#</td> <td class="r">#numberFormat(vm_ghz_promised,".0")#</td>
@@ -379,10 +383,12 @@ from qRead
<td class="r">#numberFormat(ghz_in_service,".0")#</td> ---> <td class="r">#numberFormat(ghz_in_service,".0")#</td> --->
<td class="r">#numberFormat(host_ghz_usage,".0")#</td> <td class="r">#numberFormat(host_ghz_usage,".0")#</td>
<td class="r">#numberFormat(vm_ghz_usage,".0")#</td> <td class="r">#numberFormat(vm_ghz_usage,".0")#</td>
<td class="r"></td> <td class="c" style="font-size:130%;">
<td class="r"><!--- #cpu_usage_perc# ---></td> <!--- <cftry>#numberFormat(vm_ghz_usage*100/ghz_in_service,"0")#<cfcatch type="any"></cfcatch></cftry> --->
</td>
<td class="r"><cftry>#numberFormat(vm_ghz_usage*100/ghz_in_service,"0")#<cfcatch type="any"></cfcatch></cftry></td>
<td class="r" style="font-size:130%;"><cfif cores_in_service NEQ 0>#numberFormat(vm_cores/cores_in_service,".0")#</cfif></td> <td class="r" style="font-size:130%;"><cfif cores_in_service NEQ 0>#numberFormat(vm_cores/cores_in_service,".0")#</cfif></td>
<td class="r"></td> <td class="r">#numberFormat(cores_total,"0")#</td>
<td class="r">#numberFormat(ghz_provisioned,".0")#</td> <td class="r">#numberFormat(ghz_provisioned,".0")#</td>
<td class="r">#numberFormat(vm_ghz_reserved,".0")#</td> <td class="r">#numberFormat(vm_ghz_reserved,".0")#</td>
<td class="r">#numberFormat(vm_ghz_promised,".0")#</td> <td class="r">#numberFormat(vm_ghz_promised,".0")#</td>
@@ -438,5 +444,79 @@ from qRead
</cfchartseries> </cfchartseries>
</cfchart> ---> </cfchart> --->
<h3>Техническая утилизация</h3>
<table class="worktable">
<thead>
<layout:grid_head titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray#>
<th width="5%"><layout:column_head name="cluster_v1"/></th>
<th width="5%"><layout:column_head name="cluster_v2"/></th>
<th width="10%"><layout:column_head name="commercial_name"/></th>
<th width="3%"><layout:column_head name="hosts_total"/></th>
<th width="3%"><layout:column_head name="ghz"/></th>
<th width="3%"><layout:column_head name="vms"/></th>
<th width="3%"><layout:column_head name="vms_on"/></th>
<th width="3%"><layout:column_head name="cpu_usage_perc"/></th>
<th width="3%"><layout:column_head name="vm_cpu_usage_perc"/></th>
<th width="3%"><layout:column_head name="oversubscription"/></th>
<th width="3%"><layout:column_head name="cores_total"/></th>
<th width="3%"><layout:column_head name="ghz_provisioned"/></th>
<th width="3%"><layout:column_head name="vm_ghz_reserved"/></th>
<th width="3%"><layout:column_head name="vm_ghz_usage"/></th>
<th width="3%"><layout:column_head name="vm_cores"/></th>
<th width="3%"><layout:column_head name="gb_provisioned"/></th>
<th width="3%"><layout:column_head name="vm_ram_alloc"/></th>
<th width="3%"><layout:column_head name="vm_ram_alloc_on"/></th>
<th width="3%"><layout:column_head name="vm_ram_used"/></th>
<th width="3%"><layout:column_head name="GB_alloc_perc"/></th>
<th width="3%">RAM allloc вкл. ВМ %</th>
<th width="3%"><layout:column_head name="GB_usage_perc"/></th>
</layout:grid_head>
</thead>
<cfoutput query="qRead">
<tr>
<td>#cluster_v1#</td>
<td>#cluster_v2#</td>
<td style="font-size:130%">#commercial_name#</td>
<td class="r">#hosts_total#</td>
<td class="r" style="font-size:120%">#numberFormat(ghz,".0")#</td>
<td class="r" style="font-size:120%">#numberFormat(vms,"0")#</td>
<td class="r" style="font-size:120%">#numberFormat(vms_on,"0")#</td>
<td class="c" style="font-size:130%;">#numberFormat(cpu_usage_perc,"0")#</td>
<td class="c" style="font-size:130%;">#numberFormat(vm_cpu_usage_perc,"0")#</td>
<td class="r">#oversubscription#</td>
<td class="r">#cores_total#</td>
<td class="r">#numberFormat(ghz_provisioned,".0")#</td>
<td class="r">#numberFormat(vm_ghz_reserved,".0")#</td>
<td class="r">#numberFormat(vm_ghz_usage,".0")#</td>
<td class="r">#vm_cores#</td>
<td class="r">#numberFormat(gb_provisioned,"0")#</td>
<td class="r">#numberFormat(vm_ram_alloc,"0")#</td>
<td class="r">#numberFormat(vm_ram_alloc_on,"0")#</td>
<td class="r">#numberFormat(vm_ram_used,"0")#</td>
<td class="c" style="font-size:130%;"><cfif ram_in_service NEQ 0>#numberFormat(vm_ram_alloc/ram_in_service*100,"0")#</cfif></td>
<td class="c" style="font-size:130%;"><cfif ram_in_service NEQ 0>#numberFormat(vm_ram_alloc_on/ram_in_service*100,"0")#</cfif></td>
<td class="c" style="font-size:130%;"><cfif ram_in_service NEQ 0>#numberFormat(vm_ram_used/ram_in_service*100,"0")#</cfif></td>
</tr>
</cfoutput>
</table>
<cfdump var=#this.datasources[request.ds].connectionString#/>
<layout:page section="footer"/> <layout:page section="footer"/>
+4 -4
View File
@@ -111,10 +111,10 @@ AS (
,round(sum(CASE WHEN "VM_is_ON" > 0 THEN c."VM_RAM_Allocated" ELSE 0 END)) AS ram_on ,round(sum(CASE WHEN "VM_is_ON" > 0 THEN c."VM_RAM_Allocated" ELSE 0 END)) AS ram_on
,round(sum(c."VM_vCPU_count")) AS cpu ,round(sum(c."VM_vCPU_count")) AS cpu
,round(sum(CASE WHEN "VM_is_ON" > 0 THEN c."VM_vCPU_count" ELSE 0 END)) AS cpu_on ,round(sum(CASE WHEN "VM_is_ON" > 0 THEN c."VM_vCPU_count" ELSE 0 END)) AS cpu_on
FROM vmreports.COMPUTE c FROM vmreports.compute c
WHERE ts = ( WHERE ts = (
SELECT max(ts) SELECT max(ts)
FROM vmreports.COMPUTE FROM vmreports.compute
) )
GROUP BY c."WZ" GROUP BY c."WZ"
) )
@@ -124,7 +124,7 @@ AS (
FROM vmreports.storage c FROM vmreports.storage c
WHERE ts = ( WHERE ts = (
SELECT max(ts) SELECT max(ts)
FROM vmreports.COMPUTE FROM vmreports.storage
) )
GROUP BY c."WZ" GROUP BY c."WZ"
) )
@@ -399,7 +399,7 @@ S3 операции и трафик: <b>#dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M
<td>#line_pricing_model_ids#</td> <td>#line_pricing_model_ids#</td>
<td>#cpu_codes#</td> <td>#cpu_codes#</td>
<td class="r"<cfif cpu_sold GT ram_alloc> style="background:lightgreen;"</cfif>>#cpu_sold#</td> <td class="r"<cfif cpu_sold GT cpu_alloc> style="background:lightgreen;"</cfif>>#cpu_sold#</td>
<td class="r"<cfif cpu_sold LT cpu_alloc> style="background:lightcoral;"</cfif>>#cpu_alloc#</td> <td class="r"<cfif cpu_sold LT cpu_alloc> style="background:lightcoral;"</cfif>>#cpu_alloc#</td>
<td class="r"<cfif cpu_sold LT cpu_alloc_on> style="background:lightcoral;"</cfif>>#cpu_alloc_on#</td> <td class="r"<cfif cpu_sold LT cpu_alloc_on> style="background:lightcoral;"</cfif>>#cpu_alloc_on#</td>
+19
View File
@@ -0,0 +1,19 @@
Все верно, это сам отчет по вм, чтобы он работал нужно еще передать ему resourceId= objUUID
его можно взять из отчета https://vao.mgmt.nubes.ru/suite-api/internal/views/d5bce32a-65c0-490b-87e2-835211697e59/data/export?resourceId=6f1e652e-cbb5-4940-bb07-e30805b9c992 поле objUUID
С уважением,
Крипитула Антон
Старший инженер
Моб. +7 (985) 418-55-64
akripitula@nubes.ru
@KripitulaAnton
nubes.ru
9 июня 2026 г., в 18:13, Мищук Сергей <smishchuk@nubes.ru> написал(а):
вроде нашел этот https://vao.mgmt.nubes.ru/suite-api/internal/views/89a1dded-e7d5-45ff-bd19-020991951d9a/data/export?resourceId=