components/openstack/nova/patches/03-Solaris-flavors.patch
author Drew Fisher <drew.fisher@oracle.com>
Mon, 17 Mar 2014 09:51:44 -0600
changeset 1760 353323c7bdc1
child 1944 56ac2df1785b
permissions -rw-r--r--
PSARC/2013/350 OpenStack for Solaris (Umbrella) PSARC/2014/007 OpenStack client API components for Grizzly PSARC/2014/054 OpenStack Cinder (OpenStack Block Storage Service) PSARC/2014/055 OpenStack Glance (OpenStack Image Service) PSARC/2014/058 OpenStack Horizon (OpenStack Dashboard) PSARC/2014/048 OpenStack Keystone (OpenStack Identity Service) PSARC/2014/059 OpenStack Neutron (OpenStack Networking Service) PSARC/2014/049 OpenStack Nova (OpenStack Compute Service) 18290089 integrate cinderclient 18290097 integrate glanceclient 18290102 integrate keystoneclient 18290109 integrate neutronclient 18290113 integrate novaclient 18290119 integrate swiftclient 18290125 integrate quantumclient 18307582 Request to integrate Cinder into userland 18307595 Request to integrate Glance into userland 18307626 Request to integrate Horizon into userland 18307641 Request to integrate Keystone into userland 18307650 Request to integrate Neutron into userland 18307659 Request to integrate Nova into userland 18321909 a few Python packages deliver both po and mo files

In-house patch to update the default flavors for use with Solaris.
This patch has not yet been submitted upstream.

--- nova-2013.1.4/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py.orig	2014-02-11 08:54:04.148157965 -0700
+++ nova-2013.1.4/nova/db/sqlalchemy/migrate_repo/versions/133_folsom.py	2014-02-11 08:54:09.036798132 -0700
@@ -2,6 +2,8 @@
 
 # Copyright 2012 OpenStack Foundation
 #
+# Copyright (c) 2014, Oracle and/or its affiliates. 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
@@ -36,17 +38,45 @@
     return Text().with_variant(dialects.mysql.MEDIUMTEXT(), 'mysql')
 
 
-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=0, 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=10, eph_gb=0, flavid=1,
+                 extra='solaris-kz'),
+        'Oracle Solaris kernel zone - small':
+            dict(mem=4096, vcpus=4, root_gb=20, eph_gb=0, flavid=2,
+                 extra='solaris-kz'),
+        'Oracle Solaris kernel zone - medium':
+            dict(mem=8192, vcpus=8, root_gb=40, eph_gb=0, flavid=3,
+                 extra='solaris-kz'),
+        'Oracle Solaris kernel zone - large':
+            dict(mem=16384, vcpus=16, root_gb=40, eph_gb=0, flavid=4,
+                 extra='solaris-kz'),
+        'Oracle Solaris kernel zone - xlarge':
+            dict(mem=32768, vcpus=32, root_gb=80, eph_gb=0, flavid=5,
+                 extra='solaris-kz'),
+
+        'Oracle Solaris non-global zone - tiny':
+            dict(mem=2048, vcpus=1, root_gb=10, eph_gb=0, flavid=6,
+                 extra='solaris'),
+        'Oracle Solaris non-global zone - small':
+            dict(mem=3072, vcpus=4, root_gb=20, eph_gb=0, flavid=7,
+                 extra='solaris'),
+        'Oracle Solaris non-global zone - medium':
+            dict(mem=4096, vcpus=8, root_gb=40, eph_gb=0, flavid=8,
+                 extra='solaris'),
+        'Oracle Solaris non-global zone - large':
+            dict(mem=8192, vcpus=16, root_gb=40, eph_gb=0, flavid=9,
+                 extra='solaris'),
+        'Oracle Solaris non-global zone - xlarge':
+            dict(mem=16384, vcpus=32, root_gb=80, eph_gb=0, flavid=10,
+                 extra='solaris')
         }
 
     try:
         i = instance_types_table.insert()
+        e = instance_type_extra_specs.insert()
+        index = 1
         for name, values in default_inst_types.iteritems():
             i.execute({'name': name, 'memory_mb': values["mem"],
                         'vcpus': values["vcpus"], 'deleted': False,
@@ -57,6 +87,10 @@
                         '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(_('Exception while seeding instance_types table'))
@@ -1218,7 +1252,7 @@
                          name='instance_info_caches_instance_id_key').create()
 
     # populate initial instance types
-    _populate_instance_types(instance_types)
+    _populate_instance_types(instance_types, instance_type_extra_specs)
 
 
 def downgrade(migrate_engine):