public static function getSCUByInstanceType($serverType, $platform)
{
$scu = [];
$scu[SERVER_PLATFORMS::EC2] = array('t1.micro' => 0.25, 't2.nano' => 0.1, 't2.micro' => 0.25, 't2.small' => 0.5, 't2.medium' => 0.75, 't2.large' => 1, 'c1.medium' => 1.75, 'c1.xlarge' => 7.25, 'c3.large' => 2, 'c3.xlarge' => 4, 'c3.2xlarge' => 8, 'c3.4xlarge' => 16, 'c3.8xlarge' => 32, 'c4.large' => 2.25, 'c4.xlarge' => 4.5, 'c4.2xlarge' => 9, 'c4.4xlarge' => 17, 'c4.8xlarge' => 33, 'r3.large' => 2, 'r3.xlarge' => 4, 'r3.2xlarge' => 8, 'r3.4xlarge' => 16, 'r3.8xlarge' => 32, 'm1.small' => 0.75, 'm1.medium' => 1.5, 'm1.large' => 3.25, 'm1.xlarge' => 6.25, 'm2.xlarge' => 5.5, 'm2.2xlarge' => 11, 'm2.4xlarge' => 20, 'm3.medium' => 1.5, 'm3.large' => 3, 'm3.xlarge' => 6, 'm3.2xlarge' => 12, 'm4.large' => 3, 'm4.xlarge' => 6, 'm4.2xlarge' => 12, 'm4.4xlarge' => 16, 'm4.10xlarge' => 44, 'cc1.4xlarge' => 16, 'cc2.8xlarge' => 30, 'cr1.8xlarge' => 44, 'cg1.4xlarge' => 26, 'hi1.4xlarge' => 38, 'hs1.8xlarge' => 58, 'g2.2xlarge' => 8, 'g2.8xlarge' => 32, 'i2.xlarge' => 4, 'i2.2xlarge' => 8, 'i2.4xlarge' => 16, 'i2.8xlarge' => 32, 'd2.xlarge' => 4, 'd2.2xlarge' => 8, 'd2.4xlarge' => 16, 'd2.8xlarge' => 32);
$scu[SERVER_PLATFORMS::RACKSPACENG_US] = array('1' => 0.25, '2' => 0.75, '3' => 1.5, '4' => 3, '5' => 6, '6' => 12, '7' => 15, 'general1-1' => 0.25, 'general1-2' => 0.5, 'general1-4' => 1, 'general1-8' => 2, 'io1-15' => 3, 'io1-30' => 6, 'io1-60' => 12, 'io1-90' => 24, 'io1-120' => 48, 'performance1-1' => 0.5, 'performance1-2' => 1, 'performance1-4' => 2, 'performance1-8' => 4, 'performance2-15' => 8, 'performance2-30' => 16, 'performance2-60' => 32, 'performance2-90' => 48, 'performance2-120' => 64);
$scu[SERVER_PLATFORMS::RACKSPACENG_UK] = array('1' => 0.25, '2' => 0.75, '3' => 1.5, '4' => 3, '5' => 6, '6' => 12, '7' => 15, 'general1-1' => 0.25, 'general1-2' => 0.5, 'general1-4' => 1, 'general1-8' => 2, 'io1-15' => 3, 'io1-30' => 6, 'io1-60' => 12, 'io1-90' => 24, 'io1-120' => 48, 'performance1-1' => 0.5, 'performance1-2' => 1, 'performance1-4' => 2, 'performance1-8' => 4, 'performance2-15' => 8, 'performance2-30' => 16, 'performance2-60' => 32, 'performance2-90' => 48, 'performance2-120' => 64);
$scu[SERVER_PLATFORMS::GCE] = array('n1-standard-1-d' => 1.75, 'n1-standard-2-d' => 3.5, 'n1-standard-4-d' => 7, 'n1-standard-8-d' => 14, 'n1-standard-1' => 1.5, 'n1-standard-2' => 3, 'n1-standard-4' => 6, 'n1-standard-8' => 12, 'n1-standard-16' => 24, 'n1-highmem-2-d' => 4, 'n1-highmem-4-d' => 8, 'n1-highmem-8-d' => 16, 'n1-highmem-2' => 3.25, 'n1-highmem-4' => 6.5, 'n1-highmem-8' => 13, 'n1-highmem-16' => 26, 'n1-highcpu-2-d' => 2, 'n1-highcpu-4-d' => 4, 'n1-highcpu-8-d' => 8, 'n1-highcpu-2' => 1.75, 'n1-highcpu-4' => 3.5, 'n1-highcpu-8' => 7, 'n1-highcpu-16' => 14, 'f1-micro' => 0.25, 'g1-small' => 0.5);
if (!isset($scu[$platform][$serverType])) {
if (isset($scu[$platform])) {
// Check SCU only for defined clouds for private clouds, we don't care
trigger_error(sprintf('SCU has not been defined for instance type: "%s" on "%s" platform.', $serverType, $platform), E_USER_WARNING);
}
return 0;
}
return $scu[$platform][$serverType];
}