Add flavor metadata and convert to ui metadata
Change-Id: I22423d9852580ff5da033f67c04b07efea74b5ee
This commit is contained in:
parent
00a9989fe1
commit
a59bc2f953
@ -1354,6 +1354,49 @@ def convert_os_metadata(os_id):
|
||||
)
|
||||
|
||||
|
||||
@app.route("/flavors/<int:flavor_id>/metadata", methods=['GET'])
|
||||
@log_user_action
|
||||
@login_required
|
||||
@update_user_token
|
||||
def show_flavor_metadata(flavor_id):
|
||||
"""Get flavor metadata."""
|
||||
data = _get_request_args()
|
||||
return utils.make_json_response(
|
||||
200,
|
||||
metadata_api.get_flavor_metadata(
|
||||
flavor_id, user=current_user, **data
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@app.route("/flavors/<int:flavor_id>/ui_metadata", methods=['GET'])
|
||||
@log_user_action
|
||||
@login_required
|
||||
@update_user_token
|
||||
def convert_flavor_metadata(flavor_id):
|
||||
"""Convert flavor metadat to ui flavor metadata."""
|
||||
metadatas = metadata_api.get_flavor_metadata(
|
||||
flavor_id, user=current_user
|
||||
)
|
||||
metadata = metadatas['flavor_config']
|
||||
clusters = cluster_api.list_clusters(
|
||||
user=current_user
|
||||
)
|
||||
for cluster in clusters:
|
||||
if cluster['flavor']['id'] == flavor_id:
|
||||
flavor_name = cluster['flavor_name'].replace('-', '_')
|
||||
configs = util.load_configs(setting.FLAVOR_MAPPING_DIR)
|
||||
for item in configs:
|
||||
if flavor_name in item.keys():
|
||||
config = item[flavor_name]
|
||||
return utils.make_json_response(
|
||||
200,
|
||||
metadata_api.get_ui_metadata(
|
||||
metadata, config
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@app.route(
|
||||
"/adapters/<int:adapter_id>/oses/<int:os_id>/metadata",
|
||||
methods=['GET']
|
||||
|
@ -252,6 +252,13 @@ def _setup_package_fields(field_session):
|
||||
metadata.add_package_field_internal(field_session)
|
||||
|
||||
|
||||
def _setup_flavor_fields(field_session):
|
||||
"""Initialize flavor field table."""
|
||||
logging.info('setup flavor field table')
|
||||
from compass.db.api import metadata
|
||||
metadata.add_flavor_field_internal(field_session)
|
||||
|
||||
|
||||
def _setup_os_metadatas(metadata_session):
|
||||
"""Initialize os metadata table."""
|
||||
logging.info('setup os metadata table')
|
||||
@ -266,6 +273,13 @@ def _setup_package_metadatas(metadata_session):
|
||||
metadata.add_package_metadata_internal(metadata_session)
|
||||
|
||||
|
||||
def _setup_flavor_metadatas(metadata_session):
|
||||
"""Initialize flavor metadata table."""
|
||||
logging.info('setup flavor metadata table')
|
||||
from compass.db.api import metadata
|
||||
metadata.add_flavor_metadata_internal(metadata_session)
|
||||
|
||||
|
||||
def _setup_adapter_roles(role_session):
|
||||
"""Initialize adapter role table."""
|
||||
logging.info('setup adapter role table')
|
||||
@ -312,8 +326,10 @@ def create_db(session):
|
||||
_setup_adapter_flavors(session)
|
||||
_setup_os_fields(session)
|
||||
_setup_package_fields(session)
|
||||
_setup_flavor_fields(session)
|
||||
_setup_os_metadatas(session)
|
||||
_setup_package_metadatas(session)
|
||||
_setup_flavor_metadatas(session)
|
||||
_update_others(session)
|
||||
|
||||
|
||||
|
@ -74,6 +74,19 @@ def add_package_field_internal(session):
|
||||
)
|
||||
|
||||
|
||||
def add_flavor_field_internal(session):
|
||||
env_locals = {}
|
||||
env_locals.update(metadata_validator.VALIDATOR_LOCALS)
|
||||
env_locals.update(metadata_callback.CALLBACK_LOCALS)
|
||||
configs = util.load_configs(
|
||||
setting.FLAVOR_FIELD_DIR,
|
||||
env_locals=env_locals
|
||||
)
|
||||
return _add_field_internal(
|
||||
session, models.FlavorConfigField, configs
|
||||
)
|
||||
|
||||
|
||||
def _add_metadata(
|
||||
session, field_model, metadata_model, id, path, name, config,
|
||||
exception_when_existing=True, parent=None, **kwargs
|
||||
@ -219,6 +232,30 @@ def add_package_metadata_internal(session, exception_when_existing=True):
|
||||
return package_metadatas
|
||||
|
||||
|
||||
def add_flavor_metadata_internal(session, exception_when_existing=True):
|
||||
flavor_metadatas = []
|
||||
env_locals = {}
|
||||
env_locals.update(metadata_validator.VALIDATOR_LOCALS)
|
||||
env_locals.update(metadata_callback.CALLBACK_LOCALS)
|
||||
configs = util.load_configs(
|
||||
setting.FLAVOR_METADATA_DIR,
|
||||
env_locals=env_locals
|
||||
)
|
||||
for config in configs:
|
||||
flavor = utils.get_db_object(
|
||||
session, models.AdapterFlavor, name=config['FLAVOR']
|
||||
)
|
||||
for key, value in config['METADATA'].items():
|
||||
flavor_metadatas.append(_add_metadata(
|
||||
session, models.FlavorConfigField,
|
||||
models.FlavorConfigMetadata,
|
||||
flavor.id, key, key, value,
|
||||
exception_when_existing=exception_when_existing,
|
||||
parent=None
|
||||
))
|
||||
return flavor_metadatas
|
||||
|
||||
|
||||
def _filter_metadata(metadata, **kwargs):
|
||||
if not isinstance(metadata, dict):
|
||||
return metadata
|
||||
@ -277,6 +314,27 @@ def get_package_metadatas_internal(session):
|
||||
return metadata_mapping
|
||||
|
||||
|
||||
def get_flavor_metadatas_internal(session):
|
||||
metadata_mapping = {}
|
||||
flavors = utils.list_db_objects(
|
||||
session, models.AdapterFlavor
|
||||
)
|
||||
for flavor in flavors:
|
||||
flavor_metadata_dict = flavor.metadata_dict()
|
||||
metadata_mapping[flavor.id] = _filter_metadata(
|
||||
flavor_metadata_dict, session=session
|
||||
)
|
||||
adapters = utils.list_db_objects(
|
||||
session, models.Adapter, id=flavor.adapter_id
|
||||
)
|
||||
for adapter in adapters:
|
||||
package_metadata_dict = adapter.metadata_dict()
|
||||
metadata_mapping[flavor.id].update(_filter_metadata(
|
||||
package_metadata_dict, session=session
|
||||
))
|
||||
return metadata_mapping
|
||||
|
||||
|
||||
def get_os_metadatas_internal(session):
|
||||
metadata_mapping = {}
|
||||
oses = utils.list_db_objects(
|
||||
|
@ -26,7 +26,7 @@ from compass.utils import util
|
||||
|
||||
|
||||
RESP_METADATA_FIELDS = [
|
||||
'os_config', 'package_config'
|
||||
'os_config', 'package_config', 'flavor_config'
|
||||
]
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ RESP_METADATA_FIELDS = [
|
||||
def load_metadatas(session):
|
||||
load_os_metadatas_internal(session)
|
||||
load_package_metadatas_internal(session)
|
||||
load_flavor_metadatas_internal(session)
|
||||
|
||||
|
||||
def load_os_metadatas_internal(session):
|
||||
@ -50,8 +51,17 @@ def load_package_metadatas_internal(session):
|
||||
)
|
||||
|
||||
|
||||
def load_flavor_metadatas_internal(session):
|
||||
global FLAVOR_METADATA_MAPPING
|
||||
logging.info('load flavor metadatas into memory')
|
||||
FLAVOR_METADATA_MAPPING = (
|
||||
metadata_api.get_flavor_metadatas_internal(session)
|
||||
)
|
||||
|
||||
|
||||
OS_METADATA_MAPPING = {}
|
||||
PACKAGE_METADATA_MAPPING = {}
|
||||
FLAVOR_METADATA_MAPPING = {}
|
||||
|
||||
|
||||
def _validate_config(
|
||||
@ -141,6 +151,31 @@ def get_package_metadata(adapter_id, user=None, session=None, **kwargs):
|
||||
}
|
||||
|
||||
|
||||
def get_flavor_metadata_internal(session, flavor_id):
|
||||
"""get flavor metadata internal."""
|
||||
if not FLAVOR_METADATA_MAPPING:
|
||||
load_flavor_metadatas_internal(session)
|
||||
if flavor_id not in FLAVOR_METADATA_MAPPING:
|
||||
raise exception.RecordNotExists(
|
||||
'flavor %s does not exist' % flavor_id
|
||||
)
|
||||
return _filter_metadata(
|
||||
FLAVOR_METADATA_MAPPING[flavor_id], session=session
|
||||
)
|
||||
|
||||
|
||||
@utils.supported_filters([])
|
||||
@database.run_in_session()
|
||||
@user_api.check_user_permission_in_session(
|
||||
permission.PERMISSION_LIST_METADATAS
|
||||
)
|
||||
@utils.wrap_to_dict(RESP_METADATA_FIELDS)
|
||||
def get_flavor_metadata(flavor_id, user=None, session=None, **kwargs):
|
||||
return {
|
||||
'flavor_config': get_flavor_metadata_internal(session, flavor_id)
|
||||
}
|
||||
|
||||
|
||||
def get_os_metadata_internal(session, os_id):
|
||||
"""get os metadata internal."""
|
||||
if not OS_METADATA_MAPPING:
|
||||
@ -186,7 +221,7 @@ def get_ui_metadata(metadata, config):
|
||||
def _get_data(metadata, config, result_data):
|
||||
data_dict = {}
|
||||
for key, config_value in config.items():
|
||||
if isinstance(config_value, dict):
|
||||
if isinstance(config_value, dict) and key != 'content_data':
|
||||
if key in metadata.keys():
|
||||
_get_data(metadata[key], config_value, result_data)
|
||||
else:
|
||||
|
@ -2238,6 +2238,75 @@ class AdapterFlavorRole(BASE, HelperMixin):
|
||||
return dict_info
|
||||
|
||||
|
||||
class FlavorConfigMetadata(BASE, MetadataMixin):
|
||||
"""flavor config metadata."""
|
||||
|
||||
__tablename__ = "flavor_config_metadata"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
flavor_id = Column(
|
||||
Integer,
|
||||
ForeignKey(
|
||||
'adapter_flavor.id',
|
||||
onupdate='CASCADE', ondelete='CASCADE'
|
||||
)
|
||||
)
|
||||
parent_id = Column(
|
||||
Integer,
|
||||
ForeignKey(
|
||||
'flavor_config_metadata.id',
|
||||
onupdate='CASCADE', ondelete='CASCADE'
|
||||
)
|
||||
)
|
||||
field_id = Column(
|
||||
Integer,
|
||||
ForeignKey(
|
||||
'flavor_config_field.id',
|
||||
onupdate='CASCADE', ondelete='CASCADE'
|
||||
)
|
||||
)
|
||||
children = relationship(
|
||||
'FlavorConfigMetadata',
|
||||
passive_deletes=True, passive_updates=True,
|
||||
backref=backref('parent', remote_side=id)
|
||||
)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('path', 'flavor_id', name='constraint'),
|
||||
)
|
||||
|
||||
def __init__(
|
||||
self, flavor_id, path, **kwargs
|
||||
):
|
||||
self.flavor_id = flavor_id
|
||||
self.path = path
|
||||
super(FlavorConfigMetadata, self).__init__(**kwargs)
|
||||
|
||||
def validate(self):
|
||||
super(FlavorConfigMetadata, self).validate()
|
||||
if not self.flavor:
|
||||
raise exception.InvalidParameter(
|
||||
'flavor is not set in package metadata %s' % self.id
|
||||
)
|
||||
|
||||
|
||||
class FlavorConfigField(BASE, FieldMixin):
|
||||
"""Flavor config metadata fields."""
|
||||
|
||||
__tablename__ = "flavor_config_field"
|
||||
|
||||
metadatas = relationship(
|
||||
FlavorConfigMetadata,
|
||||
passive_deletes=True, passive_updates=True,
|
||||
cascade="all, delete-orphan",
|
||||
backref=backref('field')
|
||||
)
|
||||
|
||||
def __init__(self, field, **kwargs):
|
||||
self.field = field
|
||||
super(FlavorConfigField, self).__init__(**kwargs)
|
||||
|
||||
|
||||
class AdapterFlavor(BASE, HelperMixin):
|
||||
"""Adapter's flavors."""
|
||||
|
||||
@ -2265,6 +2334,12 @@ class AdapterFlavor(BASE, HelperMixin):
|
||||
Cluster,
|
||||
backref=backref('flavor')
|
||||
)
|
||||
metadatas = relationship(
|
||||
FlavorConfigMetadata,
|
||||
passive_deletes=True, passive_updates=True,
|
||||
cascade='all, delete-orphan',
|
||||
backref=backref('flavor')
|
||||
)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('name', 'adapter_id', name='constraint'),
|
||||
@ -2273,6 +2348,20 @@ class AdapterFlavor(BASE, HelperMixin):
|
||||
def __str__(self):
|
||||
return 'AdapterFlavor[%s:%s]' % (self.id, self.name)
|
||||
|
||||
@property
|
||||
def root_metadatas(self):
|
||||
return [
|
||||
metadata for metadata in self.metadatas
|
||||
if metadata.parent_id is None
|
||||
]
|
||||
|
||||
def metadata_dict(self):
|
||||
dict_info = {}
|
||||
for metadata in self.root_metadatas:
|
||||
logging.info('metadata from flavr config metadata: %s', metadata)
|
||||
util.merge_dict(dict_info, metadata.to_dict())
|
||||
return dict_info
|
||||
|
||||
@property
|
||||
def ordered_flavor_roles(self):
|
||||
flavor_roles = dict([
|
||||
|
@ -13,4 +13,11 @@ FLAVORS = [{
|
||||
'os-image', 'os-compute-vncproxy', 'os-controller',
|
||||
'os-ops-messaging', 'os-ops-database', 'ha-proxy'
|
||||
]
|
||||
},{
|
||||
'flavor': 'single-contoller-multi-compute',
|
||||
'display_name': 'Single Controller, Multi-compute',
|
||||
'template': 'base.tmpl',
|
||||
'roles': [
|
||||
'os-controller', 'os-compute-worker', 'os-network'
|
||||
]
|
||||
}]
|
||||
|
1
compass/tests/api/data/flavor_field/general.conf
Normal file
1
compass/tests/api/data/flavor_field/general.conf
Normal file
@ -0,0 +1 @@
|
||||
NAME = 'general'
|
62
compass/tests/api/data/flavor_mapping/allinone.conf
Normal file
62
compass/tests/api/data/flavor_mapping/allinone.conf
Normal file
@ -0,0 +1,62 @@
|
||||
allinone = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"hint": "e.g. 1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
2
compass/tests/api/data/flavor_metadata/allinone.conf
Normal file
2
compass/tests/api/data/flavor_metadata/allinone.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'allinone'
|
||||
METADATA = {}
|
2
compass/tests/api/data/package_field/anytype.conf
Normal file
2
compass/tests/api/data/package_field/anytype.conf
Normal file
@ -0,0 +1,2 @@
|
||||
NAME = 'anytype'
|
||||
FIELD_TYPE = object
|
2
compass/tests/api/data/package_field/general_list.conf
Normal file
2
compass/tests/api/data/package_field/general_list.conf
Normal file
@ -0,0 +1,2 @@
|
||||
NAME = 'general_list'
|
||||
FIELD_TYPE = list
|
@ -6,27 +6,46 @@ METADATA = {
|
||||
},
|
||||
'service_credentials': {
|
||||
'_self': {
|
||||
'mapping_to': 'service_credentials'
|
||||
'required_in_whole_config': True,
|
||||
'key_extensions': {
|
||||
'$service': ['image', 'compute', 'dashboard', 'identity', 'metering', 'rabbitmq', 'volume', 'mysql']
|
||||
},
|
||||
'mapping_to': 'service_credentials'
|
||||
},
|
||||
'$service': {
|
||||
'username': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'username',
|
||||
'mapping_to': 'username'
|
||||
}
|
||||
},
|
||||
'password': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'password',
|
||||
'mapping_to': 'password'
|
||||
}
|
||||
}
|
||||
'_self': {
|
||||
'required_in_whole_config': True,
|
||||
'mapping_to': '$service'
|
||||
},
|
||||
'username': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'username',
|
||||
'mapping_to': 'username'
|
||||
}
|
||||
},
|
||||
'password': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'password',
|
||||
'mapping_to': 'password'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'console_credentials': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True,
|
||||
'key_extensions': {
|
||||
'$console': ['admin', 'compute', 'dashboard', 'image', 'metering', 'network', 'object-store', 'volume']
|
||||
},
|
||||
'mapping_to': 'console_credentials'
|
||||
},
|
||||
'$console': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True,
|
||||
'mapping_to': '$console'
|
||||
},
|
||||
'username': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
@ -44,15 +63,76 @@ METADATA = {
|
||||
}
|
||||
}
|
||||
},
|
||||
'neutron_config': {
|
||||
'_self': {
|
||||
'mapping_to': 'neutron_config'
|
||||
},
|
||||
'openvswitch': {
|
||||
'_self': {
|
||||
'mapping_to': 'openvswitch',
|
||||
'required_in_whole_config': True
|
||||
},
|
||||
'tenant_network_type': {
|
||||
'_self': {
|
||||
'mapping_to': 'tenant_network_type',
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'options': ['gre', 'vlan'],
|
||||
'default_value': 'gre'
|
||||
}
|
||||
},
|
||||
'network_vlan_ranges': {
|
||||
'_self': {
|
||||
'mapping_to': 'vlan_ranges',
|
||||
'is_required': False,
|
||||
'field': 'general_list',
|
||||
'default_value': ['physnet1:2700:2999']
|
||||
}
|
||||
},
|
||||
'bridge_mappings': {
|
||||
'_self': {
|
||||
'mapping_to': 'bridge_mappings',
|
||||
'is_required': False,
|
||||
'field': 'general_list',
|
||||
'default_value': ['physnet1:br-eth1']
|
||||
}
|
||||
},
|
||||
'tunnel_id_ranges': {
|
||||
'_self': {
|
||||
'mapping_to': 'tunnel_id_ranges',
|
||||
'is_required': False,
|
||||
'field': 'general_list',
|
||||
'default_value': ['1:1000']
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'network_mapping': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True
|
||||
'required_in_whole_config': True,
|
||||
'key_extensions': {
|
||||
'$interface_type': ['management', 'external', 'storage', 'tenant']
|
||||
}
|
||||
},
|
||||
'$interface_type': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general'
|
||||
'required_in_whole_config': True,
|
||||
'field': 'anytype',
|
||||
'autofill_callback': autofill_network_mapping,
|
||||
'mapping_to': '$interface_type'
|
||||
},
|
||||
'interface': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
}
|
||||
},
|
||||
'subnet': {
|
||||
'_self': {
|
||||
'is_required': False,
|
||||
'field': 'general'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ class ApiTestCase(unittest2.TestCase):
|
||||
data['name'] = 'test_cluster2'
|
||||
data['adapter_id'] = adapter_id
|
||||
data['os_id'] = os_id
|
||||
self.flavor_id = flavor_id
|
||||
data['flavor_id'] = flavor_id
|
||||
self.post(url, data)
|
||||
|
||||
@ -1020,6 +1021,12 @@ class TestMetadataAPI(ApiTestCase):
|
||||
self.assertEqual(return_value.status_code, 200)
|
||||
self.assertIn('os_global_config', return_value.get_data())
|
||||
|
||||
def test_get_flavor_ui_metadata(self):
|
||||
url = '/flavors/%s/ui_metadata' % self.flavor_id
|
||||
return_value = self.get(url)
|
||||
self.assertEqual(return_value.status_code, 200)
|
||||
self.assertIn('flavor_config', return_value.get_data())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
flags.init()
|
||||
|
@ -13,4 +13,20 @@ FLAVORS = [{
|
||||
'os-image', 'os-compute-vncproxy', 'os-controller',
|
||||
'os-ops-messaging', 'os-ops-database', 'ha-proxy'
|
||||
]
|
||||
}, {
|
||||
'flavor': 'HA-multinodes',
|
||||
'display_name': 'Multi-node Cluster with HA',
|
||||
'template': 'ha_multinodes.tmpl',
|
||||
'roles': [
|
||||
'os-ops-database', 'os-ops-messaging', 'os-ha',
|
||||
'os-compute-worker',
|
||||
'os-image'
|
||||
]
|
||||
},{
|
||||
'flavor': 'single-contoller-multi-compute',
|
||||
'display_name': 'Single Controller, Multi-compute',
|
||||
'template': 'base.tmpl',
|
||||
'roles': [
|
||||
'os-controller', 'os-compute-worker', 'os-network'
|
||||
]
|
||||
}]
|
||||
|
1
compass/tests/db/api/data/flavor_field/general.conf
Normal file
1
compass/tests/db/api/data/flavor_field/general.conf
Normal file
@ -0,0 +1 @@
|
||||
NAME = 'general'
|
114
compass/tests/db/api/data/flavor_mapping/ha-multinodes.conf
Normal file
114
compass/tests/db/api/data/flavor_mapping/ha-multinodes.conf
Normal file
@ -0,0 +1,114 @@
|
||||
HA_MULTINODES = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "True",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "True",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"ceph_config": {
|
||||
"accordion_heading": "Ceph Global Configurations",
|
||||
"category": "ceph",
|
||||
"data_structure": "form",
|
||||
"form_name": "cephForm",
|
||||
"data": {
|
||||
"global_config": {
|
||||
"osd_pool_pgp_num": {
|
||||
"label": "OSD Pool PG Number",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
},
|
||||
"osd_pool_size": {
|
||||
"label": "OSD Pool Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
}
|
||||
},
|
||||
"osd_config": {
|
||||
"journal_size": {
|
||||
"label": "Journal Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
},
|
||||
"op_threads": {
|
||||
"label": "OP Threads",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "True",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"hint": "e.g. 1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "True",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "True",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"ha_proxy": {
|
||||
"accordion_heading": "High Availability Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "ha",
|
||||
"form_name": "haForm",
|
||||
"data": {
|
||||
"vip": {
|
||||
"label": "VIP",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
14
compass/tests/db/api/data/flavor_metadata/HA-multinodes.conf
Normal file
14
compass/tests/db/api/data/flavor_metadata/HA-multinodes.conf
Normal file
@ -0,0 +1,14 @@
|
||||
FLAVOR = 'HA-multinodes'
|
||||
METADATA = {
|
||||
'ha_proxy': {
|
||||
'_self': {
|
||||
},
|
||||
'vip': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'mapping_to': 'ha_vip'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
compass/tests/db/api/data/flavor_metadata/allinone.conf
Normal file
2
compass/tests/db/api/data/flavor_metadata/allinone.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'allinone'
|
||||
METADATA = {}
|
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'single-contoller-multi-compute'
|
||||
METADATA = {}
|
@ -0,0 +1,2 @@
|
||||
NAME = 'general_list'
|
||||
FIELD_TYPE = list
|
2
compass/tests/db/api/data/package_field/integer.conf
Normal file
2
compass/tests/db/api/data/package_field/integer.conf
Normal file
@ -0,0 +1,2 @@
|
||||
NAME = 'integer'
|
||||
FIELD_TYPE = int
|
@ -41,4 +41,9 @@ ROLES = [{
|
||||
'display_name': 'all in one compute',
|
||||
'description': 'all in one compute',
|
||||
'optional': True
|
||||
}, {
|
||||
'role': 'os-ha',
|
||||
'display_name': 'ha proxy node',
|
||||
'description': 'ha proxy node',
|
||||
'optional': True
|
||||
}]
|
||||
|
@ -73,6 +73,10 @@ class MetadataTestCase(unittest2.TestCase):
|
||||
for supported_os in test_adapter['supported_oses']:
|
||||
self.os_id = supported_os['os_id']
|
||||
break
|
||||
for flavor in test_adapter['flavors']:
|
||||
if flavor['name'] == 'HA-multinodes':
|
||||
self.flavor_id = flavor['id']
|
||||
break
|
||||
|
||||
def tearDown(self):
|
||||
super(MetadataTestCase, self).setUp()
|
||||
@ -235,6 +239,50 @@ class TestGetOsMetadata(MetadataTestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestGetFlavorMetadata(MetadataTestCase):
|
||||
def setUp(self):
|
||||
self.backup_load_configs = util.load_configs
|
||||
|
||||
def mock_load_configs(config_dir, *args, **kwargs):
|
||||
if config_dir != setting.FLAVOR_METADATA_DIR:
|
||||
return self.backup_load_configs(
|
||||
config_dir, *args, **kwargs
|
||||
)
|
||||
config = {
|
||||
'FLAVOR': 'HA-multinodes',
|
||||
'METADATA': {
|
||||
'test_ha_proxy': {
|
||||
'_self': {
|
||||
},
|
||||
'vip': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'mapping_to': 'ha_vip'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return [config]
|
||||
util.load_configs = mock.Mock(side_effect=mock_load_configs)
|
||||
super(TestGetFlavorMetadata, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
util.load_configs = self.backup_load_configs
|
||||
super(TestGetFlavorMetadata, self).tearDown()
|
||||
|
||||
def test_get_flavor_metadata(self):
|
||||
flavor_metadata = metadata.get_flavor_metadata(
|
||||
self.flavor_id,
|
||||
user=self.user_object
|
||||
)
|
||||
self.assertIsNotNone(flavor_metadata)
|
||||
self.assertTrue(
|
||||
'test_ha_proxy' in flavor_metadata['flavor_config'].keys()
|
||||
)
|
||||
|
||||
|
||||
class TestGetPackageOsMetadata(MetadataTestCase):
|
||||
def setUp(self):
|
||||
super(TestGetPackageOsMetadata, self).setUp()
|
||||
|
@ -97,12 +97,18 @@ OS_METADATA_DIR = lazypy.delay(
|
||||
PACKAGE_METADATA_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'package_metadata')
|
||||
)
|
||||
FLAVOR_METADATA_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'flavor_metadata')
|
||||
)
|
||||
OS_FIELD_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'os_field')
|
||||
)
|
||||
PACKAGE_FIELD_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'package_field')
|
||||
)
|
||||
FLAVOR_FIELD_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'flavor_field')
|
||||
)
|
||||
ADAPTER_ROLE_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'role')
|
||||
)
|
||||
@ -127,6 +133,9 @@ PROGRESS_CALCULATOR_DIR = lazypy.delay(
|
||||
OS_MAPPING_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'os_mapping')
|
||||
)
|
||||
FLAVOR_MAPPING_DIR = lazypy.delay(
|
||||
lambda: os.path.join(CONFIG_DIR, 'flavor_mapping')
|
||||
)
|
||||
PROXY_URL_PREFIX = 'http://10.145.81.205:5000'
|
||||
|
||||
if (
|
||||
|
1
conf/flavor_field/general.conf
Normal file
1
conf/flavor_field/general.conf
Normal file
@ -0,0 +1 @@
|
||||
NAME = 'general'
|
63
conf/flavor_mapping/allinone.conf
Normal file
63
conf/flavor_mapping/allinone.conf
Normal file
@ -0,0 +1,63 @@
|
||||
allinone = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron_config",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"hint": "e.g. 1:1000",
|
||||
"default_value": "1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
47
conf/flavor_mapping/ceph_firefly.conf
Normal file
47
conf/flavor_mapping/ceph_firefly.conf
Normal file
@ -0,0 +1,47 @@
|
||||
ceph_firefly = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"ceph_config": {
|
||||
"accordion_heading": "Ceph Global Configurations",
|
||||
"category": "ceph_config",
|
||||
"data_structure": "form",
|
||||
"form_name": "cephForm",
|
||||
"data": {
|
||||
"global_config": {
|
||||
"osd_pool_pgp_num": {
|
||||
"label": "OSD Pool PGP Number",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"osd_pool_size": {
|
||||
"label": "OSD Pool Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"osd_pool_pg_num": {
|
||||
"label": "OSD Pool PG Number",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"osd_config": {
|
||||
"journal_size": {
|
||||
"label": "Journal Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"op_threads": {
|
||||
"label": "OP Threads",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
100
conf/flavor_mapping/ceph_openstack_multinodes.conf
Normal file
100
conf/flavor_mapping/ceph_openstack_multinodes.conf
Normal file
@ -0,0 +1,100 @@
|
||||
ceph_openstack_multinodes = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"ceph_config": {
|
||||
"accordion_heading": "Ceph Global Configurations",
|
||||
"category": "ceph",
|
||||
"data_structure": "form",
|
||||
"form_name": "cephForm",
|
||||
"data": {
|
||||
"global_config": {
|
||||
"osd_pool_pgp_num": {
|
||||
"label": "OSD Pool PG Number",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"osd_pool_size": {
|
||||
"label": "OSD Pool Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"osd_config": {
|
||||
"journal_size": {
|
||||
"label": "Journal Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"op_threads": {
|
||||
"label": "OP Threads",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron_config",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"hint": "e.g. 1:1000",
|
||||
"default_value": "1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
100
conf/flavor_mapping/ceph_openstack_single_controller.conf
Normal file
100
conf/flavor_mapping/ceph_openstack_single_controller.conf
Normal file
@ -0,0 +1,100 @@
|
||||
ceph_openstack_single_controller = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"ceph_config": {
|
||||
"accordion_heading": "Ceph Global Configurations",
|
||||
"category": "ceph",
|
||||
"data_structure": "form",
|
||||
"form_name": "cephForm",
|
||||
"data": {
|
||||
"global_config": {
|
||||
"osd_pool_pgp_num": {
|
||||
"label": "OSD Pool PG Number",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"osd_pool_size": {
|
||||
"label": "OSD Pool Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"osd_config": {
|
||||
"journal_size": {
|
||||
"label": "Journal Size",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
},
|
||||
"op_threads": {
|
||||
"label": "OP Threads",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type", "default_value"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron_config",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"default_value": "1:1000",
|
||||
"hint": "e.g. 1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
78
conf/flavor_mapping/ha-multinodes.conf
Normal file
78
conf/flavor_mapping/ha-multinodes.conf
Normal file
@ -0,0 +1,78 @@
|
||||
HA_multinodes = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"default_value": "1:1000",
|
||||
"hint": "e.g. 1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"ha_proxy": {
|
||||
"accordion_heading": "High Availability Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "ha_proxy",
|
||||
"form_name": "haForm",
|
||||
"data": {
|
||||
"vip": {
|
||||
"label": "VIP",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "display_type"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
63
conf/flavor_mapping/multinodes.conf
Normal file
63
conf/flavor_mapping/multinodes.conf
Normal file
@ -0,0 +1,63 @@
|
||||
multinodes = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron_config",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"hint": "e.g. 1:1000",
|
||||
"default_value": "1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
63
conf/flavor_mapping/single-contoller-multi-compute.conf
Normal file
63
conf/flavor_mapping/single-contoller-multi-compute.conf
Normal file
@ -0,0 +1,63 @@
|
||||
single_contoller_multi_compute = {
|
||||
"mapped_name": "flavor_config",
|
||||
"mapped_children": [{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Database and Queue Credentials",
|
||||
"category": "service_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"security": {
|
||||
"accordion_heading": "OpenStack Keystone User Credentials",
|
||||
"category": "console_credentials",
|
||||
"data_structure": "table",
|
||||
"action": "true",
|
||||
"modifiable_data": ["username", "password"],
|
||||
"table_display_header": ["Service", "UserName", "Password", "Action"]
|
||||
}
|
||||
},{
|
||||
"neutron_config": {
|
||||
"accordion_heading": "Neutron Configurations",
|
||||
"data_structure": "form",
|
||||
"category": "neutron_config",
|
||||
"form_name": "neutronForm",
|
||||
"data": {
|
||||
"openvswitch": {
|
||||
"tenant_network_type": {
|
||||
"label": "Tenant Network Type",
|
||||
"input_type": "dropdown",
|
||||
"mapped_key": [
|
||||
"name", "is_required", "options", "default_value"
|
||||
],
|
||||
"content_data": {
|
||||
"gre": [{
|
||||
"label": "Tunnel ID Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "tunnel_id_ranges",
|
||||
"default_value": "1:1000",
|
||||
"hint": "e.g. 1:1000"
|
||||
}],
|
||||
"vlan": [{
|
||||
"label": "Network Vlan Ranges",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "vlan_ranges",
|
||||
"hint": "e.g. physnet1:2700:2999"
|
||||
}, {
|
||||
"label": "Bridge Mapping",
|
||||
"is_required": "true",
|
||||
"display_type": "dropdown_text_multiple",
|
||||
"name": "bridge",
|
||||
"hint": "e.g. physnet1:br-eth1"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
18
conf/flavor_metadata/HA-multinodes.conf
Normal file
18
conf/flavor_metadata/HA-multinodes.conf
Normal file
@ -0,0 +1,18 @@
|
||||
FLAVOR = 'HA-multinodes'
|
||||
METADATA = {
|
||||
'ha_proxy': {
|
||||
'_self': {
|
||||
},
|
||||
'vip': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'mapping_to': 'ha_vip'
|
||||
}
|
||||
},
|
||||
'test': {
|
||||
'_self': {
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
2
conf/flavor_metadata/allinone.conf
Normal file
2
conf/flavor_metadata/allinone.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'allinone'
|
||||
METADATA = {}
|
2
conf/flavor_metadata/ceph_firefly.conf
Normal file
2
conf/flavor_metadata/ceph_firefly.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'ceph_firefly'
|
||||
METADATA = {}
|
2
conf/flavor_metadata/ceph_openstack_multinodes.conf
Normal file
2
conf/flavor_metadata/ceph_openstack_multinodes.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'ceph_openstack_multinodes'
|
||||
METADATA = {}
|
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'ceph_openstack_single_controller'
|
||||
METADATA = {}
|
2
conf/flavor_metadata/multinodes.conf
Normal file
2
conf/flavor_metadata/multinodes.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'multinodes'
|
||||
METADATA = {}
|
2
conf/flavor_metadata/single-contoller-multi-compute.conf
Normal file
2
conf/flavor_metadata/single-contoller-multi-compute.conf
Normal file
@ -0,0 +1,2 @@
|
||||
FLAVOR = 'single-contoller-multi-compute'
|
||||
METADATA = {}
|
@ -1,78 +1,83 @@
|
||||
ADAPTER = 'ceph'
|
||||
METADATA = {
|
||||
'global_config': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True,
|
||||
'mapping_to': 'global'
|
||||
},
|
||||
'osd_pool_pg_num': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '1024',
|
||||
'mapping_to': 'osd_pool_pg_num'
|
||||
}
|
||||
},
|
||||
'osd_pool_pgp_num': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '1024',
|
||||
'mapping_to': 'osd_pool_pgp_num'
|
||||
}
|
||||
},
|
||||
'osd_pool_size': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '3',
|
||||
'mapping_to': 'osd_pool_size'
|
||||
}
|
||||
}
|
||||
},
|
||||
'osd_config': {
|
||||
'_self': {
|
||||
'mapping_to': 'osd_config'
|
||||
},
|
||||
'journal_size': {
|
||||
'_self': {
|
||||
'field': 'general',
|
||||
'default_value': '10000',
|
||||
'mapping_to': 'journal_size'
|
||||
}
|
||||
},
|
||||
'op_threads': {
|
||||
'_self': {
|
||||
'field': 'integer',
|
||||
'default_value': 10,
|
||||
'mapping_to': 'op_threads'
|
||||
}
|
||||
}
|
||||
},
|
||||
"osd_devices": {
|
||||
'_self': {
|
||||
'mapping_to': 'osd_devices'
|
||||
},
|
||||
'$device': {
|
||||
'_self': {
|
||||
'validator': is_valid_partition
|
||||
},
|
||||
'journal': {
|
||||
'_self': {
|
||||
'field': 'general',
|
||||
'mapping_to': 'journal'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'network_mapping': {
|
||||
'ceph_config': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True
|
||||
},
|
||||
'$interface_type': {
|
||||
'global_config': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general'
|
||||
'required_in_whole_config': True,
|
||||
'mapping_to': 'global'
|
||||
},
|
||||
'osd_pool_pg_num': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '1024',
|
||||
'mapping_to': 'osd_pool_pg_num'
|
||||
}
|
||||
},
|
||||
'osd_pool_pgp_num': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '1024',
|
||||
'mapping_to': 'osd_pool_pgp_num'
|
||||
}
|
||||
},
|
||||
'osd_pool_size': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general',
|
||||
'default_value': '3',
|
||||
'mapping_to': 'osd_pool_size'
|
||||
}
|
||||
}
|
||||
},
|
||||
'osd_config': {
|
||||
'_self': {
|
||||
'mapping_to': 'osd_config'
|
||||
},
|
||||
'journal_size': {
|
||||
'_self': {
|
||||
'field': 'general',
|
||||
'default_value': '10000',
|
||||
'mapping_to': 'journal_size'
|
||||
}
|
||||
},
|
||||
'op_threads': {
|
||||
'_self': {
|
||||
'field': 'integer',
|
||||
'default_value': 10,
|
||||
'mapping_to': 'op_threads'
|
||||
}
|
||||
}
|
||||
},
|
||||
"osd_devices": {
|
||||
'_self': {
|
||||
'mapping_to': 'osd_devices'
|
||||
},
|
||||
'$device': {
|
||||
'_self': {
|
||||
'validator': is_valid_partition
|
||||
},
|
||||
'journal': {
|
||||
'_self': {
|
||||
'field': 'general',
|
||||
'mapping_to': 'journal'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'network_mapping': {
|
||||
'_self': {
|
||||
'required_in_whole_config': True
|
||||
},
|
||||
'$interface_type': {
|
||||
'_self': {
|
||||
'is_required': True,
|
||||
'field': 'general'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user