523 lines
27 KiB
Plaintext
523 lines
27 KiB
Plaintext
<cfsilent>
|
|
<cfimport prefix="m" taglib="lib"/>
|
|
<cfimport prefix="c" taglib="lib/controls"/>
|
|
<cfimport prefix="d" taglib="lib/data"/>
|
|
<cfimport prefix="layout" taglib="layout"/>
|
|
</cfsilent>
|
|
|
|
<!--- этого можно было не делать, ошибка возникала при вычитании нулла в cfm --->
|
|
<cffunction name="safeCompareNum" returntype="boolean">
|
|
<cfargument name="n1" type="any"/>
|
|
<cfargument name="operator" type="string"/>
|
|
<cfargument name="n2" type="any" default=0/>
|
|
|
|
<cfif NOT isNumeric(arguments.n1) OR NOT isNumeric(arguments.n2)>
|
|
<cfreturn false/>
|
|
</cfif>
|
|
|
|
<cfswitch expression=#arguments.operator#>
|
|
<cfcase value="GT">
|
|
<cfreturn (n1 GT n2)/>
|
|
</cfcase>
|
|
<cfcase value="LT">
|
|
<cfreturn (n1 LT n2)/>
|
|
</cfcase>
|
|
<cfcase value="EQ,IS">
|
|
<cfreturn (n1 EQ n2)/>
|
|
</cfcase>
|
|
<cfcase value="NEQ">
|
|
<cfreturn (n1 NEQ n2)/>
|
|
</cfcase>
|
|
<cfcase value="GE,GTE">
|
|
<cfreturn (n1 GE n2)/>
|
|
</cfcase>
|
|
<cfcase value="LE,LTE">
|
|
<cfreturn (n1 LE n2)/>
|
|
</cfcase>
|
|
<cfdefaultcase>
|
|
<cfreturn false/>
|
|
</cfdefaultcase>
|
|
</cfswitch>
|
|
</cffunction>
|
|
|
|
<cffunction name="safeNumberFormat" returntype="string">
|
|
<cfargument name="num" type="any"/>
|
|
<cfargument name="format" type="string"/>
|
|
|
|
<cfif NOT isNumeric(arguments.num)>
|
|
<cfreturn ""/>
|
|
</cfif>
|
|
<cftry>
|
|
<cfreturn numberFormat(arguments.num, arguments.format)/>
|
|
<cfcatch type="any">
|
|
<cfreturn ""/>
|
|
</cfcatch>
|
|
</cftry>
|
|
</cffunction>
|
|
|
|
<m:prepare_ls entity="crm2cloud" settingsKey="crm2cloud" accessObject="" pageInfoOut="pageInfo" trackOut="tr"/>
|
|
|
|
<cfquery name="qTS">
|
|
select
|
|
(select max(ts) from vmreports.compute) as ts_compute
|
|
,(select max(ts) from vmreports.host) as ts_host
|
|
</cfquery>
|
|
|
|
<!--- по результатам разбора ошибок.
|
|
1. Обрамлять минус пробелами (а то читал gb_provisioned-vm_ram_alloc как одно имя переменной
|
|
2. Всю арифметику делать в запросе - SQL работает с нуллами гораздо лучше CFML, в котором они превращаются в пустые строки, провоцируя ошибки --->
|
|
<cfquery name="qRead">
|
|
with
|
|
<!--- capacity as (
|
|
select "Cluster" as cluster, count(*) as hosts, sum(cores) as cores, round(sum(ghz)::numeric,1) as ghz, round(sum(ram)) as ram
|
|
from (
|
|
select "Cluster", "Host"
|
|
, avg("Host_CPU_Cores") as cores, avg("Host_CPU_Cores"*"Host_CPU_Speed") as ghz, avg("Host_RAM"*.85) as ram
|
|
from vmreports.compute
|
|
where ts=(select max(ts) from vmreports.compute)
|
|
group by "Cluster","Host"
|
|
order by "Cluster","Host"
|
|
) host
|
|
group by "Cluster"), --->
|
|
|
|
usage as (
|
|
select "Cluster" as cluster
|
|
,count("UUID_VM") as vms
|
|
,sum("VM_vCPU_count") as vm_cores
|
|
,sum("VM_vCPU_count"*"VDC_CPU_Speed") as vm_ghz
|
|
,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
|
|
-- promised - зарезервированные ГГц, если включить минимальное согласованное резервирование
|
|
,sum("VM_RAM_Allocated"*"VM_is_ON") as vm_ram_alloc_on
|
|
,sum("VM_RAM_Allocated") as vm_ram_alloc
|
|
,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"),
|
|
|
|
cluster_stat as (
|
|
SELECT
|
|
h."Cluster" as cluster
|
|
,h."Cluster_v2" as cluster_v2
|
|
,m.models
|
|
,COUNT(*) as hosts_total
|
|
,COUNT(*)-1 as hosts_ha /*не вполне корректно, хосты разного размера, отказ по-разному влияет*/
|
|
,sum(CASE WHEN "Maintenance"='inMaintenance' THEN 1 ELSE 0 END) as hosts_in_maintenance
|
|
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN 1 ELSE 0 END) as hosts_in_service
|
|
,sum("CPU_Cores") as cores
|
|
,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Cores" ELSE 0 END) as cores_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 "RAMtoVM" ELSE 0 END) as gb_provisioned
|
|
--,sum("CPU_Used_AVG") as host_ghz_usage
|
|
--,sum(CASE WHEN "Maintenance"='notInMaintenance' THEN "CPU_Used_AVG" ELSE 0 END) as host_ghz_usage
|
|
,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("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
|
|
FROM vmreports.host h
|
|
LEFT OUTER JOIN (
|
|
SELECT hi."Cluster", STRING_AGG(DISTINCT hi."Model" || ' [' || (hi.cnt::text) || '] ',', ') as models
|
|
FROM (
|
|
SELECT hii."Cluster", hii."Model", count(hii."Model") as cnt
|
|
FROM vmreports.host hii
|
|
WHERE hii.ts=(SELECT max(ts) FROM vmreports.host)
|
|
GROUP BY hii."Cluster", hii."Model"
|
|
) hi GROUP BY hi."Cluster"
|
|
) m ON (h."Cluster"=m."Cluster")
|
|
WHERE ts=(SELECT max(ts) FROM vmreports.host)
|
|
GROUP BY h."Cluster", h."Cluster_v2", m.models
|
|
ORDER BY h."Cluster"
|
|
),
|
|
|
|
cluster_naming (cluster,commercial_name) AS (VALUES
|
|
('cl01-vsan','msk1, Intel Cascade Lake 2,9 ГГц')
|
|
,('cl02','msk1, Intel Cascade Lake 3,1 ГГц')
|
|
,('cl04-vsan','msk1, AMD Milan 2,8 ГГц')
|
|
,('cl05-1c','msk1, AMD Raphael 4,5 ГГц')
|
|
,('cl06-vsan','msk1, Intel Ice Lake 2,8 ГГц')
|
|
,('cl07-vsan','msk1, AMD Genoa 4,0 ГГц')
|
|
)
|
|
|
|
|
|
select
|
|
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
|
<d:field title="cluster v1">h.cluster as cluster_v1</d:field>
|
|
<d:field title="cluster v2">h.cluster_v2</d:field>
|
|
<d:field title="Коммерческое название">n.commercial_name</d:field>
|
|
<d:field title="Models">h.models</d:field>
|
|
<d:field title="Hosts total">coalesce(h.hosts_total,0) as hosts_total</d:field>
|
|
<d:field title="Hosts HA">coalesce(h.hosts_ha,0) as hosts_ha</d:field>
|
|
<d:field title="Hosts in mainte nance">coalesce(h.hosts_in_maintenance,0) as hosts_in_maintenance</d:field>
|
|
<d:field title="Hosts in service">coalesce(h.hosts_in_service,0) as hosts_in_service</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="GHz in service">coalesce(h.ghz_in_service,0) as ghz_in_service</d:field>
|
|
<d:field title="Host GHz used">coalesce(h.host_ghz_usage,0) as host_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="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="Hosts in use">h.hosts</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 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="Payload GHz reserved">coalesce(u.vm_ghz_reserved,0) as vm_ghz_reserved</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="Payload 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_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 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="Payload cores">coalesce(u.vm_cores,0) as vm_cores</d:field>
|
|
<d:field title="VMs">coalesce(u.vms,0) as vms</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>
|
|
from cluster_stat h
|
|
left outer join usage u on (h.cluster=u.cluster)
|
|
left outer join cluster_naming n on (h.cluster=n.cluster)
|
|
where 1=1 <!--- <m:filter_build filter=#pageInfo.settings.filter#/> --->
|
|
order by <m:order_build sortArray=#pageInfo.settings.sort.sortArray# fieldCount=#fieldCount#/>
|
|
</cfquery>
|
|
|
|
<cfquery name="qTotal" dbtype="query">
|
|
select
|
|
sum(hosts_total) as hosts_total
|
|
,sum(hosts_ha) as hosts_ha
|
|
,sum(hosts_in_maintenance) as hosts_in_maintenance
|
|
,sum(host_ghz_usage) as host_ghz_usage
|
|
,sum(cores_total) as cores_total
|
|
,sum(cores_in_service) as cores_in_service
|
|
,sum(ghz_in_service) as ghz_in_service
|
|
,sum(ghz_provisioned) as ghz_provisioned
|
|
,sum(ram_in_service) as ram_in_service
|
|
,sum(gb_provisioned) as gb_provisioned
|
|
,sum(cores_in_service) as cores_in_service
|
|
,sum(vm_cores) as vm_cores
|
|
,sum(vm_ghz_usage) as vm_ghz_usage
|
|
,sum(vm_ghz_reserved) as vm_ghz_reserved
|
|
,sum(vm_ghz_promised) as vm_ghz_promised
|
|
,sum(vm_ram_alloc) as vm_ram_alloc
|
|
,sum(vm_ram_used) as vm_ram_used
|
|
,sum(vms) as vms
|
|
,sum(cores*ghz)/sum(cores) as ghz <!--- рискованно все же делить --->
|
|
from qRead
|
|
</cfquery>
|
|
|
|
|
|
|
|
<cfif isDefined("output_xls")>
|
|
<layout:xml qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
|
<cfabort/>
|
|
</cfif><cfif isDefined("output_json")>
|
|
<layout:json qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
|
<cfabort/>
|
|
</cfif>
|
|
<layout:page section="header" pageInfo=#pageInfo#>
|
|
<layout:attribute name="title">
|
|
<cfoutput><b>Cloud Capacity</b></cfoutput>
|
|
</layout:attribute>
|
|
<layout:attribute name="controls"><!--- empty to remove controls (filter link) ---></layout:attribute>
|
|
</layout:page>
|
|
|
|
<cfoutput query="qTS">
|
|
<h3 style="display:inline-block; margin-right:2em;">Актуальность данных</h3>
|
|
<b>VM:</b> #dateFormat(ts_compute,"YYYY-MM-DD")# #timeFormat(ts_compute,"HH:MM")#
|
|
<b>Хосты:</b> #dateFormat(ts_host,"YYYY-MM-DD")# #timeFormat(ts_host,"HH:MM")#
|
|
</cfoutput>
|
|
|
|
<h3>Свободно</h3>
|
|
|
|
<table class="worktable">
|
|
<thead>
|
|
<tr>
|
|
<layout:grid_head titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray#>
|
|
<th width="5%" rowspan="2"><layout:column_head name="cluster_v1"/></th>
|
|
<th width="5%" rowspan="2"><layout:column_head name="cluster_v2"/></th>
|
|
<th width="10%" rowspan="2"><layout:column_head name="commercial_name"/></th>
|
|
<th width="3%" rowspan="2"><layout:column_head name="hosts_total"/></th>
|
|
<th colspan="6">Свободно</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%">CPU GHz (текущий резерв)</th>
|
|
<th width="5%">Ядра 20% (текущий резерв)</th>
|
|
<th width="5%">Ядра 50% (текущий резерв)</th>
|
|
<th width="5%">Ядра 80% (текущий резерв)</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<cfoutput query="qRead">
|
|
<tr>
|
|
<td>#cluster_v1#</td>
|
|
<td>#cluster_v2#</td>
|
|
<td style="font-size:130%">#commercial_name#</td>
|
|
|
|
<!--- <td class="r" style="font-size:120%">#numberFormat(ghz,".0")#</td> --->
|
|
<td class="r">#hosts_total#</td>
|
|
|
|
<td class="r<cfif safeCompareNum(gb_provisioned - vm_ram_alloc, "LE", 0)> err</cfif>" style="font-size:130%">
|
|
#safeNumberFormat(gb_provisioned-vm_ram_alloc,"0")#</td>
|
|
<td class="r<cfif safeCompareNum(gb_provisioned - vm_ram_used, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat(gb_provisioned - vm_ram_used,"0")#</td>
|
|
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_reserved, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat(ghz_provisioned-vm_ghz_reserved,".0")#</td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_reserved, "LE", 0)> err</cfif>" style="font-size:130%"><cfif ghz GT 0>#safeNumberFormat((ghz_provisioned-vm_ghz_reserved)/ghz/0.2,"0")#</cfif></td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_reserved, "LE", 0)> err</cfif>" style="font-size:130%"><cfif ghz GT 0>#safeNumberFormat((ghz_provisioned-vm_ghz_reserved)/ghz/0.5,"0")#</cfif></td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_reserved, "LE", 0)> err</cfif>" style="font-size:130%"><cfif ghz GT 0>#safeNumberFormat((ghz_provisioned-vm_ghz_reserved)/ghz/0.8,"0")#</cfif></td>
|
|
|
|
<!--- <td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_promised, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat(ghz_provisioned-vm_ghz_promised,".0")#</td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_promised, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat((ghz_provisioned-vm_ghz_promised)/ghz/0.2,"0")#</td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_promised, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat((ghz_provisioned-vm_ghz_promised)/ghz/0.5,"0")#</td>
|
|
<td class="r<cfif safeCompareNum(ghz_provisioned - vm_ghz_promised, "LE", 0)> err</cfif>" style="font-size:130%">#safeNumberFormat((ghz_provisioned-vm_ghz_promised)/ghz/0.8,"0")#</td> --->
|
|
<td class="r">#vms#</td>
|
|
|
|
</tr>
|
|
</cfoutput>
|
|
</table>
|
|
<!--- <i>Жесткий резерв - если включим минимальное резервирование 20%</i><br/>
|
|
<i>Доступная память указана по выделенному объему (используется меньше, доступно больше)</i><br/> --->
|
|
<i>Емкость HA вычитается из Capacity, если нет хостов в Maintenance, в противном случае вычитается ресурс хостов в Maintenance. За объем для HA принимается размер наибольшего хоста в кластере по каждому ресурсу (поэтому при выводе в Maintenance маленького хоста расчетная емкость может временно увеличиться, но это только если хосты в кластере разные. Понятнее будет, если мы как резерв будем брать максимальное значение из наибольшего хоста и суммы выведенных в Maintenance хостов)</i>
|
|
|
|
<h3>Использование подробно</h3>
|
|
|
|
<layout:grid_summary
|
|
recordCount=#qRead.recordCount#
|
|
footerOut="gridFooter"
|
|
excelLink="Yes"
|
|
jsonLink="Yes"
|
|
/>
|
|
|
|
<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="7%"><layout:column_head name="commercial_name"/></th>
|
|
<th width="15%"><layout:column_head name="models"/></th>
|
|
<th width="3%"><layout:column_head name="ghz"/></th>
|
|
<th width="3%"><layout:column_head name="hosts_total"/></th>
|
|
<th width="3%"><layout:column_head name="hosts_ha"/></th>
|
|
<th width="3%"><layout:column_head name="hosts_in_maintenance"/></th>
|
|
<!--- <th width="3%"><layout:column_head name="hosts_in_service"/></th>
|
|
<th width="3%"><layout:column_head name="ram_in_service"/></th>
|
|
<th width="3%"><layout:column_head name="cores_in_service"/></th>
|
|
<th width="3%"><layout:column_head name="ghz_in_service"/></th> --->
|
|
<th width="3%"><layout:column_head name="host_ghz_usage"/></th>
|
|
<th width="3%"><layout:column_head name="vm_ghz_usage"/></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_promised"/></th>
|
|
<th width="3%"><layout:column_head name="vm_cores"/></th>
|
|
<th width="3%"><layout:column_head name="GHz_provision_rate"/></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_used"/></th>
|
|
<th width="3%"><layout:column_head name="GB_alloc_perc"/></th>
|
|
<th width="3%"><layout:column_head name="GB_usage_perc"/></th>
|
|
<th width="3%">ВМ шт.</th>
|
|
<th width="10%">Средняя ВМ</th>
|
|
</layout:grid_head>
|
|
</thead>
|
|
|
|
<cfoutput query="qRead">
|
|
<tr>
|
|
<td>#cluster_v1#</td>
|
|
<td>#cluster_v2#</td>
|
|
<td>#commercial_name#</td>
|
|
<td>#models#</td>
|
|
<td class="r">#numberFormat(ghz,".0")#</td>
|
|
<td class="r">#hosts_total#</td>
|
|
<td class="r">#hosts_ha#</td>
|
|
<td class="r"><cfif hosts_in_maintenance NEQ 0>#hosts_in_maintenance#</cfif></td> <!--- style="background:lightcoral" --->
|
|
<!--- <td class="r">#hosts_in_service#</td>
|
|
<td class="r">#numberFormat(ram_in_service,"0")#</td>
|
|
<td class="r">#cores_in_service#</td>
|
|
<td class="r">#numberFormat(ghz_in_service,".0")#</td> --->
|
|
<td class="r">#numberFormat(host_ghz_usage,".0")#</td>
|
|
<td class="r">#numberFormat(vm_ghz_usage,".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_promised,".0")#</td>
|
|
<td class="r">#vm_cores#</td>
|
|
<td class="r">#numberFormat(GHz_provision_rate,"0")#</td>
|
|
<td class="r">#numberFormat(gb_provisioned,"0")#</td>
|
|
<td class="r">#numberFormat(vm_ram_alloc,"0")#</td>
|
|
<td class="r">#numberFormat(vm_ram_used,"0")#</td>
|
|
<td class="r">#numberFormat(GB_alloc_perc,"0")#</td>
|
|
<td class="r">#numberFormat(GB_usage_perc,"0")#</td>
|
|
<td class="r">#vms#</td>
|
|
<td class="r"><cftry>#numberFormat(vm_cores/vms,".0")# core #numberFormat(vm_ghz_usage/vms,".0")# GHz #numberFormat(vm_ghz_usage/vm_cores/ghz*100,"0")#% #numberFormat(vm_ram_alloc/vms,".0")#(#numberFormat(vm_ram_used/vms,".0")#) GB <cfcatch></cfcatch></cftry></td>
|
|
</tr>
|
|
</cfoutput>
|
|
<cfoutput query="qTotal">
|
|
<tr class="b">
|
|
<td colspan="4" class="r b"> Итого</td>
|
|
<td class="r">#numberFormat(ghz,".0")#</td>
|
|
<td class="r">#hosts_total#</td>
|
|
<td class="r">#hosts_ha#</td>
|
|
<td class="r">#hosts_in_maintenance#</td>
|
|
<!--- <td class="r"></td>
|
|
<td class="r">#numberFormat(ram_in_service,"0")#</td>
|
|
<td class="r">#cores_in_service#</td>
|
|
<td class="r">#numberFormat(ghz_in_service,".0")#</td> --->
|
|
<td class="r">#numberFormat(host_ghz_usage,".0")#</td>
|
|
<td class="r">#numberFormat(vm_ghz_usage,".0")#</td>
|
|
<td class="c" style="font-size:130%;">
|
|
<!--- <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">#numberFormat(cores_total,"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_promised,".0")#</td>
|
|
<td class="r">#vm_cores#</td>
|
|
<td class="r"></td>
|
|
<td class="r">#numberFormat(gb_provisioned,"0")#</td>
|
|
<td class="r">#numberFormat(vm_ram_alloc,"0")#</td>
|
|
<td class="r">#numberFormat(vm_ram_used,"0")#</td>
|
|
<td class="r" style="font-size:130%;"><cfif ram_in_service NEQ 0>#numberFormat(vm_ram_alloc/ram_in_service*100,"0")#</cfif></td>
|
|
<td class="r" style="font-size:130%;"><cfif ram_in_service NEQ 0>#numberFormat(vm_ram_used/ram_in_service*100,"0")#</cfif></td>
|
|
<td class="r">#vms#</td>
|
|
<td class="r">
|
|
<cftry>
|
|
<cfif vms NEQ 0>#numberFormat(vm_cores/vms,".0")# core</cfif>
|
|
<cfif vms NEQ 0>#numberFormat(vm_ghz_usage/vms,".0")# GHz</cfif>
|
|
<cfif vm_cores NEQ 0 AND ghz NEQ 0>#numberFormat(vm_ghz_usage/vm_cores/ghz*100,"0")#%</cfif> <!--- *** тут не уверен --->
|
|
<cfif vms NEQ 0>#numberFormat(vm_ram_alloc/vms,".0")#(#numberFormat(vm_ram_used/vms,".0")#) GB</cfif>
|
|
<cfcatch></cfcatch></cftry>
|
|
</td>
|
|
</tr>
|
|
</cfoutput>
|
|
|
|
</table>
|
|
<!--- <cfdump var=#qCharge#/> --->
|
|
<i>Пока выводим избыточный набор колонок для контроля. Кроме того, еще не выбрали, какие колонки удобнее и релевантнее</i>
|
|
<br/>
|
|
<i>* CPU GHz provision rate % - отношение зарезервированной частоты (с учетом 20% резерва по умолчанию) к наличной частоте процессоров</i>
|
|
<br/>
|
|
<i>* Для средней ВМ указана аллоцированная память, а в скобках - используемая </i>
|
|
<br/>
|
|
<!--- <cfchart
|
|
format="png"
|
|
chartWidth="500"
|
|
chartHeight="300"
|
|
seriesplacement="stacked"
|
|
title="Population Distribution: Males vs Females"
|
|
scalefrom="-100"
|
|
scaleto="100"
|
|
labelformat="number">
|
|
|
|
<!--- Left Side: Males (Negative Values) --->
|
|
<cfchartseries type="bar" seriesLabel="Males" seriesColor="##3366CC">
|
|
<cfchartdata item="Age 0-10" value="-85">
|
|
<cfchartdata item="Age 11-20" value="-70">
|
|
<cfchartdata item="Age 21-30" value="-55">
|
|
</cfchartseries>
|
|
|
|
<!--- Right Side: Females (Positive Values) --->
|
|
<cfchartseries type="bar" seriesLabel="Females" seriesColor="##FF99CC">
|
|
<cfchartdata item="Age 0-10" value="82">
|
|
<cfchartdata item="Age 11-20" value="75">
|
|
<cfchartdata item="Age 21-30" value="60">
|
|
</cfchartseries>
|
|
</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"/>
|
|
|