in src/Common/AzureIaaSCostCalculator.cs [290:361]
private void CalculateSqlIaaSCost()
{
double nonAhubCost = 0.0;
foreach (var sqlInstance in SQL_IaaS_Instance_Rehost_Perf_List)
{
if (sqlInstance.Environment.Equals("Dev"))
{
SqlIaaSDevComputeCost += sqlInstance.MonthlyComputeCostEstimate_AHUB_RI3year == 0 ? sqlInstance.MonthlyComputeCostEstimate_AHUB : sqlInstance.MonthlyComputeCostEstimate_AHUB_RI3year;
SqlIaaSDevStorageCost += sqlInstance.MonthlyStorageCostEstimate;
nonAhubCost += sqlInstance.MonthlyComputeCostEstimate_RI3year == 0 ? sqlInstance.MonthlyComputeCostEstimate : sqlInstance.MonthlyComputeCostEstimate_RI3year;
sqlDevRowCount += 1;
if (!sqlUniqueDevMachines.Contains(sqlInstance.MachineId))
sqlUniqueDevMachines.Add(sqlInstance.MachineId);
}
else
{
SqlIaaSProdComputeCost += sqlInstance.MonthlyComputeCostEstimate_AHUB_RI3year;
SqlIaaSProdStorageCost += sqlInstance.MonthlyStorageCostEstimate;
BackupComputeCost += sqlInstance.MonthlyAzureBackupCostEstimate;
RecoveryComputeCost += sqlInstance.MonthlyAzureSiteRecoveryCostEstimate;
nonAhubCost += sqlInstance.MonthlyComputeCostEstimate_RI3year;
sqlProdRowCount += 1;
if (!sqlUniqueProdMachines.Contains(sqlInstance.MachineId))
sqlUniqueProdMachines.Add(sqlInstance.MachineId);
if (!managementUniqueProdMachines.Contains(sqlInstance.MachineId))
managementUniqueProdMachines.Add(sqlInstance.MachineId);
}
SqlIaaSSecurityCost += sqlInstance.MonthlySecurityCostEstimate;
}
foreach (var sqlServer in SQL_IaaS_Server_Rehost_Perf_List)
{
if (sqlServer.Environment.Equals("Dev"))
{
SqlIaaSDevComputeCost += sqlServer.MonthlyComputeCostEstimate_AHUB_RI3year == 0 ? sqlServer.MonthlyComputeCostEstimate_AHUB : sqlServer.MonthlyComputeCostEstimate_AHUB_RI3year;
SqlIaaSDevStorageCost += sqlServer.MonthlyStorageCostEstimate;
nonAhubCost += sqlServer.MonthlyComputeCostEstimate_RI3year == 0 ? sqlServer.MonthlyComputeCostEstimate : sqlServer.MonthlyComputeCostEstimate_RI3year;
sqlDevRowCount += 1;
if (!sqlUniqueDevMachines.Contains(sqlServer.MachineId))
sqlUniqueDevMachines.Add(sqlServer.MachineId);
}
else
{
SqlIaaSProdComputeCost += sqlServer.MonthlyComputeCostEstimate_AHUB_RI3year;
SqlIaaSProdStorageCost += sqlServer.MonthlyStorageCostEstimate;
BackupComputeCost += sqlServer.MonthlyAzureBackupCostEstimate;
RecoveryComputeCost += sqlServer.MonthlyAzureSiteRecoveryCostEstimate;
nonAhubCost += sqlServer.MonthlyComputeCostEstimate_RI3year;
sqlProdRowCount += 1;
if (!sqlUniqueProdMachines.Contains(sqlServer.MachineId))
sqlUniqueProdMachines.Add(sqlServer.MachineId);
if (!managementUniqueProdMachines.Contains(sqlServer.MachineId))
managementUniqueProdMachines.Add(sqlServer.MachineId);
}
SqlIaaSSecurityCost += sqlServer.MonthlySecurityCostEstimate;
}
SqlIaaSComputeCost = SqlIaaSDevComputeCost + SqlIaaSProdComputeCost;
SqlIaaSStorageCost = SqlIaaSDevStorageCost + SqlIaaSProdStorageCost;
SqlIaaSAhubSavings = nonAhubCost - SqlIaaSComputeCost;
}