Merge "Add hook to generate metadata from service profiles"

This commit is contained in:
Jenkins 2016-12-22 12:08:12 +00:00 committed by Gerrit Code Review
commit d291083e7f
10 changed files with 47 additions and 0 deletions

View File

@ -41,6 +41,8 @@ resource_registry:
# in the jinja loop
OS::TripleO::Controller::Net::SoftwareConfig: net-config-bridge.yaml
OS::TripleO::ServiceServerMetadataHook: OS::Heat::None
OS::TripleO::Server: OS::Nova::Server
# This creates the "heat-admin" user for all OS images by default

View File

@ -363,6 +363,7 @@ resources:
services: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
ServiceNames: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChain, role_data, monitoring_subscriptions]}
ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChain, role_data, service_metadata_settings]}
{% endfor %}
hostsConfig:

View File

@ -102,6 +102,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -137,6 +140,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: BlockStorageServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: BlockStorageSchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -108,6 +108,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -143,6 +146,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: CephStorageServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: CephStorageSchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -120,6 +120,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -157,6 +160,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: NovaComputeServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: NovaComputeSchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -134,6 +134,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -176,6 +179,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: ControllerServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: ControllerSchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -102,6 +102,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -137,6 +140,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: SwiftStorageServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: ObjectStorageSchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -118,6 +118,9 @@ parameters:
MonitoringSubscriptions:
type: comma_delimited_list
default: []
ServiceMetadataSettings:
type: json
default: {}
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
@ -160,6 +163,7 @@ resources:
map_merge:
- {get_param: ServerMetadata}
- {get_param: {{role}}ServerMetadata}
- {get_param: ServiceMetadataSettings}
scheduler_hints: {get_param: {{role}}SchedulerHints}
# Combine the NodeAdminUserData and NodeUserData mime archives

View File

@ -74,3 +74,17 @@ step, "step2" for the second, etc.
6) Start control-plane services
7) Any additional online migration tasks (e.g data migrations)
Nova Server Metadata Settings
-----------------------------
One can use the hook of type `OS::TripleO::ServiceServerMetadataHook` to pass
entries to the nova instances' metadata. It is, however, disabled by default.
In order to overwrite it one needs to define it in the resource registry. An
implementation of this hook needs to conform to the following:
* It needs to define an input called `RoleData` of json type. This gets as
input the contents of the `role_data` for each role's ServiceChain.
* This needs to define an output called `metadata` which will be given to the
Nova Server resource as the instance's metadata.

View File

@ -42,6 +42,11 @@ resources:
LoggingConfiguration:
type: OS::TripleO::LoggingConfiguration
ServiceServerMetadataHook:
type: OS::TripleO::ServiceServerMetadataHook
properties:
RoleData: {get_attr: [ServiceChain, role_data]}
outputs:
role_data:
description: Combined Role data for this set of services.
@ -113,3 +118,4 @@ outputs:
# Note we use distinct() here to filter any identical tasks, e.g yum update for all services
expression: $.data.where($ != null).select($.get('upgrade_tasks')).where($ != null).flatten().distinct()
data: {get_attr: [ServiceChain, role_data]}
service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]}