From 9229315a1adea8ebbddb182c20e4d1202fc0168a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Fri, 8 Feb 2019 22:38:43 -0600 Subject: [PATCH] Add option to disable container builds on specific hosts This change adds an option to disable any and all containers within a given host The new option "no_containers" is a boolean option and has a default value of false. When set true no containers will be created in inventory for a given machine. This will allow deployers to simply disable container builds on specific machines when nessisary. This is usefule when a deployer simply wants to deploy openstack in a flattened environment. This has also been useful in cases where infrastructure hosts may reside within virtualization solutions like OpenStack, VirtualBox, or VMWare which implement strong port security rules which makes container networking difficult or impossible. To implement the change simply add the "no_containers: true|false" option to a host entry in the openstack_user_config.yml Change-Id: I8bed3e498a431e2683956e1009d9d9ece9fdb272 Signed-off-by: Kevin Carter --- osa_toolkit/generate.py | 3 +++ .../no_containers_option-39034d48825e8966.yaml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/no_containers_option-39034d48825e8966.yaml diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index 158edd5398..6ddd731eae 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -354,6 +354,9 @@ def _add_container_hosts(assignment, config, container_name, container_type, # Get any set host options host_options = config[physical_host_type][host_type] affinity = host_options.get('affinity', {}) + no_containers = host_options.get('no_containers', False) + if no_containers: + properties['is_metal'] = True container_affinity = affinity.get(container_name, 1) # Ensures that container names are not longer than 63 diff --git a/releasenotes/notes/no_containers_option-39034d48825e8966.yaml b/releasenotes/notes/no_containers_option-39034d48825e8966.yaml new file mode 100644 index 0000000000..9df5e952e4 --- /dev/null +++ b/releasenotes/notes/no_containers_option-39034d48825e8966.yaml @@ -0,0 +1,18 @@ +--- +features: + - | + A new option has been added allowing deployers to disable any and all + containers on a given host. The option `no_containers` is a boolean + which, if undefined, will default to *false*. This option can be added + to any host in the `openstack_user_config.yml` or via an override in + `conf.d`. When this option is set to *true* the given host will be + treated as a baremetal machine. The new option mirrors the existing + environmental option `is_metal` but allows deployers to target + specific hosts instead of entire groups. + + .. code-block:: yaml + + log_hosts: + infra-1: + ip: 172.16.24.2 + no_containers: true