Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Composable services and custom roles
The overcloud usually consists of nodes in predefined roles such as Controller nodes, Compute nodes, and different storage node types. Each of these default roles contains a set of services defined in the core heat template collection on the director node. However, you can also create custom roles that contain specific sets of services.
You can use this flexibility to create different combinations of services on different roles. This chapter explores the architecture of custom roles, composable services, and methods for using them.
2.1. Supported role architecture Copia collegamentoCollegamento copiato negli appunti!
The following architectures are available when you use custom roles and composable services:
- Default architecture
-
Uses the default
roles_datafiles. All controller services are contained within one Controller role. - Custom composable services
-
Create your own roles and use them to generate a custom
roles_datafile. Note that only a limited number of composable service combinations have been tested and verified and Red Hat cannot support all composable service combinations.
2.2. Examining the roles_data file Copia collegamentoCollegamento copiato negli appunti!
The roles_data file contains a YAML-formatted list of the roles that director deploys onto nodes. Each role contains definitions of all of the services that comprise the role. Use the following example snippet to understand the roles_data syntax:
The core heat template collection contains a default roles_data file located at /usr/share/openstack-tripleo-heat-templates/roles_data.yaml. The default file contains definitions of the following role types:
-
Controller -
Compute -
BlockStorage -
ObjectStorage -
CephStorage.
The openstack overcloud deploy command includes the default roles_data.yaml file during deployment. However, you can use the -r argument to override this file with a custom roles_data file:
openstack overcloud deploy --templates -r ~/templates/roles_data-custom.yaml
$ openstack overcloud deploy --templates -r ~/templates/roles_data-custom.yaml
2.3. Creating a roles_data file Copia collegamentoCollegamento copiato negli appunti!
Although you can create a custom roles_data file manually, you can also generate the file automatically using individual role templates. Director provides the openstack overcloud role generate command to join multiple predefined roles and automatically generate a custom roles_data file.
Procedure
List the default role templates:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow View the role definition:
openstack overcloud role show Compute
$ openstack overcloud role show ComputeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a custom
roles_data.yamlfile that contains theController,Compute, andNetworkerroles:openstack overcloud roles \ generate -o <custom_role_file> \ Controller Compute Networker
$ openstack overcloud roles \ generate -o <custom_role_file> \ Controller Compute NetworkerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<custom_role_file>with the name and location of the new role file to generate, for example,/home/stack/templates/roles_data.yaml.NoteThe
ControllerandNetworkerroles contain the same networking agents. This means that the networking services scale from theControllerrole to theNetworkerrole and the overcloud balances the load for networking services between theControllerandNetworkernodes.To make this
Networkerrole standalone, you can create your own customControllerrole, as well as any other role that you require. This allows you to generate aroles_data.yamlfile from your own custom roles.
Copy the
rolesdirectory from the core heat template collection to the home directory of thestackuser:cp -r /usr/share/openstack-tripleo-heat-templates/roles/. /home/stack/templates/roles/
$ cp -r /usr/share/openstack-tripleo-heat-templates/roles/. /home/stack/templates/roles/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add or modify the custom role files in this directory. Use the
--roles-pathoption with any of the role sub-commands to use this directory as the source for your custom roles:openstack overcloud role \ generate -o my_roles_data.yaml \ --roles-path /home/stack/templates/roles \ Controller Compute Networker
$ openstack overcloud role \ generate -o my_roles_data.yaml \ --roles-path /home/stack/templates/roles \ Controller Compute NetworkerCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command generates a single
my_roles_data.yamlfile from the individual roles in the~/rolesdirectory.
The default roles collection also contains the ControllerOpenstack role, which does not include services for Networker, Messaging, and Database roles. You can use the ControllerOpenstack in combination with the standalone Networker, Messaging, and Database roles.
2.4. Supported custom roles Copia collegamentoCollegamento copiato negli appunti!
The following table contains information about the available custom roles. You can find custom role templates in the /usr/share/openstack-tripleo-heat-templates/roles directory.
| Role | Description | File |
|---|---|---|
|
| OpenStack Block Storage (cinder) node. |
|
|
| Full standalone Ceph Storage node. Includes OSD, MON, Object Gateway (RGW), Object Operations (MDS), Manager (MGR), and RBD Mirroring. |
|
|
| Standalone scale-out Ceph Storage file role. Includes OSD and Object Operations (MDS). |
|
|
| Standalone scale-out Ceph Storage object role. Includes OSD and Object Gateway (RGW). |
|
|
| Ceph Storage OSD node role. |
|
|
| Alternate Compute node role. |
|
|
| DVR enabled Compute node role. |
|
|
| Compute node with hyper-converged infrastructure. Includes Compute and Ceph OSD services. |
|
|
|
Compute Instance HA node role. Use in conjunction with the |
|
|
| Compute node with Cavium Liquidio Smart NIC. |
|
|
| Compute OVS DPDK RealTime role. |
|
|
| Compute OVS DPDK role. |
|
|
|
Compute role optimized for real-time behaviour. When using this role, it is mandatory that an |
|
|
| Compute SR-IOV RealTime role. |
|
|
| Compute SR-IOV role. |
|
|
| Standard Compute node role. |
|
|
|
Controller role that does not contain the database, messaging, networking, and OpenStack Compute (nova) control components. Use in combination with the |
|
|
| Controller role with core Controller services loaded but no Ceph Storage (MON) components. This role handles database, messaging, and network functions but not any Ceph Storage functions. |
|
|
|
Controller role that does not contain the OpenStack Compute (nova) control component. Use in combination with the |
|
|
|
Controller role that does not contain the database, messaging, and networking components. Use in combination with the |
|
|
| Controller role with all core services loaded and uses Ceph NFS. This roles handles database, messaging, and network functions. |
|
|
| Controller role with all core services loaded. This roles handles database, messaging, and network functions. |
|
|
| Same as the normal Controller role but with the OVN Metadata agent deployed. |
|
|
| Standalone database role. Database managed as a Galera cluster using Pacemaker. |
|
|
| Compute node with hyper-converged infrastructure and all Ceph Storage services. Includes OSD, MON, Object Gateway (RGW), Object Operations (MDS), Manager (MGR), and RBD Mirroring. |
|
|
| Compute node with hyper-converged infrastructure and Ceph Storage file services. Includes OSD and Object Operations (MDS). |
|
|
| Compute node with hyper-converged infrastructure and Ceph Storage block services. Includes OSD, MON, and Manager. |
|
|
| Compute node with hyper-converged infrastructure and Ceph Storage object services. Includes OSD and Object Gateway (RGW). |
|
|
| Ironic Conductor node role. |
|
|
| Standalone messaging role. RabbitMQ managed with Pacemaker. |
|
|
| Standalone networking role. Runs OpenStack networking (neutron) agents on their own. If your deployment uses the ML2/OVN mechanism driver, see additional steps in Deploying a Custom Role with ML2/OVN. |
|
|
| Same as the normal Networker role but with the OVN Metadata agent deployed. See additional steps in Deploying a Custom Role with ML2/OVN. |
|
|
|
Standalone |
|
|
| Swift Object Storage node role. |
|
|
| Telemetry role with all the metrics and alarming services. |
|
2.5. Examining role parameters Copia collegamentoCollegamento copiato negli appunti!
Each role contains the following parameters:
- name
-
(Mandatory) The name of the role, which is a plain text name with no spaces or special characters. Check that the chosen name does not cause conflicts with other resources. For example, use
Networkeras a name instead ofNetwork. - description
- (Optional) A plain text description for the role.
- tags
(Optional) A YAML list of tags that define role properties. Use this parameter to define the primary role with both the
controllerandprimarytags together:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you do not tag the primary role, the first role that you define becomes the primary role. Ensure that this role is the Controller role.
- networks
A YAML list or dictionary of networks that you want to configure on the role. If you use a YAML list, list each composable network:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you use a dictionary, map each network to a specific
subnetin your composable networks.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Default networks include
External,InternalApi,Storage,StorageMgmt,Tenant, andManagement.- CountDefault
- (Optional) Defines the default number of nodes that you want to deploy for this role.
- HostnameFormatDefault
(Optional) Defines the default hostname format for the role. The default naming convention uses the following format:
[STACK NAME]-[ROLE NAME]-[NODE ID]
[STACK NAME]-[ROLE NAME]-[NODE ID]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, the default Controller nodes are named:
overcloud-controller-0 overcloud-controller-1 overcloud-controller-2 ...
overcloud-controller-0 overcloud-controller-1 overcloud-controller-2 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow - disable_constraints
- (Optional) Defines whether to disable OpenStack Compute (nova) and OpenStack Image Storage (glance) constraints when deploying with director. Use this parameter when you deploy an overcloud with pre-provisioned nodes. For more information, see Configuring a basic overcloud with pre-provisioned nodes in the Director installation and usage guide.
- update_serial
(Optional) Defines how many nodes to update simultaneously during the OpenStack update options. In the default
roles_data.yamlfile:-
The default is
1for Controller, Object Storage, and Ceph Storage nodes. -
The default is
25for Compute and Block Storage nodes.
If you omit this parameter from a custom role, the default is
1.-
The default is
- ServicesDefault
- (Optional) Defines the default list of services to include on the node. For more information, see Section 2.10, “Examining composable service architecture”.
You can use these parameters to create new roles and also define which services to include in your roles.
The openstack overcloud deploy command integrates the parameters from the roles_data file into some of the Jinja2-based templates. For example, at certain points, the overcloud.j2.yaml heat template iterates over the list of roles from roles_data.yaml and creates parameters and resources specific to each respective role.
For example, the following snippet contains the resource definition for each role in the overcloud.j2.yaml heat template:
This snippet shows how the Jinja2-based template incorporates the {{role.name}} variable to define the name of each role as an OS::Heat::ResourceGroup resource. This in turn uses each name parameter from the roles_data file to name each respective OS::Heat::ResourceGroup resource.
2.6. Creating a new role Copia collegamentoCollegamento copiato negli appunti!
You can use the composable service architecture to assign roles to bare-metal nodes according to the requirements of your deployment. For example, you might want to create a new Horizon role to host only the OpenStack Dashboard (horizon).
Procedure
-
Log in to the undercloud as the
stackuser. Source the
stackrcfile:source ~/stackrc
[stack@director ~]$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the
rolesdirectory from the core heat template collection to the home directory of thestackuser:cp -r /usr/share/openstack-tripleo-heat-templates/roles/. /home/stack/templates/roles/
$ cp -r /usr/share/openstack-tripleo-heat-templates/roles/. /home/stack/templates/roles/Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create a new file named
Horizon.yamlinhome/stack/templates/roles. Add the following configuration to
Horizon.yamlto create a newHorizonrole that contains the base and core OpenStack Dashboard services:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you want to scale the services in an existing overcloud, retain the existing services on the
Controllerrole. If you want to create a new overcloud and you want the OpenStack Dashboard to remain on the standalone role, remove the OpenStack Dashboard components from theControllerrole definition:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a new roles data file named
roles_data_horizon.yamlthat includes theController,Compute, andHorizonroles:openstack overcloud roles \ generate -o /home/stack/templates/roles_data_horizon.yaml \ --roles-path /home/stack/templates/roles \ Controller Compute Horizon
(undercloud)$ openstack overcloud roles \ generate -o /home/stack/templates/roles_data_horizon.yaml \ --roles-path /home/stack/templates/roles \ Controller Compute HorizonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Edit the
overcloud-baremetal-deploy.yamlnode definition file to configure the placement of the Horizon node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.7. Guidelines and limitations Copia collegamentoCollegamento copiato negli appunti!
Note the following guidelines and limitations for the composable role architecture.
For services not managed by Pacemaker:
- You can assign services to standalone custom roles.
- You can create additional custom roles after the initial deployment and deploy them to scale existing services.
For services managed by Pacemaker:
- You can assign Pacemaker-managed services to standalone custom roles.
-
Pacemaker has a 16 node limit. If you assign the Pacemaker service (
OS::TripleO::Services::Pacemaker) to 16 nodes, subsequent nodes must use the Pacemaker Remote service (OS::TripleO::Services::PacemakerRemote) instead. You cannot have the Pacemaker service and Pacemaker Remote service on the same role. -
Do not include the Pacemaker service (
OS::TripleO::Services::Pacemaker) on roles that do not contain Pacemaker-managed services. -
You cannot scale up or scale down a custom role for a controller that contains
OS::TripleO::Services::PacemakerorOS::TripleO::Services::PacemakerRemoteservices.
General limitations:
- You cannot change custom roles and composable services during a major version upgrade.
- You cannot modify the list of services for any role after deploying an overcloud. Modifying the service lists after Overcloud deployment can cause deployment errors and leave orphaned services on nodes.
2.8. Containerized service architecture Copia collegamentoCollegamento copiato negli appunti!
Director installs the core OpenStack Platform services as containers on the overcloud. The templates for the containerized services are located in the /usr/share/openstack-tripleo-heat-templates/deployment/.
You must enable the OS::TripleO::Services::Podman service in the role for all nodes that use containerized services. When you create a roles_data.yaml file for your custom roles configuration, include the OS::TripleO::Services::Podman service along with the base composable services. For example, the IronicConductor role uses the following role definition:
2.9. Containerized service parameters Copia collegamentoCollegamento copiato negli appunti!
Each containerized service template contains an outputs section that defines a data set passed to the OpenStack Orchestration (heat) service. In addition to the standard composable service parameters, the template contains a set of parameters specific to the container configuration.
puppet_configData to pass to Puppet when configuring the service. In the initial overcloud deployment steps, director creates a set of containers used to configure the service before the actual containerized service runs. This parameter includes the following sub-parameters:
-
config_volume- The mounted volume that stores the configuration. -
puppet_tags- Tags to pass to Puppet during configuration. OpenStack uses these tags to restrict the Puppet run to the configuration resource of a particular service. For example, the OpenStack Identity (keystone) containerized service uses thekeystone_configtag to ensure that all require only thekeystone_configPuppet resource run on the configuration container. -
step_config- The configuration data passed to Puppet. This is usually inherited from the referenced composable service. -
config_image- The container image used to configure the service.
-
kolla_config- A set of container-specific data that defines configuration file locations, directory permissions, and the command to run on the container to launch the service.
docker_configTasks to run on the configuration container for the service. All tasks are grouped into the following steps to help director perform a staged deployment:
- Step 1 - Load balancer configuration
- Step 2 - Core services (Database, Redis)
- Step 3 - Initial configuration of OpenStack Platform service
- Step 4 - General OpenStack Platform services configuration
- Step 5 - Service activation
host_prep_tasks- Preparation tasks for the bare metal node to accommodate the containerized service.
2.10. Examining composable service architecture Copia collegamentoCollegamento copiato negli appunti!
The core heat template collection contains two sets of composable service templates:
-
deploymentcontains the templates for key OpenStack services. -
puppet/servicescontains legacy templates for configuring composable services. In some cases, the composable services use templates from this directory for compatibility. In most cases, the composable services use the templates in thedeploymentdirectory.
Each template contains a description that identifies its purpose. For example, the deployment/time/ntp-baremetal-puppet.yaml service template contains the following description:
description: > NTP service deployment using puppet, this YAML file creates the interface between the HOT template and the puppet manifest that actually installs and configure NTP.
description: >
NTP service deployment using puppet, this YAML file
creates the interface between the HOT template
and the puppet manifest that actually installs
and configure NTP.
These service templates are registered as resources specific to a Red Hat OpenStack Platform deployment. This means that you can call each resource using a unique heat resource namespace defined in the overcloud-resource-registry-puppet.j2.yaml file. All services use the OS::TripleO::Services namespace for their resource type.
Some resources use the base composable service templates directly:
resource_registry: ... OS::TripleO::Services::Ntp: deployment/time/ntp-baremetal-puppet.yaml ...
resource_registry:
...
OS::TripleO::Services::Ntp: deployment/time/ntp-baremetal-puppet.yaml
...
However, core services require containers and use the containerized service templates. For example, the keystone containerized service uses the following resource:
resource_registry: ... OS::TripleO::Services::Keystone: deployment/keystone/keystone-container-puppet.yaml ...
resource_registry:
...
OS::TripleO::Services::Keystone: deployment/keystone/keystone-container-puppet.yaml
...
These containerized templates usually reference other templates to include dependencies. For example, the deployment/keystone/keystone-container-puppet.yaml template stores the output of the base template in the ContainersCommon resource:
resources:
ContainersCommon:
type: ../containers-common.yaml
resources:
ContainersCommon:
type: ../containers-common.yaml
The containerized template can then incorporate functions and data from the containers-common.yaml template.
The overcloud.j2.yaml heat template includes a section of Jinja2-based code to define a service list for each custom role in the roles_data.yaml file:
For the default roles, this creates the following service list parameters: ControllerServices, ComputeServices, BlockStorageServices, ObjectStorageServices, and CephStorageServices.
You define the default services for each custom role in the roles_data.yaml file. For example, the default Controller role contains the following content:
These services are then defined as the default list for the ControllerServices parameter.
You can also use an environment file to override the default list for the service parameters. For example, you can define ControllerServices as a parameter_default in an environment file to override the services list from the roles_data.yaml file.
2.11. Adding and removing services from roles Copia collegamentoCollegamento copiato negli appunti!
The basic method of adding or removing services involves creating a copy of the default service list for a node role and then adding or removing services. For example, you might want to remove OpenStack Orchestration (heat) from the Controller nodes.
Procedure
Create a custom copy of the default
rolesdirectory:cp -r /usr/share/openstack-tripleo-heat-templates/roles ~/.
$ cp -r /usr/share/openstack-tripleo-heat-templates/roles ~/.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
~/roles/Controller.yamlfile and modify the service list for theServicesDefaultparameter. Scroll to the OpenStack Orchestration services and remove them:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate the new
roles_datafile:openstack overcloud roles generate -o roles_data-no_heat.yaml \ --roles-path ~/roles \ Controller Compute Networker
$ openstack overcloud roles generate -o roles_data-no_heat.yaml \ --roles-path ~/roles \ Controller Compute NetworkerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Include this new
roles_datafile when you run theopenstack overcloud deploycommand:openstack overcloud deploy --templates -r ~/templates/roles_data-no_heat.yaml
$ openstack overcloud deploy --templates -r ~/templates/roles_data-no_heat.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command deploys an overcloud without OpenStack Orchestration services installed on the Controller nodes.
You can also disable services in the roles_data file using a custom environment file. Redirect the services to disable to the OS::Heat::None resource. For example:
resource_registry: OS::TripleO::Services::HeatApi: OS::Heat::None OS::TripleO::Services::HeatApiCfn: OS::Heat::None OS::TripleO::Services::HeatApiCloudwatch: OS::Heat::None OS::TripleO::Services::HeatEngine: OS::Heat::None
resource_registry:
OS::TripleO::Services::HeatApi: OS::Heat::None
OS::TripleO::Services::HeatApiCfn: OS::Heat::None
OS::TripleO::Services::HeatApiCloudwatch: OS::Heat::None
OS::TripleO::Services::HeatEngine: OS::Heat::None
2.12. Enabling disabled services Copia collegamentoCollegamento copiato negli appunti!
Some services are disabled by default. These services are registered as null operations (OS::Heat::None) in the overcloud-resource-registry-puppet.j2.yaml file. For example, the Block Storage backup service (cinder-backup) is disabled:
OS::TripleO::Services::CinderBackup: OS::Heat::None
OS::TripleO::Services::CinderBackup: OS::Heat::None
To enable this service, include an environment file that links the resource to its respective heat templates in the puppet/services directory. Some services have predefined environment files in the environments directory. For example, the Block Storage backup service uses the environments/cinder-backup.yaml file, which contains the following entry:
Procedure
Add an entry in an environment file that links the
CinderBackupservice to the heat template that contains thecinder-backupconfiguration:resource_registry: OS::TripleO::Services::CinderBackup: ../podman/services/pacemaker/cinder-backup.yaml ...
resource_registry: OS::TripleO::Services::CinderBackup: ../podman/services/pacemaker/cinder-backup.yaml ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow This entry overrides the default null operation resource and enables the service.
Include this environment file when you run the
openstack overcloud deploycommand:openstack overcloud deploy --templates -e /usr/share/openstack-tripleo-heat-templates/environments/cinder-backup.yaml
$ openstack overcloud deploy --templates -e /usr/share/openstack-tripleo-heat-templates/environments/cinder-backup.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow