From fa3da62b78c8ba485aa6daba9f2a133b72a51be4 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Tue, 18 Jan 2011 15:49:42 -0600 Subject: [PATCH 01/35] Plug VBD to existing instance and minor cleanup --- nova/tests/xenapi/stubs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index 292bd9ba9..313668826 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -37,7 +37,7 @@ def stubout_instance_snapshot(stubs): return self.rv done = FakeEvent() - self._poll_task(id, task, done) + self._poll_task(task, id, done) rv = done.wait() return rv From 1d52d94589b614cbecdf6c60e40195a1898262f5 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Tue, 18 Jan 2011 17:57:11 -0600 Subject: [PATCH 02/35] Fixed unit tests --- nova/tests/xenapi/stubs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index c1ba25e10..13603717c 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -27,7 +27,7 @@ def stubout_instance_snapshot(stubs): def fake_fetch_image(cls, session, instance_id, image, user, project, type): # Stubout wait_for_task - def fake_wait_for_task(self, id, task): + def fake_wait_for_task(self, task, id=None): class FakeEvent: def send(self, value): @@ -37,7 +37,7 @@ def stubout_instance_snapshot(stubs): return self.rv done = FakeEvent() - self._poll_task(task, id, done) + self._poll_task(id, task, done) rv = done.wait() return rv From d7a44bb68893e17924550618e9f9904dadaf2e88 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Tue, 18 Jan 2011 18:09:58 -0600 Subject: [PATCH 03/35] Fixed unit tests --- nova/tests/xenapi/stubs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index 13603717c..66d232a7f 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -27,7 +27,7 @@ def stubout_instance_snapshot(stubs): def fake_fetch_image(cls, session, instance_id, image, user, project, type): # Stubout wait_for_task - def fake_wait_for_task(self, task, id=None): + def fake_wait_for_task(self, task, id): class FakeEvent: def send(self, value): From c4f649a33719acd6fc688fbfa067e05b4999f969 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Tue, 1 Feb 2011 18:34:46 -0800 Subject: [PATCH 04/35] initial support for dynamic instance_types: db migration and model, stub tests and stub methods. --- bin/nova-manage | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/bin/nova-manage b/bin/nova-manage index 1b70ebf17..952bf4fd1 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -609,6 +609,44 @@ class VolumeCommands(object): "mountpoint": volume['mountpoint']}}) +class InstanceTypesCommands(object): + """Class for managing instance types / flavors.""" + + def create(self, name, memory, vcpus, localstorage): + """Creates instance types / flavors + arguments: name memory vcpus localstorage""" + #for address in IPy.IP(range): + # db.floating_ip_create(context.get_admin_context(), + # {'address': str(address), + # 'host': host}) + + def delete(self, name): + """Deletes instance types / flavors + arguments: name""" + #for address in IPy.IP(ip_range): + # db.floating_ip_destroy(context.get_admin_context(), + # str(address)) + + def list(self): + """Lists all instance types / flavors + arguments: """ + #ctxt = context.get_admin_context() + #if host == None: + # floating_ips = db.floating_ip_get_all(ctxt) + #else: + # floating_ips = db.floating_ip_get_all_by_host(ctxt, host) + #for floating_ip in floating_ips: + # instance = None + # if floating_ip['fixed_ip']: + # instance = floating_ip['fixed_ip']['instance']['ec2_id'] + # print "%s\t%s\t%s" % (floating_ip['host'], + # floating_ip['address'], + # instance) + # print "%-10s %-10s %-8s %s %s" % (svc['host'], svc['binary'], + # active, art, + # svc['updated_at']) + + CATEGORIES = [ ('user', UserCommands), ('project', ProjectCommands), @@ -620,7 +658,8 @@ CATEGORIES = [ ('service', ServiceCommands), ('log', LogCommands), ('db', DbCommands), - ('volume', VolumeCommands)] + ('volume', VolumeCommands), + ('instance_types', InstanceTypesCommands)] def lazy_match(name, key_value_tuples): From 7618e7ccecb257db36525c3e6a04aa3809d09f1f Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Thu, 3 Feb 2011 17:57:46 -0800 Subject: [PATCH 05/35] flagged all INSTANCE_TYPES usage with FIXME comment. Added basic usage to nova-manage (needs formatting). created api methods. --- bin/nova-manage | 39 ++++++++++++++------------------------- nova/tests/test_xenapi.py | 1 + 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 952bf4fd1..0406a2dd9 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -611,40 +611,29 @@ class VolumeCommands(object): class InstanceTypesCommands(object): """Class for managing instance types / flavors.""" + def usage(self): + print "$ nova-manage instance_type NAME MEMORY_MB VCPUS LOCAL_GB" - def create(self, name, memory, vcpus, localstorage): + def create(self, name, memory, vcpus, local_gb): """Creates instance types / flavors - arguments: name memory vcpus localstorage""" - #for address in IPy.IP(range): - # db.floating_ip_create(context.get_admin_context(), - # {'address': str(address), - # 'host': host}) + arguments: name memory_mb vcpus local_gb""" + db.instance_type_create(context.get_admin_context(), name, memory, vcpus, local_gb) def delete(self, name): - """Deletes instance types / flavors + """Marks instance types / flavors as deleted arguments: name""" - #for address in IPy.IP(ip_range): - # db.floating_ip_destroy(context.get_admin_context(), - # str(address)) + ctxt = context.get_admin_context() + # check to see if it exists + db.instance_type_delete(context,name) def list(self): """Lists all instance types / flavors arguments: """ - #ctxt = context.get_admin_context() - #if host == None: - # floating_ips = db.floating_ip_get_all(ctxt) - #else: - # floating_ips = db.floating_ip_get_all_by_host(ctxt, host) - #for floating_ip in floating_ips: - # instance = None - # if floating_ip['fixed_ip']: - # instance = floating_ip['fixed_ip']['instance']['ec2_id'] - # print "%s\t%s\t%s" % (floating_ip['host'], - # floating_ip['address'], - # instance) - # print "%-10s %-10s %-8s %s %s" % (svc['host'], svc['binary'], - # active, art, - # svc['updated_at']) + instance_types = db.instance_type_get_all(context.get_admin_context()) + for instance in instance_types: + print "%s : %s memory (MB), %s vcpus, %s storage(GB)" % (instance.name, + instance.memory_mb, instance.vcpus, + instance.local_gb) CATEGORIES = [ diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 9f5b266f3..e38bd4dab 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -225,6 +225,7 @@ class XenAPIVMTestCase(test.TestCase): vm = vms[0] # Check that m1.large above turned into the right thing. + # FIX-ME(kpepple) for dynamic flavors instance_type = instance_types.INSTANCE_TYPES['m1.large'] mem_kib = long(instance_type['memory_mb']) << 10 mem_bytes = str(mem_kib << 10) From 6ff4943945b83c19d993caa2f47fe9aafba0283d Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sat, 5 Feb 2011 01:14:45 -0800 Subject: [PATCH 06/35] added FIXME(kpepple) comments for all constant usage of INSTANCE_TYPES. updated api/ec2/admin.py to use the new instance_types db table --- bin/nova-manage | 11 ++++++----- nova/tests/test_xenapi.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 0406a2dd9..5a4875907 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -617,23 +617,24 @@ class InstanceTypesCommands(object): def create(self, name, memory, vcpus, local_gb): """Creates instance types / flavors arguments: name memory_mb vcpus local_gb""" - db.instance_type_create(context.get_admin_context(), name, memory, vcpus, local_gb) + db.instance_type_create(context.get_admin_context(), + name, memory, vcpus, local_gb) def delete(self, name): """Marks instance types / flavors as deleted arguments: name""" ctxt = context.get_admin_context() # check to see if it exists - db.instance_type_delete(context,name) + db.instance_type_delete(context, name) def list(self): """Lists all instance types / flavors arguments: """ instance_types = db.instance_type_get_all(context.get_admin_context()) for instance in instance_types: - print "%s : %s memory (MB), %s vcpus, %s storage(GB)" % (instance.name, - instance.memory_mb, instance.vcpus, - instance.local_gb) + print "%s : %s memory (MB), %s vcpus, %s storage(GB)" % + (instance.name, instance.memory_mb, instance.vcpus, + instance.local_gb) CATEGORIES = [ diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index e38bd4dab..1d42f8da3 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -225,7 +225,7 @@ class XenAPIVMTestCase(test.TestCase): vm = vms[0] # Check that m1.large above turned into the right thing. - # FIX-ME(kpepple) for dynamic flavors + # FIXME(kpepple) for dynamic flavors instance_type = instance_types.INSTANCE_TYPES['m1.large'] mem_kib = long(instance_type['memory_mb']) << 10 mem_bytes = str(mem_kib << 10) From 202d906cacd44127031955b9c3a7db16dab432e9 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sat, 5 Feb 2011 02:45:53 -0800 Subject: [PATCH 07/35] converted openstack flavors over to use instance_types table. a few pep changes. --- bin/nova-manage | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 5a4875907..69285a42a 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -632,9 +632,8 @@ class InstanceTypesCommands(object): arguments: """ instance_types = db.instance_type_get_all(context.get_admin_context()) for instance in instance_types: - print "%s : %s memory (MB), %s vcpus, %s storage(GB)" % - (instance.name, instance.memory_mb, instance.vcpus, - instance.local_gb) + print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % (instance.name, + instance.memory_mb, instance.vcpus, instance.local_gb) CATEGORIES = [ From 48a9f11b96fc4f04a5a3bc89b139eb1cad6ee25f Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sat, 5 Feb 2011 13:49:38 -0800 Subject: [PATCH 08/35] corrected db.instance_types to return expect dict instead of lists. updated openstack flavors to expect dicts instead of lists. added deleted column to returned dict. --- bin/nova-manage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 69285a42a..2db1c67bf 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -632,8 +632,9 @@ class InstanceTypesCommands(object): arguments: """ instance_types = db.instance_type_get_all(context.get_admin_context()) for instance in instance_types: - print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % (instance.name, - instance.memory_mb, instance.vcpus, instance.local_gb) + print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ + (instance.name, instance.memory_mb, instance.vcpus, + instance.local_gb) CATEGORIES = [ From 9b2329397af67b18e952882fcc5329412dc82d90 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sat, 5 Feb 2011 18:27:51 -0800 Subject: [PATCH 09/35] rewrote nova-manage instance_type to use correct db.api returned objects and have more robust error handling --- bin/nova-manage | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 2db1c67bf..8e2c7962f 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -611,30 +611,51 @@ class VolumeCommands(object): class InstanceTypesCommands(object): """Class for managing instance types / flavors.""" - def usage(self): - print "$ nova-manage instance_type NAME MEMORY_MB VCPUS LOCAL_GB" - def create(self, name, memory, vcpus, local_gb): + def create(self, name, memory, vcpus, local_gb, flavorid): """Creates instance types / flavors arguments: name memory_mb vcpus local_gb""" + # FIXME(kpepple) check for absurb arguments (?) + for option in [memory, flavorid, local_gb, vcpus]: + if option <= 0: + print "Instance type parameters must be positive \ + numbers: %s" % option + sys.exit(1) db.instance_type_create(context.get_admin_context(), - name, memory, vcpus, local_gb) + dict(name=name, memory_mb=memory, + vcpus=vcpus, local_gb=local_gb, + flavorid=flavorid)) + print "%s created" % name + return def delete(self, name): """Marks instance types / flavors as deleted arguments: name""" - ctxt = context.get_admin_context() - # check to see if it exists - db.instance_type_delete(context, name) + if name == None: + print "Instance type name must be supplied" + exit(1) + else: + records = db.instance_type_destroy(context.get_admin_context(),\ + name) + if records != 1: + sys.exit(1) + return - def list(self): + def list(self, name=None): """Lists all instance types / flavors - arguments: """ - instance_types = db.instance_type_get_all(context.get_admin_context()) - for instance in instance_types: + arguments: [name]""" + ctxt = context.get_admin_context() + if name == None: + instance_types = db.instance_type_get_all(ctxt) + if len(instance_types) < 1: + sys.exit(1) + else: + instance_types = db.instance_type_get_by_name(ctxt, name) + for k, v in instance_types.iteritems(): print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (instance.name, instance.memory_mb, instance.vcpus, - instance.local_gb) + (k, v["memory_mb"], + v["vcpus"], v["local_gb"]) + return CATEGORIES = [ From c77782237ea7108c92605ac2f26e38c9b2469fcf Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sun, 6 Feb 2011 13:28:07 -0800 Subject: [PATCH 10/35] simplified instance_types db calls to return entire row - we may need these extra columns for some features and there seems to be little downside in including them. still need to fix testing calls. --- bin/nova-manage | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 8e2c7962f..73d69fc64 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -649,12 +649,16 @@ class InstanceTypesCommands(object): instance_types = db.instance_type_get_all(ctxt) if len(instance_types) < 1: sys.exit(1) + for k, v in instance_types.iteritems(): + print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ + (k, v["memory_mb"], + v["vcpus"], v["local_gb"]) else: instance_types = db.instance_type_get_by_name(ctxt, name) - for k, v in instance_types.iteritems(): print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (k, v["memory_mb"], - v["vcpus"], v["local_gb"]) + (instance_types["name"], instance_types["memory_mb"], + instance_types["vcpus"], instance_types["local_gb"]) + return From 906c0907e1d87c5feda1ebdd7900da88693d31f0 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Sun, 6 Feb 2011 13:48:03 -0800 Subject: [PATCH 11/35] aliased flavor to instance_types in nova-manage. will probably need to make flavor a full fledged class as users will want to list flavors by flavor name --- bin/nova-manage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 73d69fc64..c3fa9cf3f 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -609,7 +609,7 @@ class VolumeCommands(object): "mountpoint": volume['mountpoint']}}) -class InstanceTypesCommands(object): +class InstanceTypeCommands(object): """Class for managing instance types / flavors.""" def create(self, name, memory, vcpus, local_gb, flavorid): @@ -674,7 +674,8 @@ CATEGORIES = [ ('log', LogCommands), ('db', DbCommands), ('volume', VolumeCommands), - ('instance_types', InstanceTypesCommands)] + ('instance_type', InstanceTypeCommands), + ('flavor', InstanceTypeCommands)] def lazy_match(name, key_value_tuples): From 365dc54937de85c75fd6576a333b828831378e3c Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 7 Feb 2011 15:04:26 -0800 Subject: [PATCH 12/35] added INSTANCE_TYPES to test for compatibility with current tests --- nova/test.py | 8 ++++++++ nova/tests/test_xenapi.py | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nova/test.py b/nova/test.py index 881baccd5..cd049f007 100644 --- a/nova/test.py +++ b/nova/test.py @@ -44,6 +44,14 @@ flags.DEFINE_bool('fake_tests', True, 'should we use everything for testing') +INSTANCE_TYPES = { + 'm1.tiny': dict(memory_mb=512, vcpus=1, local_gb=0, flavorid=1), + 'm1.small': dict(memory_mb=2048, vcpus=1, local_gb=20, flavorid=2), + 'm1.medium': dict(memory_mb=4096, vcpus=2, local_gb=40, flavorid=3), + 'm1.large': dict(memory_mb=8192, vcpus=4, local_gb=80, flavorid=4), + 'm1.xlarge': dict(memory_mb=16384, vcpus=8, local_gb=160, flavorid=5)} + + def skip_if_fake(func): """Decorator that skips a test if running in fake mode""" def _skipper(*args, **kw): diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 1d42f8da3..d8611ea10 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -225,8 +225,7 @@ class XenAPIVMTestCase(test.TestCase): vm = vms[0] # Check that m1.large above turned into the right thing. - # FIXME(kpepple) for dynamic flavors - instance_type = instance_types.INSTANCE_TYPES['m1.large'] + instance_type = test.INSTANCE_TYPES['m1.large'] mem_kib = long(instance_type['memory_mb']) << 10 mem_bytes = str(mem_kib << 10) vcpus = instance_type['vcpus'] From 4ad01a83b13e16f2f9a7348b9b8dc3f510bcfb2b Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Tue, 8 Feb 2011 11:24:05 -0800 Subject: [PATCH 13/35] additional error checking for nova-manage instance_type --- bin/nova-manage | 57 ++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index c3fa9cf3f..78591585d 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -617,49 +617,62 @@ class InstanceTypeCommands(object): arguments: name memory_mb vcpus local_gb""" # FIXME(kpepple) check for absurb arguments (?) for option in [memory, flavorid, local_gb, vcpus]: - if option <= 0: + if (option <= 0) or (option.__class__ == int): print "Instance type parameters must be positive \ - numbers: %s" % option + integers: %s" % option sys.exit(1) - db.instance_type_create(context.get_admin_context(), + try: + db.instance_type_create(context.get_admin_context(), dict(name=name, memory_mb=memory, vcpus=vcpus, local_gb=local_gb, flavorid=flavorid)) - print "%s created" % name - return + print "%s created" % name + except exception.DBError, e: + print "%s is already a defined instance types" % name + sys.exit(1) + except: + print "Unknown error" + sys.exit(1) def delete(self, name): """Marks instance types / flavors as deleted arguments: name""" if name == None: print "Instance type name must be supplied" - exit(1) + sys.exit(1) else: - records = db.instance_type_destroy(context.get_admin_context(),\ - name) - if records != 1: + try: + records = db.instance_type_destroy( + context.get_admin_context(), + name) + except exception.NotFound, e: sys.exit(1) - return def list(self, name=None): """Lists all instance types / flavors arguments: [name]""" ctxt = context.get_admin_context() if name == None: - instance_types = db.instance_type_get_all(ctxt) - if len(instance_types) < 1: + try: + instance_types = db.instance_type_get_all(ctxt) + if len(instance_types) < 1: + sys.exit(1) + for k, v in instance_types.iteritems(): + print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ + (k, v["memory_mb"], + v["vcpus"], v["local_gb"]) + except exception.NotFound, e: + print e sys.exit(1) - for k, v in instance_types.iteritems(): - print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (k, v["memory_mb"], - v["vcpus"], v["local_gb"]) else: - instance_types = db.instance_type_get_by_name(ctxt, name) - print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (instance_types["name"], instance_types["memory_mb"], - instance_types["vcpus"], instance_types["local_gb"]) - - return + try: + instance_types = db.instance_type_get_by_name(ctxt, name) + print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ + (instance_types["name"], instance_types["memory_mb"], + instance_types["vcpus"], instance_types["local_gb"]) + except exception.NotFound, e: + print e + sys.exit(1) CATEGORIES = [ From 36530aaf87586c286da0e4f463efdbb702195d75 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Tue, 8 Feb 2011 19:24:14 -0800 Subject: [PATCH 14/35] added testing for instance_types.py and refactored nova-manage to use instance_types.py instead of going directly to db. --- bin/nova-manage | 63 ++++++++++++++--------------- nova/tests/test_instance_types.py | 67 +++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 nova/tests/test_instance_types.py diff --git a/bin/nova-manage b/bin/nova-manage index 78591585d..3ee188593 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -84,6 +84,7 @@ from nova import utils from nova.api.ec2.cloud import ec2_id_to_id from nova.auth import manager from nova.cloudpipe import pipelib +from nova.compute import instance_types from nova.db import migration @@ -612,67 +613,63 @@ class VolumeCommands(object): class InstanceTypeCommands(object): """Class for managing instance types / flavors.""" + def _print_instance_types(self, n, val): + print "%s: %s memory(MB), %s vcpus, %s storage(GB), %s flavorid"\ + % (n, val["memory_mb"], val["vcpus"], + val["local_gb"], val["flavorid"]) + def create(self, name, memory, vcpus, local_gb, flavorid): """Creates instance types / flavors arguments: name memory_mb vcpus local_gb""" - # FIXME(kpepple) check for absurb arguments (?) - for option in [memory, flavorid, local_gb, vcpus]: - if (option <= 0) or (option.__class__ == int): - print "Instance type parameters must be positive \ - integers: %s" % option - sys.exit(1) try: - db.instance_type_create(context.get_admin_context(), - dict(name=name, memory_mb=memory, - vcpus=vcpus, local_gb=local_gb, - flavorid=flavorid)) - print "%s created" % name + instance_types.create(name, memory, vcpus, local_gb, flavorid) + except exception.InvalidInputException, e: + print "Must supply valid parameters to create instance type" + sys.exit(1) except exception.DBError, e: - print "%s is already a defined instance types" % name + print "DB Error: %s" % e sys.exit(1) except: print "Unknown error" sys.exit(1) + else: + print "%s created" % name def delete(self, name): """Marks instance types / flavors as deleted arguments: name""" - if name == None: - print "Instance type name must be supplied" + try: + records = instance_types.destroy(name) + except exception.InvalidParameters: + print "Valid instance type name is required" + sys.exit(1) + except exception.NotFound, e: + print "Instance type name %s not found. \ + No instance type deleted." % name sys.exit(1) else: - try: - records = db.instance_type_destroy( - context.get_admin_context(), - name) - except exception.NotFound, e: - sys.exit(1) + print "%s deleted" % name def list(self, name=None): - """Lists all instance types / flavors + """Lists all or specific instance types / flavors arguments: [name]""" - ctxt = context.get_admin_context() if name == None: try: - instance_types = db.instance_type_get_all(ctxt) - if len(instance_types) < 1: - sys.exit(1) - for k, v in instance_types.iteritems(): - print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (k, v["memory_mb"], - v["vcpus"], v["local_gb"]) + inst_types = instance_types.get_all_types() except exception.NotFound, e: print e sys.exit(1) + else: + for k, v in inst_types.iteritems(): + self._print_instance_types(k, v) else: try: - instance_types = db.instance_type_get_by_name(ctxt, name) - print "%s : %s memory(MB), %s vcpus, %s storage(GB)" % \ - (instance_types["name"], instance_types["memory_mb"], - instance_types["vcpus"], instance_types["local_gb"]) + inst_types = instance_types.get_instance_type(name) except exception.NotFound, e: print e sys.exit(1) + else: + self._print_instance_types(name, inst_types) CATEGORIES = [ diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py new file mode 100644 index 000000000..819431763 --- /dev/null +++ b/nova/tests/test_instance_types.py @@ -0,0 +1,67 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +""" +Unit Tests for instance types code +""" +import datetime + +from nova import context +from nova import db +from nova import exception +from nova import flags +from nova import log as logging +from nova import test +from nova import utils +from nova.compute import instance_types +from nova.db.sqlalchemy.session import get_session +from nova.db.sqlalchemy import models + +FLAGS = flags.FLAGS +LOG = logging.getLogger('nova.tests.compute') + + +class InstanceTypeTestCase(test.TestCase): + """Test cases for instance type code""" + def setUp(self): + super(InstanceTypeTestCase, self).setUp() + session = get_session() + max_flavorid = session.query(models.InstanceTypes).\ + order_by("flavorid desc").first() + self.flavorid = max_flavorid["flavorid"] + 1 + self.name = str(datetime.datetime.utcnow()) + + def tearDown(self): + pass + + def test_instance_type_create_then_delete(self): + """Ensure instance types can be created""" + starting_inst_list = instance_types.get_all_types() + instance_types.create(self.name, 256, 1, 120, self.flavorid) + new = instance_types.get_all_types() + self.assertNotEqual(len(starting_inst_list), + len(new), + 'instance was not created') + rows = instance_types.destroy(self.name) + self.assertEqual(rows, 1) + self.assertEqual(1, + instance_types.get_instance_type(self.name)["deleted"]) + self.assertEqual(starting_inst_list, instance_types.get_all_types()) + + def test_get_all_instance_types(self): + """Ensures that all instance types can be retrieved""" + session = get_session() + total_instance_types = session.query(models.InstanceTypes).\ + count() + inst_types = instance_types.get_all_types() + self.assertEqual(total_instance_types, len(inst_types)) From 031b9db3480ad4b998515787fbe1e0a715f85312 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Thu, 10 Feb 2011 11:21:53 -0800 Subject: [PATCH 15/35] testing refactor --- bin/nova-manage | 2 +- nova/tests/test_instance_types.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 3ee188593..e3c3e70f8 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -623,7 +623,7 @@ class InstanceTypeCommands(object): arguments: name memory_mb vcpus local_gb""" try: instance_types.create(name, memory, vcpus, local_gb, flavorid) - except exception.InvalidInputException, e: + except exception.InvalidInputException: print "Must supply valid parameters to create instance type" sys.exit(1) except exception.DBError, e: diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 819431763..283f0bce8 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -14,7 +14,7 @@ """ Unit Tests for instance types code """ -import datetime +import time from nova import context from nova import db @@ -37,12 +37,10 @@ class InstanceTypeTestCase(test.TestCase): super(InstanceTypeTestCase, self).setUp() session = get_session() max_flavorid = session.query(models.InstanceTypes).\ - order_by("flavorid desc").first() + order_by("flavorid desc").\ + first() self.flavorid = max_flavorid["flavorid"] + 1 - self.name = str(datetime.datetime.utcnow()) - - def tearDown(self): - pass + self.name = str(int(time.time())) def test_instance_type_create_then_delete(self): """Ensure instance types can be created""" From 3a23f4eeec6d45a350b2a315db5192100d1eb6d4 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Thu, 10 Feb 2011 16:29:25 -0800 Subject: [PATCH 16/35] fixed destroy calls --- nova/tests/test_instance_types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 283f0bce8..36c29d336 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -50,8 +50,7 @@ class InstanceTypeTestCase(test.TestCase): self.assertNotEqual(len(starting_inst_list), len(new), 'instance was not created') - rows = instance_types.destroy(self.name) - self.assertEqual(rows, 1) + instance_types.destroy(self.name) self.assertEqual(1, instance_types.get_instance_type(self.name)["deleted"]) self.assertEqual(starting_inst_list, instance_types.get_all_types()) From f2ed4335b4d450f40508f677ce5653fbb90af3f5 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Fri, 11 Feb 2011 15:04:49 -0600 Subject: [PATCH 17/35] Added more columns to instance_types tables --- bin/nova-manage | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index e3c3e70f8..bd2fc0e81 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -614,15 +614,42 @@ class InstanceTypeCommands(object): """Class for managing instance types / flavors.""" def _print_instance_types(self, n, val): - print "%s: %s memory(MB), %s vcpus, %s storage(GB), %s flavorid"\ - % (n, val["memory_mb"], val["vcpus"], - val["local_gb"], val["flavorid"]) + print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, " + "Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB") % ( + n, + val["memory_mb"], + val["vcpus"], + val["local_gb"], + val["flavorid"], + val["swap"], + val["rxtx_quota"], + val["rxtx_cap"]) - def create(self, name, memory, vcpus, local_gb, flavorid): + def create( + self, + name, + memory, + vcpus, + local_gb, + flavorid, + swap, + rxtx_quota, + rxtx_cap): """Creates instance types / flavors - arguments: name memory_mb vcpus local_gb""" + arguments: name memory vcpus local_gb flavorid swap rxtx_quota + rxtx_cap + """ + try: - instance_types.create(name, memory, vcpus, local_gb, flavorid) + instance_types.create( + name, + memory, + vcpus, + local_gb, + flavorid, + swap, + rxtx_quota, + rxtx_cap) except exception.InvalidInputException: print "Must supply valid parameters to create instance type" sys.exit(1) From dcb695ea47a157b9481911dcfc861a9d7d9adfe0 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Fri, 11 Feb 2011 13:53:54 -0800 Subject: [PATCH 18/35] updated tests and added more error checking --- bin/nova-manage | 15 ++++++--------- nova/tests/test_instance_types.py | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index e3c3e70f8..c819af628 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -623,15 +623,16 @@ class InstanceTypeCommands(object): arguments: name memory_mb vcpus local_gb""" try: instance_types.create(name, memory, vcpus, local_gb, flavorid) - except exception.InvalidInputException: + except exception.InvalidInputException, e: print "Must supply valid parameters to create instance type" + print e sys.exit(1) except exception.DBError, e: print "DB Error: %s" % e - sys.exit(1) + sys.exit(2) except: print "Unknown error" - sys.exit(1) + sys.exit(3) else: print "%s created" % name @@ -639,14 +640,10 @@ class InstanceTypeCommands(object): """Marks instance types / flavors as deleted arguments: name""" try: - records = instance_types.destroy(name) - except exception.InvalidParameters: + instance_types.destroy(name) + except exception.ApiError: print "Valid instance type name is required" sys.exit(1) - except exception.NotFound, e: - print "Instance type name %s not found. \ - No instance type deleted." % name - sys.exit(1) else: print "%s deleted" % name diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 36c29d336..68ca3b842 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -62,3 +62,20 @@ class InstanceTypeTestCase(test.TestCase): count() inst_types = instance_types.get_all_types() self.assertEqual(total_instance_types, len(inst_types)) + + def test_invalid_create_args_should_fail(self): + """Ensures that instance type creation fails with invalid args""" + self.assertRaises( + exception.InvalidInputException, + instance_types.create, self.name, 0, 1, 120, self.flavorid) + self.assertRaises( + exception.InvalidInputException, + instance_types.create, self.name, 256, -1, 120, self.flavorid) + self.assertRaises( + exception.InvalidInputException, + instance_types.create, self.name, 256, 1, "aa", self.flavorid) + + def test_non_existant_inst_type_shouldnt_delete(self): + """Ensures that instance type creation fails with invalid args""" + self.assertRaises(exception.ApiError, + instance_types.destroy, "sfsfsdfdfs") From 46d20df4677075eddb3effa5e30db822744c4a06 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Fri, 11 Feb 2011 14:06:33 -0800 Subject: [PATCH 19/35] added instance_type_purge() to actually remove records from db --- nova/tests/test_instance_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 68ca3b842..0d54cc283 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -54,6 +54,7 @@ class InstanceTypeTestCase(test.TestCase): self.assertEqual(1, instance_types.get_instance_type(self.name)["deleted"]) self.assertEqual(starting_inst_list, instance_types.get_all_types()) + db.instance_type_purge(context.get_admin_context(), self.name) def test_get_all_instance_types(self): """Ensures that all instance types can be retrieved""" From 0fd9397cdc265e4082f6c6f29eb34a74159863fb Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Wed, 16 Feb 2011 23:02:24 -0800 Subject: [PATCH 20/35] first crack at instance types docs --- .../adminguide/managing.instance.types.rst | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 doc/source/adminguide/managing.instance.types.rst diff --git a/doc/source/adminguide/managing.instance.types.rst b/doc/source/adminguide/managing.instance.types.rst new file mode 100644 index 000000000..ff4e2b087 --- /dev/null +++ b/doc/source/adminguide/managing.instance.types.rst @@ -0,0 +1,79 @@ + + Copyright 2010-2011 United States Government as represented by the + Administrator of the National Aeronautics and Space Administration. + All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations + under the License. + +Managing Instance Types and Flavors +=================================== + +What are Instance Types or Flavors ? +------------------------------------ + +Instance types are the container descriptions (meta-data) about instances. In layman terms, this is the size of the instance (vCPUs, RAM, etc.) that you will be launching. In the EC2 API, these are called by names such as "m1.large" or "m1.tiny", while the OpenStack API terms these "flavors" with names like "" + +Flavors are simply the name for instance types used in the OpenStack API. In nova, these are equivalent terms, so when you create an instance type you are also creating a flavor. For the rest of this document, I will refer to these as instance types. + +In the current (Cactus) version of nova, instance types can only be created by the nova administrator through the nova-manage command. Future versions of nova (in concert with the OpenStack API or EC2 API), may expose this functionality directly to users. + +Basic Management +---------------- + +Instance types / flavor are managed through the nova-manage binary with +the "instance_type" command and an appropriate subcommand. Note that you can also use +the "flavor" command as a synonym for "instance_types". + +To see all currently active instance types, use the list subcommand:: + + $ nova-manage instance_type list + m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + +By default, the list subcommand only shows active instance types. To see all instance types +(even those deleted), add the argument 1 after the list subcommand like so:: + + $ nova-manage instance_type list 1 + m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.deleted: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + +To create an instance type, use the "create" subcommand with the following positional arguments: + * memory (expressed in megabytes) + * vcpu(s) (integer) + * local storage (expressed in gigabytes) + * flavorid (unique integer) + * swap space (expressed in megabytes, defaults to zero, optional) + * RXTX quotas (expressed in gigabytes, defaults to zero, optional) + * RXTX cap (expressed in gigabytes, defaults to zero, optional) + +The following example creates an instance type named "m1.xxlarge":: + + # nova-manage instance_type create m1.xxlarge 32768 16 320 0 0 0 + m1.xxlarge created + +To delete an instance type, use the "delete" subcommand and specify the name:: + + # nova-manage instance_type delete m1.xxlarge + m1.xxlarge deleted + +Please note that the "delete" command only marks the instance type as +inactive in the database; it does not actually remove the instance type. This is done +to preserve the instance type definition for long running instances (which may not +terminate for months or years). From 51583649bd9ed8ccba21c6c4b4ee3ca9888e1da7 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Thu, 17 Feb 2011 16:07:00 -0800 Subject: [PATCH 21/35] completed doc and added --purge option to instance type delete --- bin/nova-manage | 11 ++++++++--- doc/source/adminguide/managing.instance.types.rst | 10 +++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 21de11474..3318a593e 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -713,16 +713,21 @@ class InstanceTypeCommands(object): else: print "%s created" % name - def delete(self, name): + def delete(self, name, purge=None): """Marks instance types / flavors as deleted arguments: name""" try: - instance_types.destroy(name) + if purge == "--purge": + instance_types.purge(name) + verb = "deleted" + else: + instance_types.destroy(name) + verb = "purged" except exception.ApiError: print "Valid instance type name is required" sys.exit(1) else: - print "%s deleted" % name + print "%s %s" % (name, verb) def list(self, name=None): """Lists all or specific instance types / flavors diff --git a/doc/source/adminguide/managing.instance.types.rst b/doc/source/adminguide/managing.instance.types.rst index ff4e2b087..30a47e47d 100644 --- a/doc/source/adminguide/managing.instance.types.rst +++ b/doc/source/adminguide/managing.instance.types.rst @@ -36,7 +36,7 @@ the "flavor" command as a synonym for "instance_types". To see all currently active instance types, use the list subcommand:: - $ nova-manage instance_type list + # nova-manage instance_type list m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB @@ -46,7 +46,7 @@ To see all currently active instance types, use the list subcommand:: By default, the list subcommand only shows active instance types. To see all instance types (even those deleted), add the argument 1 after the list subcommand like so:: - $ nova-manage instance_type list 1 + # nova-manage instance_type list 1 m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB @@ -76,4 +76,8 @@ To delete an instance type, use the "delete" subcommand and specify the name:: Please note that the "delete" command only marks the instance type as inactive in the database; it does not actually remove the instance type. This is done to preserve the instance type definition for long running instances (which may not -terminate for months or years). +terminate for months or years). If you are sure that you want to delete this instance +type from the database, pass the "--purge" flag after the name:: + + # nova-manage instance_type delete m1.xxlarge --purge + m1.xxlarge deleted From 38c2331cbf606fd7a465e131f9ffc3348d5c2f74 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Fri, 18 Feb 2011 15:59:42 -0800 Subject: [PATCH 22/35] added instance types purge test --- nova/tests/test_instance_types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 0d54cc283..fe052110f 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -49,12 +49,16 @@ class InstanceTypeTestCase(test.TestCase): new = instance_types.get_all_types() self.assertNotEqual(len(starting_inst_list), len(new), - 'instance was not created') + 'instance type was not created') instance_types.destroy(self.name) self.assertEqual(1, instance_types.get_instance_type(self.name)["deleted"]) self.assertEqual(starting_inst_list, instance_types.get_all_types()) db.instance_type_purge(context.get_admin_context(), self.name) + self.assertEqual(len(starting_inst_list), + len(instance_types.get_all_types()), + 'instance type not purged') + def test_get_all_instance_types(self): """Ensures that all instance types can be retrieved""" From 98a74676d8cf5ccb50a69c490a23537faf25bac0 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Fri, 18 Feb 2011 16:00:22 -0800 Subject: [PATCH 23/35] pep8 --- nova/tests/test_instance_types.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index fe052110f..705144cb0 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -59,7 +59,6 @@ class InstanceTypeTestCase(test.TestCase): len(instance_types.get_all_types()), 'instance type not purged') - def test_get_all_instance_types(self): """Ensures that all instance types can be retrieved""" session = get_session() From a610884233aab3c79fe96bb552a90dc0086b9713 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Fri, 18 Feb 2011 17:17:47 -0800 Subject: [PATCH 24/35] added purge option and tightened up testing --- bin/nova-manage | 15 ++++++++++----- nova/tests/test_instance_types.py | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 3318a593e..8ecf626a4 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -683,9 +683,9 @@ class InstanceTypeCommands(object): vcpus, local_gb, flavorid, - swap, - rxtx_quota, - rxtx_cap): + swap=0, + rxtx_quota=0, + rxtx_cap=0): """Creates instance types / flavors arguments: name memory vcpus local_gb flavorid swap rxtx_quota rxtx_cap @@ -719,13 +719,18 @@ class InstanceTypeCommands(object): try: if purge == "--purge": instance_types.purge(name) - verb = "deleted" + verb = "purged" else: instance_types.destroy(name) - verb = "purged" + verb = "deleted" except exception.ApiError: print "Valid instance type name is required" sys.exit(1) + except exception.DBError, e: + print "DB Error: %s" % e + sys.exit(2) + except: + sys.exit(3) else: print "%s %s" % (name, verb) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 705144cb0..1b192ca28 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -54,7 +54,7 @@ class InstanceTypeTestCase(test.TestCase): self.assertEqual(1, instance_types.get_instance_type(self.name)["deleted"]) self.assertEqual(starting_inst_list, instance_types.get_all_types()) - db.instance_type_purge(context.get_admin_context(), self.name) + instance_types.purge(self.name) self.assertEqual(len(starting_inst_list), len(instance_types.get_all_types()), 'instance type not purged') From 309bcba563c7e5bb1ef792268340af5531f20669 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Thu, 24 Feb 2011 13:01:16 -0600 Subject: [PATCH 25/35] Updated email in Authors --- .mailmap | 1 + Authors | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index a839eba6c..d479bfdf2 100644 --- a/.mailmap +++ b/.mailmap @@ -19,6 +19,7 @@ + Masumoto diff --git a/Authors b/Authors index 494e614a0..39241b45c 100644 --- a/Authors +++ b/Authors @@ -31,7 +31,7 @@ John Dewey Jonathan Bryce Jordan Rinke Josh Durgin -Josh Kearney +Josh Kearney Joshua McKenty Justin Santa Barbara Kei Masumoto From 0bc9cb29cbfc4f1da981e436baa1120fa39df4e5 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 28 Feb 2011 11:49:17 -0800 Subject: [PATCH 26/35] moved nova-manage flavors docs --- doc/source/{adminguide => runnova}/managing.instance.types.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/source/{adminguide => runnova}/managing.instance.types.rst (100%) diff --git a/doc/source/adminguide/managing.instance.types.rst b/doc/source/runnova/managing.instance.types.rst similarity index 100% rename from doc/source/adminguide/managing.instance.types.rst rename to doc/source/runnova/managing.instance.types.rst From aa489d433c19c6fb2c319adb4715c4cc87276e26 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 28 Feb 2011 13:16:07 -0800 Subject: [PATCH 27/35] refactored nova-manage list (-all, ) and fixed docs --- bin/nova-manage | 37 +++++++++---------- doc/source/man/novamanage.rst | 35 ++++++++++++++++++ .../runnova/managing.instance.types.rst | 14 ++++++- 3 files changed, 65 insertions(+), 21 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index b977eb94d..0b71da41e 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -666,8 +666,9 @@ class InstanceTypeCommands(object): """Class for managing instance types / flavors.""" def _print_instance_types(self, n, val): + deleted = ('', ', inactive')[val["deleted"] == 1] print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, " - "Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB") % ( + "Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB%s") % ( n, val["memory_mb"], val["vcpus"], @@ -675,7 +676,8 @@ class InstanceTypeCommands(object): val["flavorid"], val["swap"], val["rxtx_quota"], - val["rxtx_cap"]) + val["rxtx_cap"], + deleted) def create( self, @@ -688,8 +690,8 @@ class InstanceTypeCommands(object): rxtx_quota=0, rxtx_cap=0): """Creates instance types / flavors - arguments: name memory vcpus local_gb flavorid swap rxtx_quota - rxtx_cap + arguments: name memory vcpus local_gb flavorid [swap] [rxtx_quota] + [rxtx_cap] """ try: instance_types.create( @@ -736,25 +738,22 @@ class InstanceTypeCommands(object): print "%s %s" % (name, verb) def list(self, name=None): - """Lists all or specific instance types / flavors + """Lists all active or specific instance types / flavors arguments: [name]""" - if name == None: - try: + try: + if name == None: inst_types = instance_types.get_all_types() - except exception.NotFound, e: - print e - sys.exit(1) + elif name == "--all": + inst_types = instance_types.get_all_types(1) else: - for k, v in inst_types.iteritems(): - self._print_instance_types(k, v) - else: - try: inst_types = instance_types.get_instance_type(name) - except exception.NotFound, e: - print e - sys.exit(1) - else: - self._print_instance_types(name, inst_types) + except exception.DBError, e: + _db_error(e) + if isinstance(inst_types.values()[0], dict): + for k, v in inst_types.iteritems(): + self._print_instance_types(k, v) + else: + self._print_instance_types(name, inst_types) CATEGORIES = [ diff --git a/doc/source/man/novamanage.rst b/doc/source/man/novamanage.rst index bb9d7a7fe..94e93129a 100644 --- a/doc/source/man/novamanage.rst +++ b/doc/source/man/novamanage.rst @@ -179,6 +179,41 @@ Nova Floating IPs Displays a list of all floating IP addresses. +Nova Flavor +~~~~~~~~~~~ + +``nova-manage flavor list`` + + Outputs a list of all active flavors to the screen. + +``nova-manage flavor list --all`` + + Outputs a list of all flavors (active and inactive) to the screen. + +``nova-manage flavor create `` + + creates a flavor with the following positional arguments: + * memory (expressed in megabytes) + * vcpu(s) (integer) + * local storage (expressed in gigabytes) + * flavorid (unique integer) + * swap space (expressed in megabytes, defaults to zero, optional) + * RXTX quotas (expressed in gigabytes, defaults to zero, optional) + * RXTX cap (expressed in gigabytes, defaults to zero, optional) + +``nova-manage flavor delete `` + + Delete the flavor with the name . This marks the flavor as inactive and cannot be launched. However, the record stays in the database for archival and billing purposes. + +``nova-manage flavor delete --purge`` + + Purges the flavor with the name . This removes this flavor from the database. + + +Nova Instance_type +~~~~~~~~~~~~~~~~~~ + +Nova instance_type is a alias for FILES ======== diff --git a/doc/source/runnova/managing.instance.types.rst b/doc/source/runnova/managing.instance.types.rst index 30a47e47d..656268f8e 100644 --- a/doc/source/runnova/managing.instance.types.rst +++ b/doc/source/runnova/managing.instance.types.rst @@ -44,9 +44,9 @@ To see all currently active instance types, use the list subcommand:: m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB By default, the list subcommand only shows active instance types. To see all instance types -(even those deleted), add the argument 1 after the list subcommand like so:: +(even those deleted), use the listall subcommand:: - # nova-manage instance_type list 1 + # nova-manage instance_type listall m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB @@ -81,3 +81,13 @@ type from the database, pass the "--purge" flag after the name:: # nova-manage instance_type delete m1.xxlarge --purge m1.xxlarge deleted + +To see all instance types (inactive + active), use the list subcommand with the "--all" flag:: + + # nova-manage instance_type list --all + m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + From 4f294a6ba3c53671910c1b8148b8b30c0408b66d Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 28 Feb 2011 16:28:46 -0800 Subject: [PATCH 28/35] replaced ugly INSTANCE_TYPE constant with (slightly less ugly) stubs --- nova/test.py | 8 -------- nova/tests/test_xenapi.py | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/nova/test.py b/nova/test.py index 0329383b8..d8a47464f 100644 --- a/nova/test.py +++ b/nova/test.py @@ -48,14 +48,6 @@ flags.DEFINE_bool('fake_tests', True, 'should we use everything for testing') -INSTANCE_TYPES = { - 'm1.tiny': dict(memory_mb=512, vcpus=1, local_gb=0, flavorid=1), - 'm1.small': dict(memory_mb=2048, vcpus=1, local_gb=20, flavorid=2), - 'm1.medium': dict(memory_mb=4096, vcpus=2, local_gb=40, flavorid=3), - 'm1.large': dict(memory_mb=8192, vcpus=4, local_gb=80, flavorid=4), - 'm1.xlarge': dict(memory_mb=16384, vcpus=8, local_gb=160, flavorid=5)} - - def skip_if_fake(func): """Decorator that skips a test if running in fake mode""" def _skipper(*args, **kw): diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 27131c45e..106c0bd6f 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -233,7 +233,7 @@ class XenAPIVMTestCase(test.TestCase): vm = vms[0] # Check that m1.large above turned into the right thing. - instance_type = test.INSTANCE_TYPES['m1.large'] + instance_type = db.instance_type_get_by_name(conn, 'm1.large') mem_kib = long(instance_type['memory_mb']) << 10 mem_bytes = str(mem_kib << 10) vcpus = instance_type['vcpus'] From 8e85839285fd9d13b88eae0f6010110e9dcef7f8 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 28 Feb 2011 18:32:55 -0800 Subject: [PATCH 29/35] updated docs --- doc/source/api/autoindex.rst | 6 ++++ doc/source/man/novamanage.rst | 5 ++-- doc/source/nova.concepts.rst | 5 ++++ .../runnova/managing.instance.types.rst | 29 +++++++------------ 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/doc/source/api/autoindex.rst b/doc/source/api/autoindex.rst index 41fc1f4a9..329a465db 100644 --- a/doc/source/api/autoindex.rst +++ b/doc/source/api/autoindex.rst @@ -43,6 +43,9 @@ nova..db.sqlalchemy.migrate_repo.versions.002_bexar.rst nova..db.sqlalchemy.migrate_repo.versions.003_add_label_to_networks.rst nova..db.sqlalchemy.migrate_repo.versions.004_add_zone_tables.rst + nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst + nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst + nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst nova..db.sqlalchemy.migration.rst nova..db.sqlalchemy.models.rst nova..db.sqlalchemy.session.rst @@ -101,6 +104,7 @@ nova..tests.test_console.rst nova..tests.test_direct.rst nova..tests.test_flags.rst + nova..tests.test_instance_types.rst nova..tests.test_localization.rst nova..tests.test_log.rst nova..tests.test_middleware.rst @@ -110,7 +114,9 @@ nova..tests.test_rpc.rst nova..tests.test_scheduler.rst nova..tests.test_service.rst + nova..tests.test_test.rst nova..tests.test_twistd.rst + nova..tests.test_utils.rst nova..tests.test_virt.rst nova..tests.test_volume.rst nova..tests.test_xenapi.rst diff --git a/doc/source/man/novamanage.rst b/doc/source/man/novamanage.rst index 94e93129a..17ba91bef 100644 --- a/doc/source/man/novamanage.rst +++ b/doc/source/man/novamanage.rst @@ -190,7 +190,7 @@ Nova Flavor Outputs a list of all flavors (active and inactive) to the screen. -``nova-manage flavor create `` +``nova-manage flavor create <(optional) swap> <(optional) RXTX Quota> <(optional) RXTX Cap>`` creates a flavor with the following positional arguments: * memory (expressed in megabytes) @@ -213,7 +213,8 @@ Nova Flavor Nova Instance_type ~~~~~~~~~~~~~~~~~~ -Nova instance_type is a alias for +The instance_type command is provided as an alias for the flavor command. All the same subcommands and arguments from nova-manage flavor can be used. + FILES ======== diff --git a/doc/source/nova.concepts.rst b/doc/source/nova.concepts.rst index e9687dc98..45cc4b879 100644 --- a/doc/source/nova.concepts.rst +++ b/doc/source/nova.concepts.rst @@ -64,6 +64,11 @@ Concept: Instances An 'instance' is a word for a virtual machine that runs inside the cloud. +Concept: Instance Type +---------------------- + +An 'instance type' describes the compute, memory and storage capacity of nova computing instances. In layman terms, this is the size (in terms of vCPUs, RAM, etc.) of the virtual server that you will be launching. + Concept: System Architecture ---------------------------- diff --git a/doc/source/runnova/managing.instance.types.rst b/doc/source/runnova/managing.instance.types.rst index 656268f8e..37bb2e99e 100644 --- a/doc/source/runnova/managing.instance.types.rst +++ b/doc/source/runnova/managing.instance.types.rst @@ -1,4 +1,4 @@ - +.. Copyright 2010-2011 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. @@ -21,9 +21,13 @@ Managing Instance Types and Flavors What are Instance Types or Flavors ? ------------------------------------ -Instance types are the container descriptions (meta-data) about instances. In layman terms, this is the size of the instance (vCPUs, RAM, etc.) that you will be launching. In the EC2 API, these are called by names such as "m1.large" or "m1.tiny", while the OpenStack API terms these "flavors" with names like "" +Instance types describe the compute, memory and storage capacity of nova computing instances. In layman terms, this is the size (in terms of vCPUs, RAM, etc.) of the virtual server that you will be launching. In the EC2 API, these are called by names such as "m1.large" or "m1.tiny", while the OpenStack API terms these "flavors" with names like "512 MB Server". -Flavors are simply the name for instance types used in the OpenStack API. In nova, these are equivalent terms, so when you create an instance type you are also creating a flavor. For the rest of this document, I will refer to these as instance types. +In Nova, "flavor" and "instance type" are equivalent terms. When you create an EC2 instance type, you are also creating a OpenStack API flavor. To reduce repetition, for the rest of this document I will refer to these as instance types. + +Instance types can be in either the active or inactive state: + * Active instance types are available to be used for launching instances + * Inactive instance types are not available for launching instances In the current (Cactus) version of nova, instance types can only be created by the nova administrator through the nova-manage command. Future versions of nova (in concert with the OpenStack API or EC2 API), may expose this functionality directly to users. @@ -43,16 +47,15 @@ To see all currently active instance types, use the list subcommand:: m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB -By default, the list subcommand only shows active instance types. To see all instance types -(even those deleted), use the listall subcommand:: +By default, the list subcommand only shows active instance types. To see all instance types (inactive and active), use the list subcommand with the "--all" flag:: - # nova-manage instance_type listall + # nova-manage instance_type list --all m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - m1.deleted: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB + m1.deleted: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB, inactive To create an instance type, use the "create" subcommand with the following positional arguments: * memory (expressed in megabytes) @@ -80,14 +83,4 @@ terminate for months or years). If you are sure that you want to delete this ins type from the database, pass the "--purge" flag after the name:: # nova-manage instance_type delete m1.xxlarge --purge - m1.xxlarge deleted - -To see all instance types (inactive + active), use the list subcommand with the "--all" flag:: - - # nova-manage instance_type list --all - m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB - + m1.xxlarge purged From 8988534cf2e98ed619d353a622248a9cf3195e67 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Mon, 28 Feb 2011 18:33:33 -0800 Subject: [PATCH 30/35] updated docs --- doc/.autogenerated | 276 +-------------------------------------------- 1 file changed, 6 insertions(+), 270 deletions(-) diff --git a/doc/.autogenerated b/doc/.autogenerated index e4c98ec9b..b11735994 100644 --- a/doc/.autogenerated +++ b/doc/.autogenerated @@ -40,6 +40,9 @@ source/api/nova..db.sqlalchemy.migrate_repo.versions.001_austin.rst source/api/nova..db.sqlalchemy.migrate_repo.versions.002_bexar.rst source/api/nova..db.sqlalchemy.migrate_repo.versions.003_add_label_to_networks.rst source/api/nova..db.sqlalchemy.migrate_repo.versions.004_add_zone_tables.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst source/api/nova..db.sqlalchemy.migration.rst source/api/nova..db.sqlalchemy.models.rst source/api/nova..db.sqlalchemy.session.rst @@ -98,6 +101,7 @@ source/api/nova..tests.test_compute.rst source/api/nova..tests.test_console.rst source/api/nova..tests.test_direct.rst source/api/nova..tests.test_flags.rst +source/api/nova..tests.test_instance_types.rst source/api/nova..tests.test_localization.rst source/api/nova..tests.test_log.rst source/api/nova..tests.test_middleware.rst @@ -107,7 +111,9 @@ source/api/nova..tests.test_quota.rst source/api/nova..tests.test_rpc.rst source/api/nova..tests.test_scheduler.rst source/api/nova..tests.test_service.rst +source/api/nova..tests.test_test.rst source/api/nova..tests.test_twistd.rst +source/api/nova..tests.test_utils.rst source/api/nova..tests.test_virt.rst source/api/nova..tests.test_volume.rst source/api/nova..tests.test_xenapi.rst @@ -134,273 +140,3 @@ source/api/nova..volume.manager.rst source/api/nova..volume.san.rst source/api/nova..wsgi.rst source/api/autoindex.rst -source/api/nova..adminclient.rst -source/api/nova..api.direct.rst -source/api/nova..api.ec2.admin.rst -source/api/nova..api.ec2.apirequest.rst -source/api/nova..api.ec2.cloud.rst -source/api/nova..api.ec2.metadatarequesthandler.rst -source/api/nova..api.openstack.auth.rst -source/api/nova..api.openstack.backup_schedules.rst -source/api/nova..api.openstack.common.rst -source/api/nova..api.openstack.consoles.rst -source/api/nova..api.openstack.faults.rst -source/api/nova..api.openstack.flavors.rst -source/api/nova..api.openstack.images.rst -source/api/nova..api.openstack.servers.rst -source/api/nova..api.openstack.shared_ip_groups.rst -source/api/nova..api.openstack.zones.rst -source/api/nova..auth.dbdriver.rst -source/api/nova..auth.fakeldap.rst -source/api/nova..auth.ldapdriver.rst -source/api/nova..auth.manager.rst -source/api/nova..auth.signer.rst -source/api/nova..cloudpipe.pipelib.rst -source/api/nova..compute.api.rst -source/api/nova..compute.instance_types.rst -source/api/nova..compute.manager.rst -source/api/nova..compute.monitor.rst -source/api/nova..compute.power_state.rst -source/api/nova..console.api.rst -source/api/nova..console.fake.rst -source/api/nova..console.manager.rst -source/api/nova..console.xvp.rst -source/api/nova..context.rst -source/api/nova..crypto.rst -source/api/nova..db.api.rst -source/api/nova..db.base.rst -source/api/nova..db.migration.rst -source/api/nova..db.sqlalchemy.api.rst -source/api/nova..db.sqlalchemy.migrate_repo.manage.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.001_austin.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.002_bexar.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.003_add_label_to_networks.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.004_add_zone_tables.rst -source/api/nova..db.sqlalchemy.migration.rst -source/api/nova..db.sqlalchemy.models.rst -source/api/nova..db.sqlalchemy.session.rst -source/api/nova..exception.rst -source/api/nova..fakememcache.rst -source/api/nova..fakerabbit.rst -source/api/nova..flags.rst -source/api/nova..image.glance.rst -source/api/nova..image.local.rst -source/api/nova..image.s3.rst -source/api/nova..image.service.rst -source/api/nova..log.rst -source/api/nova..manager.rst -source/api/nova..network.api.rst -source/api/nova..network.linux_net.rst -source/api/nova..network.manager.rst -source/api/nova..objectstore.bucket.rst -source/api/nova..objectstore.handler.rst -source/api/nova..objectstore.image.rst -source/api/nova..objectstore.stored.rst -source/api/nova..quota.rst -source/api/nova..rpc.rst -source/api/nova..scheduler.chance.rst -source/api/nova..scheduler.driver.rst -source/api/nova..scheduler.manager.rst -source/api/nova..scheduler.simple.rst -source/api/nova..scheduler.zone.rst -source/api/nova..service.rst -source/api/nova..test.rst -source/api/nova..tests.api.openstack.fakes.rst -source/api/nova..tests.api.openstack.test_adminapi.rst -source/api/nova..tests.api.openstack.test_api.rst -source/api/nova..tests.api.openstack.test_auth.rst -source/api/nova..tests.api.openstack.test_common.rst -source/api/nova..tests.api.openstack.test_faults.rst -source/api/nova..tests.api.openstack.test_flavors.rst -source/api/nova..tests.api.openstack.test_images.rst -source/api/nova..tests.api.openstack.test_ratelimiting.rst -source/api/nova..tests.api.openstack.test_servers.rst -source/api/nova..tests.api.openstack.test_shared_ip_groups.rst -source/api/nova..tests.api.openstack.test_zones.rst -source/api/nova..tests.api.test_wsgi.rst -source/api/nova..tests.db.fakes.rst -source/api/nova..tests.declare_flags.rst -source/api/nova..tests.fake_flags.rst -source/api/nova..tests.glance.stubs.rst -source/api/nova..tests.hyperv_unittest.rst -source/api/nova..tests.objectstore_unittest.rst -source/api/nova..tests.real_flags.rst -source/api/nova..tests.runtime_flags.rst -source/api/nova..tests.test_access.rst -source/api/nova..tests.test_api.rst -source/api/nova..tests.test_auth.rst -source/api/nova..tests.test_cloud.rst -source/api/nova..tests.test_compute.rst -source/api/nova..tests.test_console.rst -source/api/nova..tests.test_direct.rst -source/api/nova..tests.test_flags.rst -source/api/nova..tests.test_localization.rst -source/api/nova..tests.test_log.rst -source/api/nova..tests.test_middleware.rst -source/api/nova..tests.test_misc.rst -source/api/nova..tests.test_network.rst -source/api/nova..tests.test_quota.rst -source/api/nova..tests.test_rpc.rst -source/api/nova..tests.test_scheduler.rst -source/api/nova..tests.test_service.rst -source/api/nova..tests.test_twistd.rst -source/api/nova..tests.test_virt.rst -source/api/nova..tests.test_volume.rst -source/api/nova..tests.test_xenapi.rst -source/api/nova..tests.xenapi.stubs.rst -source/api/nova..twistd.rst -source/api/nova..utils.rst -source/api/nova..version.rst -source/api/nova..virt.connection.rst -source/api/nova..virt.disk.rst -source/api/nova..virt.fake.rst -source/api/nova..virt.hyperv.rst -source/api/nova..virt.images.rst -source/api/nova..virt.libvirt_conn.rst -source/api/nova..virt.xenapi.fake.rst -source/api/nova..virt.xenapi.network_utils.rst -source/api/nova..virt.xenapi.vm_utils.rst -source/api/nova..virt.xenapi.vmops.rst -source/api/nova..virt.xenapi.volume_utils.rst -source/api/nova..virt.xenapi.volumeops.rst -source/api/nova..virt.xenapi_conn.rst -source/api/nova..volume.api.rst -source/api/nova..volume.driver.rst -source/api/nova..volume.manager.rst -source/api/nova..volume.san.rst -source/api/nova..wsgi.rst -source/api/nova..adminclient.rst -source/api/nova..api.direct.rst -source/api/nova..api.ec2.admin.rst -source/api/nova..api.ec2.apirequest.rst -source/api/nova..api.ec2.cloud.rst -source/api/nova..api.ec2.metadatarequesthandler.rst -source/api/nova..api.openstack.auth.rst -source/api/nova..api.openstack.backup_schedules.rst -source/api/nova..api.openstack.common.rst -source/api/nova..api.openstack.consoles.rst -source/api/nova..api.openstack.faults.rst -source/api/nova..api.openstack.flavors.rst -source/api/nova..api.openstack.images.rst -source/api/nova..api.openstack.servers.rst -source/api/nova..api.openstack.shared_ip_groups.rst -source/api/nova..api.openstack.zones.rst -source/api/nova..auth.dbdriver.rst -source/api/nova..auth.fakeldap.rst -source/api/nova..auth.ldapdriver.rst -source/api/nova..auth.manager.rst -source/api/nova..auth.signer.rst -source/api/nova..cloudpipe.pipelib.rst -source/api/nova..compute.api.rst -source/api/nova..compute.instance_types.rst -source/api/nova..compute.manager.rst -source/api/nova..compute.monitor.rst -source/api/nova..compute.power_state.rst -source/api/nova..console.api.rst -source/api/nova..console.fake.rst -source/api/nova..console.manager.rst -source/api/nova..console.xvp.rst -source/api/nova..context.rst -source/api/nova..crypto.rst -source/api/nova..db.api.rst -source/api/nova..db.base.rst -source/api/nova..db.migration.rst -source/api/nova..db.sqlalchemy.api.rst -source/api/nova..db.sqlalchemy.migrate_repo.manage.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.001_austin.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.002_bexar.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.003_add_label_to_networks.rst -source/api/nova..db.sqlalchemy.migrate_repo.versions.004_add_zone_tables.rst -source/api/nova..db.sqlalchemy.migration.rst -source/api/nova..db.sqlalchemy.models.rst -source/api/nova..db.sqlalchemy.session.rst -source/api/nova..exception.rst -source/api/nova..fakememcache.rst -source/api/nova..fakerabbit.rst -source/api/nova..flags.rst -source/api/nova..image.glance.rst -source/api/nova..image.local.rst -source/api/nova..image.s3.rst -source/api/nova..image.service.rst -source/api/nova..log.rst -source/api/nova..manager.rst -source/api/nova..network.api.rst -source/api/nova..network.linux_net.rst -source/api/nova..network.manager.rst -source/api/nova..objectstore.bucket.rst -source/api/nova..objectstore.handler.rst -source/api/nova..objectstore.image.rst -source/api/nova..objectstore.stored.rst -source/api/nova..quota.rst -source/api/nova..rpc.rst -source/api/nova..scheduler.chance.rst -source/api/nova..scheduler.driver.rst -source/api/nova..scheduler.manager.rst -source/api/nova..scheduler.simple.rst -source/api/nova..scheduler.zone.rst -source/api/nova..service.rst -source/api/nova..test.rst -source/api/nova..tests.api.openstack.fakes.rst -source/api/nova..tests.api.openstack.test_adminapi.rst -source/api/nova..tests.api.openstack.test_api.rst -source/api/nova..tests.api.openstack.test_auth.rst -source/api/nova..tests.api.openstack.test_common.rst -source/api/nova..tests.api.openstack.test_faults.rst -source/api/nova..tests.api.openstack.test_flavors.rst -source/api/nova..tests.api.openstack.test_images.rst -source/api/nova..tests.api.openstack.test_ratelimiting.rst -source/api/nova..tests.api.openstack.test_servers.rst -source/api/nova..tests.api.openstack.test_shared_ip_groups.rst -source/api/nova..tests.api.openstack.test_zones.rst -source/api/nova..tests.api.test_wsgi.rst -source/api/nova..tests.db.fakes.rst -source/api/nova..tests.declare_flags.rst -source/api/nova..tests.fake_flags.rst -source/api/nova..tests.glance.stubs.rst -source/api/nova..tests.hyperv_unittest.rst -source/api/nova..tests.objectstore_unittest.rst -source/api/nova..tests.real_flags.rst -source/api/nova..tests.runtime_flags.rst -source/api/nova..tests.test_access.rst -source/api/nova..tests.test_api.rst -source/api/nova..tests.test_auth.rst -source/api/nova..tests.test_cloud.rst -source/api/nova..tests.test_compute.rst -source/api/nova..tests.test_console.rst -source/api/nova..tests.test_direct.rst -source/api/nova..tests.test_flags.rst -source/api/nova..tests.test_localization.rst -source/api/nova..tests.test_log.rst -source/api/nova..tests.test_middleware.rst -source/api/nova..tests.test_misc.rst -source/api/nova..tests.test_network.rst -source/api/nova..tests.test_quota.rst -source/api/nova..tests.test_rpc.rst -source/api/nova..tests.test_scheduler.rst -source/api/nova..tests.test_service.rst -source/api/nova..tests.test_twistd.rst -source/api/nova..tests.test_virt.rst -source/api/nova..tests.test_volume.rst -source/api/nova..tests.test_xenapi.rst -source/api/nova..tests.xenapi.stubs.rst -source/api/nova..twistd.rst -source/api/nova..utils.rst -source/api/nova..version.rst -source/api/nova..virt.connection.rst -source/api/nova..virt.disk.rst -source/api/nova..virt.fake.rst -source/api/nova..virt.hyperv.rst -source/api/nova..virt.images.rst -source/api/nova..virt.libvirt_conn.rst -source/api/nova..virt.xenapi.fake.rst -source/api/nova..virt.xenapi.network_utils.rst -source/api/nova..virt.xenapi.vm_utils.rst -source/api/nova..virt.xenapi.vmops.rst -source/api/nova..virt.xenapi.volume_utils.rst -source/api/nova..virt.xenapi.volumeops.rst -source/api/nova..virt.xenapi_conn.rst -source/api/nova..volume.api.rst -source/api/nova..volume.driver.rst -source/api/nova..volume.manager.rst -source/api/nova..volume.san.rst -source/api/nova..wsgi.rst From 5c767791415ac81948e0ab149a32732837b38652 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Tue, 1 Mar 2011 10:40:56 -0800 Subject: [PATCH 31/35] corrected copyrights for new files --- doc/source/runnova/managing.instance.types.rst | 4 +--- nova/tests/test_instance_types.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/source/runnova/managing.instance.types.rst b/doc/source/runnova/managing.instance.types.rst index 37bb2e99e..746077716 100644 --- a/doc/source/runnova/managing.instance.types.rst +++ b/doc/source/runnova/managing.instance.types.rst @@ -1,7 +1,5 @@ .. - Copyright 2010-2011 United States Government as represented by the - Administrator of the National Aeronautics and Space Administration. - All Rights Reserved. + Copyright 2011 Ken Pepple Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 1b192ca28..edc538879 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -1,5 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2011 Ken Pepple # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at From 03a92984e42044ab13a114dad5851a222692f67b Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Wed, 2 Mar 2011 16:07:05 -0800 Subject: [PATCH 33/35] fixed coding style per devcamcar review notes --- bin/nova-manage | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 0b71da41e..15bbe2f45 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -669,40 +669,19 @@ class InstanceTypeCommands(object): deleted = ('', ', inactive')[val["deleted"] == 1] print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, " "Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB%s") % ( - n, - val["memory_mb"], - val["vcpus"], - val["local_gb"], - val["flavorid"], - val["swap"], - val["rxtx_quota"], - val["rxtx_cap"], - deleted) + n, val["memory_mb"], val["vcpus"], val["local_gb"], + val["flavorid"], val["swap"], val["rxtx_quota"], + val["rxtx_cap"], deleted) - def create( - self, - name, - memory, - vcpus, - local_gb, - flavorid, - swap=0, - rxtx_quota=0, - rxtx_cap=0): + def create(self, name, memory, vcpus, local_gb, flavorid, + swap=0, rxtx_quota=0, rxtx_cap=0): """Creates instance types / flavors arguments: name memory vcpus local_gb flavorid [swap] [rxtx_quota] [rxtx_cap] """ try: - instance_types.create( - name, - memory, - vcpus, - local_gb, - flavorid, - swap, - rxtx_quota, - rxtx_cap) + instance_types.create(name, memory, vcpus, local_gb, + flavorid, swap, rxtx_quota, rxtx_cap) except exception.InvalidInputException: print "Must supply valid parameters to create instance type" print e From 462496d57e834cb6ca2b4cbfd391cbebe0589424 Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Wed, 2 Mar 2011 16:35:53 -0800 Subject: [PATCH 34/35] pep8 --- bin/nova-manage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nova-manage b/bin/nova-manage index 15bbe2f45..9bf3a1bb3 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -673,7 +673,7 @@ class InstanceTypeCommands(object): val["flavorid"], val["swap"], val["rxtx_quota"], val["rxtx_cap"], deleted) - def create(self, name, memory, vcpus, local_gb, flavorid, + def create(self, name, memory, vcpus, local_gb, flavorid, swap=0, rxtx_quota=0, rxtx_cap=0): """Creates instance types / flavors arguments: name memory vcpus local_gb flavorid [swap] [rxtx_quota] From a5aa532aae1bda2f143862c20d7b54b212a6c71b Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Wed, 2 Mar 2011 16:57:56 -0800 Subject: [PATCH 35/35] adding new source docs --- doc/.autogenerated | 141 ++++++++++++++++++ ...epo.versions.005_add_instance_metadata.rst | 6 + ...sions.006_add_provider_data_to_volumes.rst | 6 + ...e_repo.versions.007_add_instance_types.rst | 6 + .../api/nova..tests.test_instance_types.rst | 6 + doc/source/api/nova..tests.test_test.rst | 6 + doc/source/api/nova..tests.test_utils.rst | 6 + 7 files changed, 177 insertions(+) create mode 100644 doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst create mode 100644 doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst create mode 100644 doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst create mode 100644 doc/source/api/nova..tests.test_instance_types.rst create mode 100644 doc/source/api/nova..tests.test_test.rst create mode 100644 doc/source/api/nova..tests.test_utils.rst diff --git a/doc/.autogenerated b/doc/.autogenerated index b11735994..456c8ad1e 100644 --- a/doc/.autogenerated +++ b/doc/.autogenerated @@ -140,3 +140,144 @@ source/api/nova..volume.manager.rst source/api/nova..volume.san.rst source/api/nova..wsgi.rst source/api/autoindex.rst +source/api/nova..adminclient.rst +source/api/nova..api.direct.rst +source/api/nova..api.ec2.admin.rst +source/api/nova..api.ec2.apirequest.rst +source/api/nova..api.ec2.cloud.rst +source/api/nova..api.ec2.metadatarequesthandler.rst +source/api/nova..api.openstack.auth.rst +source/api/nova..api.openstack.backup_schedules.rst +source/api/nova..api.openstack.common.rst +source/api/nova..api.openstack.consoles.rst +source/api/nova..api.openstack.faults.rst +source/api/nova..api.openstack.flavors.rst +source/api/nova..api.openstack.images.rst +source/api/nova..api.openstack.servers.rst +source/api/nova..api.openstack.shared_ip_groups.rst +source/api/nova..api.openstack.zones.rst +source/api/nova..auth.dbdriver.rst +source/api/nova..auth.fakeldap.rst +source/api/nova..auth.ldapdriver.rst +source/api/nova..auth.manager.rst +source/api/nova..auth.signer.rst +source/api/nova..cloudpipe.pipelib.rst +source/api/nova..compute.api.rst +source/api/nova..compute.instance_types.rst +source/api/nova..compute.manager.rst +source/api/nova..compute.monitor.rst +source/api/nova..compute.power_state.rst +source/api/nova..console.api.rst +source/api/nova..console.fake.rst +source/api/nova..console.manager.rst +source/api/nova..console.xvp.rst +source/api/nova..context.rst +source/api/nova..crypto.rst +source/api/nova..db.api.rst +source/api/nova..db.base.rst +source/api/nova..db.migration.rst +source/api/nova..db.sqlalchemy.api.rst +source/api/nova..db.sqlalchemy.migrate_repo.manage.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.001_austin.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.002_bexar.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.003_add_label_to_networks.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.004_add_zone_tables.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst +source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst +source/api/nova..db.sqlalchemy.migration.rst +source/api/nova..db.sqlalchemy.models.rst +source/api/nova..db.sqlalchemy.session.rst +source/api/nova..exception.rst +source/api/nova..fakememcache.rst +source/api/nova..fakerabbit.rst +source/api/nova..flags.rst +source/api/nova..image.glance.rst +source/api/nova..image.local.rst +source/api/nova..image.s3.rst +source/api/nova..image.service.rst +source/api/nova..log.rst +source/api/nova..manager.rst +source/api/nova..network.api.rst +source/api/nova..network.linux_net.rst +source/api/nova..network.manager.rst +source/api/nova..objectstore.bucket.rst +source/api/nova..objectstore.handler.rst +source/api/nova..objectstore.image.rst +source/api/nova..objectstore.stored.rst +source/api/nova..quota.rst +source/api/nova..rpc.rst +source/api/nova..scheduler.chance.rst +source/api/nova..scheduler.driver.rst +source/api/nova..scheduler.manager.rst +source/api/nova..scheduler.simple.rst +source/api/nova..scheduler.zone.rst +source/api/nova..service.rst +source/api/nova..test.rst +source/api/nova..tests.api.openstack.fakes.rst +source/api/nova..tests.api.openstack.test_adminapi.rst +source/api/nova..tests.api.openstack.test_api.rst +source/api/nova..tests.api.openstack.test_auth.rst +source/api/nova..tests.api.openstack.test_common.rst +source/api/nova..tests.api.openstack.test_faults.rst +source/api/nova..tests.api.openstack.test_flavors.rst +source/api/nova..tests.api.openstack.test_images.rst +source/api/nova..tests.api.openstack.test_ratelimiting.rst +source/api/nova..tests.api.openstack.test_servers.rst +source/api/nova..tests.api.openstack.test_shared_ip_groups.rst +source/api/nova..tests.api.openstack.test_zones.rst +source/api/nova..tests.api.test_wsgi.rst +source/api/nova..tests.db.fakes.rst +source/api/nova..tests.declare_flags.rst +source/api/nova..tests.fake_flags.rst +source/api/nova..tests.glance.stubs.rst +source/api/nova..tests.hyperv_unittest.rst +source/api/nova..tests.objectstore_unittest.rst +source/api/nova..tests.real_flags.rst +source/api/nova..tests.runtime_flags.rst +source/api/nova..tests.test_access.rst +source/api/nova..tests.test_api.rst +source/api/nova..tests.test_auth.rst +source/api/nova..tests.test_cloud.rst +source/api/nova..tests.test_compute.rst +source/api/nova..tests.test_console.rst +source/api/nova..tests.test_direct.rst +source/api/nova..tests.test_flags.rst +source/api/nova..tests.test_instance_types.rst +source/api/nova..tests.test_localization.rst +source/api/nova..tests.test_log.rst +source/api/nova..tests.test_middleware.rst +source/api/nova..tests.test_misc.rst +source/api/nova..tests.test_network.rst +source/api/nova..tests.test_quota.rst +source/api/nova..tests.test_rpc.rst +source/api/nova..tests.test_scheduler.rst +source/api/nova..tests.test_service.rst +source/api/nova..tests.test_test.rst +source/api/nova..tests.test_twistd.rst +source/api/nova..tests.test_utils.rst +source/api/nova..tests.test_virt.rst +source/api/nova..tests.test_volume.rst +source/api/nova..tests.test_xenapi.rst +source/api/nova..tests.xenapi.stubs.rst +source/api/nova..twistd.rst +source/api/nova..utils.rst +source/api/nova..version.rst +source/api/nova..virt.connection.rst +source/api/nova..virt.disk.rst +source/api/nova..virt.fake.rst +source/api/nova..virt.hyperv.rst +source/api/nova..virt.images.rst +source/api/nova..virt.libvirt_conn.rst +source/api/nova..virt.xenapi.fake.rst +source/api/nova..virt.xenapi.network_utils.rst +source/api/nova..virt.xenapi.vm_utils.rst +source/api/nova..virt.xenapi.vmops.rst +source/api/nova..virt.xenapi.volume_utils.rst +source/api/nova..virt.xenapi.volumeops.rst +source/api/nova..virt.xenapi_conn.rst +source/api/nova..volume.api.rst +source/api/nova..volume.driver.rst +source/api/nova..volume.manager.rst +source/api/nova..volume.san.rst +source/api/nova..wsgi.rst diff --git a/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst new file mode 100644 index 000000000..cef0c243e --- /dev/null +++ b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata.rst @@ -0,0 +1,6 @@ +The :mod:`nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata` Module +============================================================================== +.. automodule:: nova..db.sqlalchemy.migrate_repo.versions.005_add_instance_metadata + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst new file mode 100644 index 000000000..a15697196 --- /dev/null +++ b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes.rst @@ -0,0 +1,6 @@ +The :mod:`nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes` Module +============================================================================== +.. automodule:: nova..db.sqlalchemy.migrate_repo.versions.006_add_provider_data_to_volumes + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst new file mode 100644 index 000000000..38842d1af --- /dev/null +++ b/doc/source/api/nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types.rst @@ -0,0 +1,6 @@ +The :mod:`nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types` Module +============================================================================== +.. automodule:: nova..db.sqlalchemy.migrate_repo.versions.007_add_instance_types + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/nova..tests.test_instance_types.rst b/doc/source/api/nova..tests.test_instance_types.rst new file mode 100644 index 000000000..ebe689966 --- /dev/null +++ b/doc/source/api/nova..tests.test_instance_types.rst @@ -0,0 +1,6 @@ +The :mod:`nova..tests.test_instance_types` Module +============================================================================== +.. automodule:: nova..tests.test_instance_types + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/nova..tests.test_test.rst b/doc/source/api/nova..tests.test_test.rst new file mode 100644 index 000000000..389eb3c99 --- /dev/null +++ b/doc/source/api/nova..tests.test_test.rst @@ -0,0 +1,6 @@ +The :mod:`nova..tests.test_test` Module +============================================================================== +.. automodule:: nova..tests.test_test + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/nova..tests.test_utils.rst b/doc/source/api/nova..tests.test_utils.rst new file mode 100644 index 000000000..d61a7021f --- /dev/null +++ b/doc/source/api/nova..tests.test_utils.rst @@ -0,0 +1,6 @@ +The :mod:`nova..tests.test_utils` Module +============================================================================== +.. automodule:: nova..tests.test_utils + :members: + :undoc-members: + :show-inheritance: