Add OS::TripleO::NovaAZConfig

This service is mapped to OS::Heat::None by default, but when enabled,
it uses external deploy tasks to create a new aggregate and zone in
Nova. All Compute nodes in the stack will be added to the zone by
default.

The zone name is the stack name by default, but can be overridden with
parameter values.

Change-Id: I0afb2265949f1222a86b350734e62da673e83aa9
Depends-On:I064f872e20537642880d5482cb9e0c2a801715ef
implements: blueprint split-controlplane-templates
This commit is contained in:
James Slagle 2019-03-20 11:43:47 -04:00
parent cce5a4c58b
commit 0df81abe8e
4 changed files with 103 additions and 0 deletions

View File

@ -0,0 +1,91 @@
heat_template_version: rocky
description: >
Configuration of Nova Availability Zones in the overcloud
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
AdminPassword:
description: The password for the keystone admin account, used for monitoring, querying neutron etc.
type: string
hidden: true
NovaComputeAvailabilityZone:
description: The availability zone where new Nova compute nodes will be
added. If the zone does not already exist, it will be created.
default: ""
type: string
RootStackName:
description: The name of the stack/plan.
type: string
resources:
NovaComputeAvailabilityZoneValue:
type: OS::Heat::Value
properties:
value:
if:
- equals:
- {get_param: NovaComputeAvailabilityZone}
- ""
- {get_param: RootStackName}
- {get_param: NovaComputeAvailabilityZone}
outputs:
role_data:
description: Role data for the Nova Availability Zone configuration service
value:
service_name: nova_az_config
deploy_steps_tasks:
# Step0: Set the hieradata nova::host as a ansible fact so that we can
# use it later in the tasks in external_post_deploy_tasks
- name: Get nova::host value
shell: hiera -c /etc/puppet/hiera.yaml nova::host
register: nova_host_result
when: "step|int == 1"
- name: Set nova_host fact
set_fact:
nova_host: "{{ nova_host_result.stdout }}"
when: "step|int == 1"
external_post_deploy_tasks:
- name: "Nova: Manage aggregate and availability zone and add hosts to the zone"
environment:
# Force openstackclient to not try and read a clouds.yaml as none
# exists for the tripleo-admin user.
OS_CLIENT_CONFIG_FILE: /dev/null
os_nova_host_aggregate:
name: {get_attr: [NovaComputeAvailabilityZoneValue, value]}
availability_zone: {get_attr: [NovaComputeAvailabilityZoneValue, value]}
hosts: "{{ groups['nova_compute'] | default([]) | map('extract', hostvars, 'nova_host') | list }}"
auth:
username: admin
password: {get_param: AdminPassword}
project_name: admin
project_domain_name: Default
user_domain_name: Default
auth_url: { get_param: [EndpointMap, KeystoneV3Public, uri] }

View File

@ -0,0 +1,2 @@
resource_registry:
OS::TripleO::Services::NovaAZConfig: ../deployment/nova/nova-az-config.yaml

View File

@ -200,6 +200,7 @@ resource_registry:
OS::TripleO::Services::NovaScheduler: deployment/nova/nova-scheduler-container-puppet.yaml
OS::TripleO::Services::NovaVncProxy: deployment/nova/nova-vnc-proxy-container-puppet.yaml
OS::TripleO::Services::Novajoin: OS::Heat::None
OS::TripleO::Services::NovaAZConfig: OS::Heat::None
OS::TripleO::Services::ContainersLogrotateCrond: deployment/logrotate/logrotate-crond-container-puppet.yaml
OS::TripleO::Services::OpenShift::Master: OS::Heat::None
OS::TripleO::Services::OpenShift::Worker: OS::Heat::None

View File

@ -0,0 +1,9 @@
---
features:
- A new service, OS::TripleO::Services::NovaAZConfig, is available which can
be used to create a host aggregate and availabiity zone in Nova during the
deployment. Compute nodes in the deployment will also be added to the zone.
The zone name is set with the parameter value NovaComputeAvailabilityZone.
If let unset, it will default to the root stack name. By default the
service is mapped to None, but can be enabled by including
environments/nova-az-config.yaml.