Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting the correct calculation of U-space for DC stats #1290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/DataCenter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@ function GetDCStatistics(){
// Count the U used up by devices that are (a) not chassis cards; (b) in a cabinet in the data center; (c) not a server or array; and (d) not in the Storage Room (Cabinet=-1)
$sql="SELECT SUM(a.Height) as TotalU FROM fac_Device a,fac_Cabinet b WHERE
a.Cabinet=b.CabinetID AND b.DataCenterID=$this->DataCenterID AND ParentDevice=0 AND
a.DeviceType NOT IN ('Server','Storage Array') and a.Status NOT IN ('Reserved', 'Salvage') and a.Cabinet>0;";
a.DeviceType NOT IN ('Server','Appliance','Storage Array','Switch') and a.Status NOT IN ('Reserved', 'Salvage') and a.Cabinet>0;";
$dcStats["Infrastructure"]=($test=$this->query($sql)->fetchColumn())?$test:0;

$sql="SELECT SUM(a.Height) as TotalU FROM fac_Device a,fac_Cabinet b WHERE
a.Cabinet=b.CabinetID AND b.DataCenterID=$this->DataCenterID AND ParentDevice=0 AND
a.Status not in ('Reserved', 'Salvage') AND a.DeviceType IN ('Server', 'Storage Array') and a.Cabinet>0;";
a.Status not in ('Reserved', 'Salvage') AND a.DeviceType IN ('Server','Appliance','Storage Array','Switch') and a.Cabinet>0;";
$dcStats["Occupied"]=($test=$this->query($sql)->fetchColumn())?$test:0;

// There should never be a case where a device marked as reserved ends up in the Storage Room, but S.U.T. #44
Expand Down