diff options
author | Dan Smith <dansmith@redhat.com> | 2018-07-06 09:09:05 -0700 |
---|---|---|
committer | Eric Fried <efried@us.ibm.com> | 2018-07-18 19:48:36 +0000 |
commit | 03c596a9f4324e572bc04d4bbad09a6d3d47366c (patch) | |
tree | c39a4207ae036cd0defd2a81ad5121cf36bad4cd /nova/tests/unit/objects/test_request_spec.py | |
parent | eb4f65a7951e921b1cd8d05713e144e72f2f254f (diff) | |
download | nova-03c596a9f4324e572bc04d4bbad09a6d3d47366c.tar.gz |
Avoid requesting DISK_GB allocation for root_gb on BFV instances
Right now, we still ask placement for a disk allocation covering
swap, ephemeral, and root disks for the instance even if the instance
is going to be volume-backed. This patch makes us not include the
root size in that calculation for placement, avoiding a false
failure because the volume size is counted against the compute's
available space.
To do this, we need another flag in request_spec to track the
BFV-ness of the instance. Right now, this patch just sets that on
new builds and the scheduler client assumes a lack of said flag
as "I don't know, so assume not-BFV" for compatibility. A
subsequent patch can calculate that flag for existing instances
so that we will be able to heal over time by migrating instances
or re-writing their allocations to reflect reality.
Partial-Bug: #1469179
Change-Id: I9c2111f7377df65c1fc3c72323f85483b3295989
Diffstat (limited to 'nova/tests/unit/objects/test_request_spec.py')
-rw-r--r-- | nova/tests/unit/objects/test_request_spec.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/unit/objects/test_request_spec.py b/nova/tests/unit/objects/test_request_spec.py index 770f6b9d86..4577d25409 100644 --- a/nova/tests/unit/objects/test_request_spec.py +++ b/nova/tests/unit/objects/test_request_spec.py @@ -299,7 +299,7 @@ class _TestRequestSpecObject(object): spec = objects.RequestSpec.from_primitives(ctxt, spec_dict, filt_props) mock_limits.assert_called_once_with({}) # Make sure that all fields are set using that helper method - skip = ['id', 'security_groups', 'network_metadata'] + skip = ['id', 'security_groups', 'network_metadata', 'is_bfv'] for field in [f for f in spec.obj_fields if f not in skip]: self.assertTrue(spec.obj_attr_is_set(field), 'Field: %s is not set' % field) @@ -329,7 +329,7 @@ class _TestRequestSpecObject(object): filter_properties, instance_group, instance.availability_zone, objects.SecurityGroupList()) # Make sure that all fields are set using that helper method - skip = ['id', 'network_metadata'] + skip = ['id', 'network_metadata', 'is_bfv'] for field in [f for f in spec.obj_fields if f not in skip]: self.assertTrue(spec.obj_attr_is_set(field), 'Field: %s is not set' % field) |