Add ability to deploy extra undercloud node role
Adds a sample role environment that will deploy additional undercloud-like nodes. In order to do this, it is necessary to allow override of the baremetal_image parameter in role files, so that functionality is added too.
This commit is contained in:
parent
7e4e05373f
commit
c288a1ae97
|
@ -45,6 +45,17 @@ Deploy with All Networks Enabled
|
|||
network isolation networks.
|
||||
|
||||
|
||||
Base Configuration Options for Extra Nodes
|
||||
------------------------------------------
|
||||
|
||||
**File:** environments/base-extra-node.yaml
|
||||
|
||||
**Description:** Configuration options that need to be set when deploying an OVB
|
||||
environment with extra undercloud-like nodes. This environment
|
||||
should be used like a role file, but will deploy an undercloud-like
|
||||
node instead of more baremetal nodes.
|
||||
|
||||
|
||||
Base Configuration Options for Secondary Roles
|
||||
----------------------------------------------
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
# *******************************************************************
|
||||
# This file was created automatically by the sample environment
|
||||
# generator. Developers should use `tox -e genconfig` to update it.
|
||||
# Users are recommended to make changes to a copy of the file instead
|
||||
# of the original, if any customizations are needed.
|
||||
# *******************************************************************
|
||||
# title: Base Configuration Options for Extra Nodes
|
||||
# description: |
|
||||
# Configuration options that need to be set when deploying an OVB
|
||||
# environment with extra undercloud-like nodes. This environment
|
||||
# should be used like a role file, but will deploy an undercloud-like
|
||||
# node instead of more baremetal nodes.
|
||||
parameter_defaults:
|
||||
# Recommended to be at least 1 vcpu, 4 GB RAM, 50 GB disk
|
||||
# Type: string
|
||||
baremetal_flavor: baremetal
|
||||
|
||||
# The base image to use for baremetal instances
|
||||
# Type: string
|
||||
baremetal_image: CentOS-7-x86_64-GenericCloud
|
||||
|
||||
# Nova keypair to inject into the undercloud and bmc
|
||||
# Type: string
|
||||
key_name: default
|
||||
|
||||
# Number of baremetal nodes to deploy
|
||||
# Type: number
|
||||
node_count: 2
|
||||
|
||||
# The default role for nodes in this environment. This parameter is
|
||||
# ignored by Heat, but used by build-nodes-json.
|
||||
# Type: string
|
||||
role: extra
|
||||
|
||||
resource_registry:
|
||||
OS::OVB::BaremetalPorts: ../templates/baremetal-ports-extra-node-port-security.yaml
|
|
@ -13,10 +13,6 @@ parameter_defaults:
|
|||
# Type: string
|
||||
baremetal_flavor: baremetal
|
||||
|
||||
# The base image to use for baremetal instances
|
||||
# Type: string
|
||||
baremetal_image: ipxe-boot
|
||||
|
||||
# Nova keypair to inject into the undercloud and bmc
|
||||
# Type: string
|
||||
key_name: default
|
||||
|
|
|
@ -255,13 +255,18 @@ def _process_role(role_file, base_envs, stack_name, args):
|
|||
'overcloud_internal_net', 'overcloud_storage_mgmt_net',
|
||||
'overcloud_storage_net','overcloud_tenant_net',
|
||||
]
|
||||
# Parameters that are inherited but can be overridden by the role
|
||||
allowed_parameter_keys = ['baremetal_image']
|
||||
allowed_registry_keys = ['OS::OVB::BaremetalPorts', 'OS::OVB::BMCPort']
|
||||
role_env = role_data
|
||||
# resource_registry is intentionally omitted as it should not be inherited
|
||||
for section in ['parameters', 'parameter_defaults']:
|
||||
role_env.setdefault(section, {}).update({
|
||||
k: v for k, v in base_data.get(section, {}).items()
|
||||
if k in inherited_keys})
|
||||
if k in inherited_keys and
|
||||
(k not in role_env.get(section, {}) or
|
||||
k not in allowed_parameter_keys)
|
||||
})
|
||||
# Most of the resource_registry should not be included in role envs.
|
||||
# Only allow specific entries that may be needed.
|
||||
role_env.setdefault('resource_registry', {})
|
||||
|
|
|
@ -408,6 +408,7 @@ class TestDeploy(testtools.TestCase):
|
|||
pd_base_data = move_params_to_param_defaults(role_base_data)
|
||||
pd_specific_data = move_params_to_param_defaults(role_specific_data)
|
||||
pd_original_data = move_params_to_param_defaults(role_original_data)
|
||||
pd_specific_data['parameter_defaults']['baremetal_image'] = 'centos'
|
||||
mock_load.return_value = (pd_base_data, pd_specific_data,
|
||||
pd_original_data)
|
||||
args = mock.Mock()
|
||||
|
@ -423,6 +424,9 @@ class TestDeploy(testtools.TestCase):
|
|||
output['parameters']['baremetal_prefix'])
|
||||
self.assertEqual('bmc-foo-compute',
|
||||
output['parameters']['bmc_prefix'])
|
||||
# This parameter should be inherited (as tested above) but overrideable
|
||||
self.assertEqual('centos',
|
||||
output['parameter_defaults']['baremetal_image'])
|
||||
|
||||
@mock.patch('openstack_virtual_baremetal.deploy._deploy')
|
||||
@mock.patch('openstack_virtual_baremetal.deploy._process_role')
|
||||
|
|
|
@ -35,13 +35,32 @@ environments:
|
|||
templates/quintupleo.yaml:
|
||||
parameters:
|
||||
- baremetal_flavor
|
||||
- baremetal_image
|
||||
- key_name
|
||||
- node_count
|
||||
- role
|
||||
sample_values:
|
||||
role: compute
|
||||
baremetal_image: ipxe-boot
|
||||
-
|
||||
name: base-extra-node
|
||||
title: Base Configuration Options for Extra Nodes
|
||||
description: |
|
||||
Configuration options that need to be set when deploying an OVB
|
||||
environment with extra undercloud-like nodes. This environment
|
||||
should be used like a role file, but will deploy an undercloud-like
|
||||
node instead of more baremetal nodes.
|
||||
files:
|
||||
templates/quintupleo.yaml:
|
||||
parameters:
|
||||
- baremetal_flavor
|
||||
- baremetal_image
|
||||
- key_name
|
||||
- node_count
|
||||
- role
|
||||
sample_values:
|
||||
role: extra
|
||||
baremetal_image: CentOS-7-x86_64-GenericCloud
|
||||
resource_registry:
|
||||
OS::OVB::BaremetalPorts: ../templates/baremetal-ports-extra-node-port-security.yaml
|
||||
-
|
||||
name: all-networks
|
||||
title: Deploy with All Networks Enabled
|
||||
|
|
Loading…
Reference in New Issue