Skip to content

Commit

Permalink
Set default fixed_ip quota to unlimited.
Browse files Browse the repository at this point in the history
DocImpact: our previous default quota of ten was poorly thought through
and resulted in upgrade problems. Instead, let's have operators opt into
fixed IP quotas. This change should be mentioned in release notes please.

Resolves bug 1161190.

Change-Id: I2f066a0129461899fe330a628cf49ee5273eaba4
  • Loading branch information
mikalstill committed Mar 29, 2013
1 parent 7f94300 commit a312113
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 56 deletions.
@@ -1,7 +1,7 @@
{
"quota_class_set": {
"cores": 20,
"fixed_ips": 10,
"fixed_ips": -1,
"floating_ips": 10,
"id": "test_class",
"injected_file_content_bytes": 10240,
Expand All @@ -14,4 +14,4 @@
"security_group_rules": 20,
"security_groups": 10
}
}
}
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<quota_class_set id="test_class">
<cores>20</cores>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<floating_ips>10</floating_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
Expand All @@ -12,4 +12,4 @@
<ram>51200</ram>
<security_group_rules>20</security_group_rules>
<security_groups>10</security_groups>
</quota_class_set>
</quota_class_set>
@@ -1,7 +1,7 @@
{
"quota_class_set": {
"cores": 50,
"fixed_ips": 10,
"fixed_ips": -1,
"floating_ips": 10,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
Expand All @@ -13,4 +13,4 @@
"security_group_rules": 20,
"security_groups": 10
}
}
}
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<quota_class_set>
<cores>50</cores>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<floating_ips>10</floating_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
Expand All @@ -12,4 +12,4 @@
<ram>51200</ram>
<security_group_rules>20</security_group_rules>
<security_groups>10</security_groups>
</quota_class_set>
</quota_class_set>
@@ -1,7 +1,7 @@
{
"quota_set": {
"cores": 20,
"fixed_ips": 10,
"fixed_ips": -1,
"floating_ips": 10,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
Expand All @@ -14,4 +14,4 @@
"security_group_rules": 20,
"security_groups": 10
}
}
}
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<quota_set id="fake_tenant">
<cores>20</cores>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<floating_ips>10</floating_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
Expand All @@ -12,4 +12,4 @@
<ram>51200</ram>
<security_group_rules>20</security_group_rules>
<security_groups>10</security_groups>
</quota_set>
</quota_set>
4 changes: 2 additions & 2 deletions doc/api_samples/os-quota-sets/quotas-show-get-resp.json
@@ -1,7 +1,7 @@
{
"quota_set": {
"cores": 20,
"fixed_ips": 10,
"fixed_ips": -1,
"floating_ips": 10,
"id": "fake_tenant",
"injected_file_content_bytes": 10240,
Expand All @@ -14,4 +14,4 @@
"security_group_rules": 20,
"security_groups": 10
}
}
}
4 changes: 2 additions & 2 deletions doc/api_samples/os-quota-sets/quotas-show-get-resp.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<quota_set id="fake_tenant">
<cores>20</cores>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<floating_ips>10</floating_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
Expand All @@ -12,4 +12,4 @@
<ram>51200</ram>
<security_group_rules>20</security_group_rules>
<security_groups>10</security_groups>
</quota_set>
</quota_set>
4 changes: 2 additions & 2 deletions doc/api_samples/os-quota-sets/quotas-update-post-resp.json
@@ -1,7 +1,7 @@
{
"quota_set": {
"cores": 20,
"fixed_ips": 10,
"fixed_ips": -1,
"floating_ips": 10,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
Expand All @@ -13,4 +13,4 @@
"security_group_rules": 20,
"security_groups": 45
}
}
}
4 changes: 2 additions & 2 deletions doc/api_samples/os-quota-sets/quotas-update-post-resp.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<quota_set>
<cores>20</cores>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<floating_ips>10</floating_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
Expand All @@ -12,4 +12,4 @@
<ram>51200</ram>
<security_group_rules>20</security_group_rules>
<security_groups>45</security_groups>
</quota_set>
</quota_set>
2 changes: 1 addition & 1 deletion nova/quota.py
Expand Up @@ -44,7 +44,7 @@
default=10,
help='number of floating ips allowed per project'),
cfg.IntOpt('quota_fixed_ips',
default=10,
default=-1,
help=('number of fixed ips allowed per project (this should be '
'at least the number of instances allowed)')),
cfg.IntOpt('quota_metadata_items',
Expand Down
16 changes: 8 additions & 8 deletions nova/tests/api/openstack/compute/contrib/test_quota_classes.py
Expand Up @@ -25,7 +25,7 @@
def quota_set(class_name):
return {'quota_class_set': {'id': class_name, 'metadata_items': 128,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'instances': 10,
'fixed_ips': -1, 'instances': 10,
'injected_files': 5, 'cores': 20,
'injected_file_content_bytes': 10240,
'security_groups': 10,
Expand All @@ -45,7 +45,7 @@ def test_format_quota_set(self):
'cores': 20,
'ram': 51200,
'floating_ips': 10,
'fixed_ips': 10,
'fixed_ips': -1,
'metadata_items': 128,
'injected_files': 5,
'injected_file_path_bytes': 255,
Expand All @@ -64,7 +64,7 @@ def test_format_quota_set(self):
self.assertEqual(qs['cores'], 20)
self.assertEqual(qs['ram'], 51200)
self.assertEqual(qs['floating_ips'], 10)
self.assertEqual(qs['fixed_ips'], 10)
self.assertEqual(qs['fixed_ips'], -1)
self.assertEqual(qs['metadata_items'], 128)
self.assertEqual(qs['injected_files'], 5)
self.assertEqual(qs['injected_file_path_bytes'], 255)
Expand All @@ -90,7 +90,7 @@ def test_quotas_show_as_unauthorized_user(self):
def test_quotas_update_as_admin(self):
body = {'quota_class_set': {'instances': 50, 'cores': 50,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'injected_file_path_bytes': 255,
Expand All @@ -108,7 +108,7 @@ def test_quotas_update_as_admin(self):
def test_quotas_update_as_user(self):
body = {'quota_class_set': {'instances': 50, 'cores': 50,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'security_groups': 10,
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_serializer(self):
injected_file_content_bytes=20,
ram=50,
floating_ips=60,
fixed_ips=10,
fixed_ips=-1,
instances=70,
injected_files=80,
security_groups=10,
Expand All @@ -161,7 +161,7 @@ def test_deserializer(self):
injected_file_content_bytes='20',
ram='50',
floating_ips='60',
fixed_ips='10',
fixed_ips='-1',
instances='70',
injected_files='80',
security_groups='10',
Expand All @@ -175,7 +175,7 @@ def test_deserializer(self):
'</injected_file_content_bytes>'
'<ram>50</ram>'
'<floating_ips>60</floating_ips>'
'<fixed_ips>10</fixed_ips>'
'<fixed_ips>-1</fixed_ips>'
'<instances>70</instances>'
'<injected_files>80</injected_files>'
'<cores>90</cores>'
Expand Down
26 changes: 13 additions & 13 deletions nova/tests/api/openstack/compute/contrib/test_quotas.py
Expand Up @@ -26,7 +26,7 @@

def quota_set(id):
return {'quota_set': {'id': id, 'metadata_items': 128,
'ram': 51200, 'floating_ips': 10, 'fixed_ips': 10,
'ram': 51200, 'floating_ips': 10, 'fixed_ips': -1,
'instances': 10, 'injected_files': 5, 'cores': 20,
'injected_file_content_bytes': 10240,
'security_groups': 10, 'security_group_rules': 20,
Expand All @@ -45,7 +45,7 @@ def test_format_quota_set(self):
'cores': 20,
'ram': 51200,
'floating_ips': 10,
'fixed_ips': 10,
'fixed_ips': -1,
'metadata_items': 128,
'injected_files': 5,
'injected_file_path_bytes': 255,
Expand All @@ -62,7 +62,7 @@ def test_format_quota_set(self):
self.assertEqual(qs['cores'], 20)
self.assertEqual(qs['ram'], 51200)
self.assertEqual(qs['floating_ips'], 10)
self.assertEqual(qs['fixed_ips'], 10)
self.assertEqual(qs['fixed_ips'], -1)
self.assertEqual(qs['metadata_items'], 128)
self.assertEqual(qs['injected_files'], 5)
self.assertEqual(qs['injected_file_path_bytes'], 255)
Expand All @@ -83,7 +83,7 @@ def test_quotas_defaults(self):
'cores': 20,
'ram': 51200,
'floating_ips': 10,
'fixed_ips': 10,
'fixed_ips': -1,
'metadata_items': 128,
'injected_files': 5,
'injected_file_path_bytes': 255,
Expand All @@ -109,13 +109,13 @@ def test_quotas_show_as_unauthorized_user(self):
def test_quotas_update_as_admin(self):
body = {'quota_set': {'instances': 50, 'cores': 50,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'injected_file_path_bytes': 255,
'security_groups': 10,
'security_group_rules': 20,
'key_pairs': 100, 'fixed_ips': 10}}
'key_pairs': 100, 'fixed_ips': -1}}

req = fakes.HTTPRequest.blank('/v2/fake4/os-quota-sets/update_me',
use_admin_context=True)
Expand All @@ -126,7 +126,7 @@ def test_quotas_update_as_admin(self):
def test_quotas_update_as_user(self):
body = {'quota_set': {'instances': 50, 'cores': 50,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'security_groups': 10,
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_quotas_update_invalid_value(self):
expected_resp = {'quota_set': {
'instances': 50, 'cores': 50,
'ram': 51200, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'injected_file_path_bytes': 255,
Expand All @@ -174,7 +174,7 @@ def test_quotas_update_invalid_value(self):
# when PUT JSON format with empty string for quota
body = {'quota_set': {'instances': 50, 'cores': 50,
'ram': '', 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'injected_file_path_bytes': 255,
Expand All @@ -189,7 +189,7 @@ def test_quotas_update_invalid_value(self):
# when PUT XML format with empty string for quota
body = {'quota_set': {'instances': 50, 'cores': 50,
'ram': {}, 'floating_ips': 10,
'fixed_ips': 10, 'metadata_items': 128,
'fixed_ips': -1, 'metadata_items': 128,
'injected_files': 5,
'injected_file_content_bytes': 10240,
'injected_file_path_bytes': 255,
Expand All @@ -216,7 +216,7 @@ def test_serializer(self):
injected_file_content_bytes=20,
ram=50,
floating_ips=60,
fixed_ips=10,
fixed_ips=-1,
instances=70,
injected_files=80,
security_groups=10,
Expand All @@ -240,7 +240,7 @@ def test_deserializer(self):
injected_file_content_bytes='20',
ram='50',
floating_ips='60',
fixed_ips='10',
fixed_ips='-1',
instances='70',
injected_files='80',
security_groups='10',
Expand All @@ -254,7 +254,7 @@ def test_deserializer(self):
'</injected_file_content_bytes>'
'<ram>50</ram>'
'<floating_ips>60</floating_ips>'
'<fixed_ips>10</fixed_ips>'
'<fixed_ips>-1</fixed_ips>'
'<instances>70</instances>'
'<injected_files>80</injected_files>'
'<security_groups>10</security_groups>'
Expand Down
Expand Up @@ -2,7 +2,7 @@
"quota_class_set": {
"cores": 20,
"floating_ips": 10,
"fixed_ips": 10,
"fixed_ips": -1,
"id": "%(set_id)s",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
Expand Down
Expand Up @@ -2,7 +2,7 @@
<quota_class_set id="%(set_id)s">
<cores>20</cores>
<floating_ips>10</floating_ips>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
<injected_files>5</injected_files>
Expand Down
Expand Up @@ -4,7 +4,7 @@
"cores": 50,
"ram": 51200,
"floating_ips": 10,
"fixed_ips": 10,
"fixed_ips": -1,
"metadata_items": 128,
"injected_files": 5,
"injected_file_content_bytes": 10240,
Expand Down
Expand Up @@ -2,7 +2,7 @@
<quota_class_set>
<cores>50</cores>
<floating_ips>10</floating_ips>
<fixed_ips>10</fixed_ips>
<fixed_ips>-1</fixed_ips>
<injected_file_content_bytes>10240</injected_file_content_bytes>
<injected_file_path_bytes>255</injected_file_path_bytes>
<injected_files>5</injected_files>
Expand Down

0 comments on commit a312113

Please sign in to comment.