components/openstack/nova/patches/03-Solaris-flavors.patch
changeset 1944 56ac2df1785b
parent 1760 353323c7bdc1
child 3998 5bd484384122
equal deleted inserted replaced
1943:1a27f000029f 1944:56ac2df1785b
     1 In-house patch to update the default flavors for use with Solaris.
     1 In-house patch to update the default flavors for use with Solaris.
     2 This patch has not yet been submitted upstream.
     2 This patch has not yet been submitted upstream.
     3 
     3 
     4 --- nova-2013.1.4/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py.orig	2014-02-11 08:54:04.148157965 -0700
     4 --- nova-2013.2.3/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py.~1~	2014-04-03 11:49:46.000000000 -0700
     5 +++ nova-2013.1.4/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py	2014-02-11 08:54:09.036798132 -0700
     5 +++ nova-2013.2.3/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py	2014-05-19 04:14:17.367917095 -0700
     6 @@ -2,6 +2,8 @@
     6 @@ -2,6 +2,8 @@
     7  
     7  
     8  # Copyright 2012 OpenStack Foundation
     8  # Copyright 2012 OpenStack Foundation
     9  #
     9  #
    10 +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    10 +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    11 +#
    11 +#
    12  #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    12  #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    13  #    not use this file except in compliance with the License. You may obtain
    13  #    not use this file except in compliance with the License. You may obtain
    14  #    a copy of the License at
    14  #    a copy of the License at
    15 @@ -36,17 +38,45 @@
    15 @@ -37,17 +39,45 @@
    16      return Text().with_variant(dialects.mysql.MEDIUMTEXT(), 'mysql')
    16      return Text().with_variant(dialects.mysql.MEDIUMTEXT(), 'mysql')
    17  
    17  
    18  
    18  
    19 -def _populate_instance_types(instance_types_table):
    19 -def _populate_instance_types(instance_types_table):
    20 +def _populate_instance_types(instance_types_table, instance_type_extra_specs):
    20 +def _populate_instance_types(instance_types_table, instance_type_extra_specs):
    21      default_inst_types = {
    21      default_inst_types = {
    22 -        'm1.tiny': dict(mem=512, vcpus=1, root_gb=0, eph_gb=0, flavid=1),
    22 -        'm1.tiny': dict(mem=512, vcpus=1, root_gb=1, eph_gb=0, flavid=1),
    23 -        'm1.small': dict(mem=2048, vcpus=1, root_gb=20, eph_gb=0, flavid=2),
    23 -        'm1.small': dict(mem=2048, vcpus=1, root_gb=20, eph_gb=0, flavid=2),
    24 -        'm1.medium': dict(mem=4096, vcpus=2, root_gb=40, eph_gb=0, flavid=3),
    24 -        'm1.medium': dict(mem=4096, vcpus=2, root_gb=40, eph_gb=0, flavid=3),
    25 -        'm1.large': dict(mem=8192, vcpus=4, root_gb=80, eph_gb=0, flavid=4),
    25 -        'm1.large': dict(mem=8192, vcpus=4, root_gb=80, eph_gb=0, flavid=4),
    26 -        'm1.xlarge': dict(mem=16384, vcpus=8, root_gb=160, eph_gb=0, flavid=5)
    26 -        'm1.xlarge': dict(mem=16384, vcpus=8, root_gb=160, eph_gb=0, flavid=5)
    27 +        'Oracle Solaris kernel zone - tiny':
    27 +        'Oracle Solaris kernel zone - tiny': dict(
    28 +            dict(mem=2048, vcpus=1, root_gb=10, eph_gb=0, flavid=1,
    28 +            mem=2048, vcpus=1, root_gb=10, eph_gb=0, flavid=1,
    29 +                 extra='solaris-kz'),
    29 +            extra='solaris-kz'),
    30 +        'Oracle Solaris kernel zone - small':
    30 +        'Oracle Solaris kernel zone - small': dict(
    31 +            dict(mem=4096, vcpus=4, root_gb=20, eph_gb=0, flavid=2,
    31 +            mem=4096, vcpus=4, root_gb=20, eph_gb=0, flavid=2,
    32 +                 extra='solaris-kz'),
    32 +            extra='solaris-kz'),
    33 +        'Oracle Solaris kernel zone - medium':
    33 +        'Oracle Solaris kernel zone - medium': dict(
    34 +            dict(mem=8192, vcpus=8, root_gb=40, eph_gb=0, flavid=3,
    34 +            mem=8192, vcpus=8, root_gb=40, eph_gb=0, flavid=3,
    35 +                 extra='solaris-kz'),
    35 +            extra='solaris-kz'),
    36 +        'Oracle Solaris kernel zone - large':
    36 +        'Oracle Solaris kernel zone - large': dict(
    37 +            dict(mem=16384, vcpus=16, root_gb=40, eph_gb=0, flavid=4,
    37 +            mem=16384, vcpus=16, root_gb=40, eph_gb=0, flavid=4,
    38 +                 extra='solaris-kz'),
    38 +            extra='solaris-kz'),
    39 +        'Oracle Solaris kernel zone - xlarge':
    39 +        'Oracle Solaris kernel zone - xlarge': dict(
    40 +            dict(mem=32768, vcpus=32, root_gb=80, eph_gb=0, flavid=5,
    40 +            mem=32768, vcpus=32, root_gb=80, eph_gb=0, flavid=5,
    41 +                 extra='solaris-kz'),
    41 +            extra='solaris-kz'),
    42 +
    42 +
    43 +        'Oracle Solaris non-global zone - tiny':
    43 +        'Oracle Solaris non-global zone - tiny': dict(
    44 +            dict(mem=2048, vcpus=1, root_gb=10, eph_gb=0, flavid=6,
    44 +            mem=2048, vcpus=1, root_gb=10, eph_gb=0, flavid=6,
    45 +                 extra='solaris'),
    45 +            extra='solaris'),
    46 +        'Oracle Solaris non-global zone - small':
    46 +        'Oracle Solaris non-global zone - small': dict(
    47 +            dict(mem=3072, vcpus=4, root_gb=20, eph_gb=0, flavid=7,
    47 +            mem=3072, vcpus=4, root_gb=20, eph_gb=0, flavid=7,
    48 +                 extra='solaris'),
    48 +            extra='solaris'),
    49 +        'Oracle Solaris non-global zone - medium':
    49 +        'Oracle Solaris non-global zone - medium': dict(
    50 +            dict(mem=4096, vcpus=8, root_gb=40, eph_gb=0, flavid=8,
    50 +            mem=4096, vcpus=8, root_gb=40, eph_gb=0, flavid=8,
    51 +                 extra='solaris'),
    51 +            extra='solaris'),
    52 +        'Oracle Solaris non-global zone - large':
    52 +        'Oracle Solaris non-global zone - large': dict(
    53 +            dict(mem=8192, vcpus=16, root_gb=40, eph_gb=0, flavid=9,
    53 +            mem=8192, vcpus=16, root_gb=40, eph_gb=0, flavid=9,
    54 +                 extra='solaris'),
    54 +            extra='solaris'),
    55 +        'Oracle Solaris non-global zone - xlarge':
    55 +        'Oracle Solaris non-global zone - xlarge': dict(
    56 +            dict(mem=16384, vcpus=32, root_gb=80, eph_gb=0, flavid=10,
    56 +            mem=16384, vcpus=32, root_gb=80, eph_gb=0, flavid=10,
    57 +                 extra='solaris')
    57 +            extra='solaris')
    58          }
    58          }
    59  
    59  
    60      try:
    60      try:
    61          i = instance_types_table.insert()
    61          i = instance_types_table.insert()
    62 +        e = instance_type_extra_specs.insert()
    62 +        e = instance_type_extra_specs.insert()
    63 +        index = 1
    63 +        index = 1
    64          for name, values in default_inst_types.iteritems():
    64          for name, values in default_inst_types.iteritems():
    65              i.execute({'name': name, 'memory_mb': values["mem"],
    65              i.execute({'name': name, 'memory_mb': values["mem"],
    66                          'vcpus': values["vcpus"], 'deleted': False,
    66                          'vcpus': values["vcpus"], 'deleted': False,
    67 @@ -57,6 +87,10 @@
    67 @@ -58,6 +88,10 @@
    68                          'flavorid': values["flavid"],
    68                          'flavorid': values["flavid"],
    69                          'disabled': False,
    69                          'disabled': False,
    70                          'is_public': True})
    70                          'is_public': True})
    71 +            e.execute({'instance_type_id': index,
    71 +            e.execute({'instance_type_id': index,
    72 +                       'deleted': 0, 'key': 'zonecfg:brand',
    72 +                       'deleted': 0, 'key': 'zonecfg:brand',
    73 +                       'value': values['extra']})
    73 +                       'value': values['extra']})
    74 +            index += 1
    74 +            index += 1
    75      except Exception:
    75      except Exception:
    76          LOG.info(repr(instance_types_table))
    76          LOG.info(repr(instance_types_table))
    77          LOG.exception(_('Exception while seeding instance_types table'))
    77          LOG.exception(_('Exception while seeding instance_types table'))
    78 @@ -1218,7 +1252,7 @@
    78 @@ -1219,7 +1253,7 @@
    79                           name='instance_info_caches_instance_id_key').create()
    79                           name='instance_info_caches_instance_id_key').create()
    80  
    80  
    81      # populate initial instance types
    81      # populate initial instance types
    82 -    _populate_instance_types(instance_types)
    82 -    _populate_instance_types(instance_types)
    83 +    _populate_instance_types(instance_types, instance_type_extra_specs)
    83 +    _populate_instance_types(instance_types, instance_type_extra_specs)