在The previous article described how to deploy OpenStack using Kolla and Kolla-AnsibleIn the configured parts, everything is entirely configured, while others are handled by Kolla-Ansible's templates. However, this approach inevitably leads to a loss of flexibility during deployment, making it impossible to customize special environments. Therefore, the config override method was introduced to allow custom configuration setup. This article will explain how to use config override to modify Kolla-Ansible's deployment configuration files for OpenStack.globals.yml
Table of Contents
Configuration Method
Similarly, in , you can change it to your desired data header.globals.yml` 中我們可以找到一行設定 config overrides 檔案的資料夾。預設值是 `/etc/kolla/config
# Location of configuration overrides
#node_custom_config: "/etc/kolla/config"
Kolla-Ansible will search for the configuration file. In principle, config override can override the entire OpenStack project (e.g. Nova), OpenStack service (e.g. nova-api), or a specific service on a designated host (e.g. nova-api on controller02), which is extremely useful./etc/kolla/config/<< 服務名稱 >>/<< 設定檔 >>
Additionally, if you want to override settings for all services, Kolla-Ansible will look for this file./etc/kolla/config/global.conf
Configuration Example
If you wish to enable CPU and memory passthrough for Virtual Machines in OpenStack, we need to set the cpu_mode parameter in libvirt to host-passthrough
At this point, a new entry is required for the following two lines:/etc/kolla/config/nova/nova-compute.conf
[libvirt]
cpu_mode=host-passthrough
If you want to modify the CPU and RAM allocation ratios on the compute01 host, a new entry will be created Database Pool Size Connection:/etc/kolla/config/nova/compute01/nova-compute.conf
[DEFAULT]
cpu_allocation_ratio = 16.0
ram_allocation_ratio = 2.0
If you want to modify the database pool size connection for all services, a new one will be created. Configuration File for Database Pool Size Connection/etc/kolla/config/global.conf
[database]
max_pool_size = 100
Policy Configuration
The configuration method for policy.json files is slightly different from the default settings of most services, so the complete policy.json file must be placed under the project's data directory. Kolla-Ansible will use this file to overwrite the original default policy.json file.
For example, if you want to override Neutron's policy.json, the operator needs to copy the complete policy.json file from Neutron's original source, modify it, and then place it under ./etc/kolla/config/neutron/policy.json
Post-Deployment Configuration Changes
Modifying configurations in an already deployed OpenStack cluster using Kolla-Ansible is not very difficult; you just need to do the following:
kolla-ansible reconfigure
It will deploy the modified configuration files to the environment and restart the corresponding containers.
Conclusion
Through the config override method, operators can easily customize individual services or even specific services on a host. This makes using Kolla-Ansible to deploy OpenStack more flexible and capable of supporting customized deployments based on different deployment requirements.
Reference
Kolla-Ansible Advanced Configuration
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stated otherwise.