Merge "Fix AWS quota limits for vCPUs"
This commit is contained in:
commit
ad7bf9aaeb
@ -141,7 +141,7 @@ Selecting the ``aws`` driver adds the following options to the
|
||||
.. code-block:: yaml
|
||||
|
||||
max-resources:
|
||||
'L-43DA4232': 224
|
||||
'L-43DA4232': 448
|
||||
|
||||
See `instance quotas`_ for more information.
|
||||
|
||||
@ -498,7 +498,7 @@ Selecting the ``aws`` driver adds the following options to the
|
||||
.. code-block:: yaml
|
||||
|
||||
max-resources:
|
||||
'L-43DA4232': 224
|
||||
'L-43DA4232': 448
|
||||
|
||||
See `instance quotas`_ for more information.
|
||||
|
||||
|
@ -557,7 +557,7 @@ Options
|
||||
max-servers: 10
|
||||
max-cores: 200
|
||||
max-ram: 16565
|
||||
'L-43DA4232': 224
|
||||
'L-43DA4232': 448
|
||||
|
||||
Each entry is a dictionary with the following keys. Any other keys
|
||||
are interpreted as driver-specific resource limits (otherwise
|
||||
|
@ -629,15 +629,18 @@ class AwsAdapter(statemachine.Adapter):
|
||||
def _getQuotaForInstanceType(self, instance_type):
|
||||
itype = self._getInstanceType(instance_type)
|
||||
cores = itype['InstanceTypes'][0]['VCpuInfo']['DefaultCores']
|
||||
vcpus = itype['InstanceTypes'][0]['VCpuInfo']['DefaultVCpus']
|
||||
ram = itype['InstanceTypes'][0]['MemoryInfo']['SizeInMiB']
|
||||
code = self._getQuotaCodeForInstanceType(instance_type)
|
||||
# We include cores twice: one to match the overall cores quota
|
||||
# (which may be set as a tenant resource limit), and a second
|
||||
# time as the specific AWS quota code which in for a specific
|
||||
# instance type.
|
||||
# We include cores to match the overall cores quota (which may
|
||||
# be set as a tenant resource limit), and include vCPUs for the
|
||||
# specific AWS quota code which in for a specific instance
|
||||
# type. With two threads per core, the vCPU number is
|
||||
# typically twice the number of cores. AWS service quotas are
|
||||
# implemented in terms of vCPUs.
|
||||
args = dict(cores=cores, ram=ram, instances=1)
|
||||
if code:
|
||||
args[code] = cores
|
||||
args[code] = vcpus
|
||||
return QuotaInformation(**args)
|
||||
|
||||
# This method is wrapped with an LRU cache in the constructor.
|
||||
|
4
nodepool/tests/fixtures/aws/aws-limits.yaml
vendored
4
nodepool/tests/fixtures/aws/aws-limits.yaml
vendored
@ -11,7 +11,7 @@ zookeeper-tls:
|
||||
tenant-resource-limits:
|
||||
- tenant-name: tenant-1
|
||||
max-cores: 1024
|
||||
'L-43DA4232': 224 # high mem cores
|
||||
'L-43DA4232': 448 # high mem vCPUs
|
||||
|
||||
labels:
|
||||
- name: standard
|
||||
@ -34,7 +34,7 @@ providers:
|
||||
key1: value1
|
||||
key2: value2
|
||||
max-resources:
|
||||
'L-1216C47A': 1 # standard cores
|
||||
'L-1216C47A': 2 # standard vCPUs
|
||||
labels:
|
||||
- name: standard
|
||||
cloud-image: ubuntu1404
|
||||
|
@ -240,8 +240,8 @@ class TestDriverAws(tests.DBTestCase):
|
||||
self.waitForNodeDeletion(node)
|
||||
|
||||
@aws_quotas({
|
||||
'L-1216C47A': 1,
|
||||
'L-43DA4232': 224,
|
||||
'L-1216C47A': 2,
|
||||
'L-43DA4232': 448,
|
||||
})
|
||||
def test_aws_multi_quota(self):
|
||||
# Test multiple instance type quotas (standard and high-mem)
|
||||
|
Loading…
x
Reference in New Issue
Block a user