In-house patch to update the default flavors for use with Solaris.
This patch has not yet been submitted upstream.
--- nova-7e41c2cbb243b444bf275c46ea21169bbc08b2da/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py.~1~ 2016-01-05 16:04:30.000000000 -0800
+++ nova-7e41c2cbb243b444bf275c46ea21169bbc08b2da/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py 2016-01-27 03:24:35.303852343 -0800
@@ -85,17 +85,45 @@ def _create_shadow_tables(migrate_engine
raise
-def _populate_instance_types(instance_types_table):
+def _populate_instance_types(instance_types_table, instance_type_extra_specs):
default_inst_types = {
- 'm1.tiny': dict(mem=512, vcpus=1, root_gb=1, eph_gb=0, flavid=1),
- 'm1.small': dict(mem=2048, vcpus=1, root_gb=20, eph_gb=0, flavid=2),
- 'm1.medium': dict(mem=4096, vcpus=2, root_gb=40, eph_gb=0, flavid=3),
- 'm1.large': dict(mem=8192, vcpus=4, root_gb=80, eph_gb=0, flavid=4),
- 'm1.xlarge': dict(mem=16384, vcpus=8, root_gb=160, eph_gb=0, flavid=5)
+ 'Oracle Solaris kernel zone - tiny': dict(
+ mem=2048, vcpus=1, root_gb=20, eph_gb=0, flavid=1,
+ extra='solaris-kz'),
+ 'Oracle Solaris kernel zone - small': dict(
+ mem=4096, vcpus=4, root_gb=40, eph_gb=0, flavid=2,
+ extra='solaris-kz'),
+ 'Oracle Solaris kernel zone - medium': dict(
+ mem=8192, vcpus=8, root_gb=80, eph_gb=0, flavid=3,
+ extra='solaris-kz'),
+ 'Oracle Solaris kernel zone - large': dict(
+ mem=16384, vcpus=16, root_gb=160, eph_gb=0, flavid=4,
+ extra='solaris-kz'),
+ 'Oracle Solaris kernel zone - xlarge': dict(
+ mem=32768, vcpus=32, root_gb=320, eph_gb=0, flavid=5,
+ extra='solaris-kz'),
+
+ 'Oracle Solaris non-global zone - tiny': dict(
+ mem=1024, vcpus=1, root_gb=20, eph_gb=0, flavid=6,
+ extra='solaris'),
+ 'Oracle Solaris non-global zone - small': dict(
+ mem=2048, vcpus=4, root_gb=40, eph_gb=0, flavid=7,
+ extra='solaris'),
+ 'Oracle Solaris non-global zone - medium': dict(
+ mem=4096, vcpus=8, root_gb=80, eph_gb=0, flavid=8,
+ extra='solaris'),
+ 'Oracle Solaris non-global zone - large': dict(
+ mem=8192, vcpus=16, root_gb=160, eph_gb=0, flavid=9,
+ extra='solaris'),
+ 'Oracle Solaris non-global zone - xlarge': dict(
+ mem=16384, vcpus=32, root_gb=320, eph_gb=0, flavid=10,
+ extra='solaris')
}
try:
+ e = instance_type_extra_specs.insert()
+ index = 1
for name, values in default_inst_types.items():
i.execute({'name': name, 'memory_mb': values["mem"],
'vcpus': values["vcpus"], 'deleted': 0,
@@ -106,6 +134,10 @@ def _populate_instance_types(instance_ty
'flavorid': values["flavid"],
'disabled': False,
'is_public': True})
+ e.execute({'instance_type_id': index,
+ 'deleted': 0, 'key': 'zonecfg:brand',
+ 'value': values['extra']})
+ index += 1
except Exception:
LOG.info(repr(instance_types_table))
LOG.exception(_LE('Exception while seeding instance_types table'))
@@ -1575,6 +1607,6 @@ def upgrade(migrate_engine):
_create_shadow_tables(migrate_engine)
# populate initial instance types
- _populate_instance_types(instance_types)
+ _populate_instance_types(instance_types, instance_type_extra_specs)
_create_dump_tables(migrate_engine)