Merge "Make BMC optional"

This commit is contained in:
Zuul 2019-03-27 21:45:42 +00:00 committed by Gerrit Code Review
commit 7966bfa15e
9 changed files with 206 additions and 140 deletions

View File

@ -105,6 +105,16 @@ Create a Private Network
existing one.
Disable BMC
-----------
**File:** environments/disable-bmc.yaml
**Description:** Deploy a stack without a BMC. This will obviously make it impossible to
control the instances via IPMI. It will also prevent use of
ovb-build-nodes-json because there will be no BMC addresses.
Public Network External Router
------------------------------

View File

@ -0,0 +1,13 @@
# *******************************************************************
# 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: Disable BMC
# description: |
# Deploy a stack without a BMC. This will obviously make it impossible to
# control the instances via IPMI. It will also prevent use of
# ovb-build-nodes-json because there will be no BMC addresses.
resource_registry:
OS::OVB::BMC: ../templates/bmc-none.yaml

View File

@ -219,6 +219,8 @@ def _deploy(stack_name, stack_template, env_paths, poll):
all_files = {}
all_files.update(template_files)
all_files.update(env_files)
# NOTE(bnemec): Unfortunately, we can't pass this in as parameter_default
# because the Heat API doesn't accept parameter_defaults.
parameters = {'cloud_data': auth._cloud_json()}
hclient.stacks.create(stack_name=stack_name,
@ -303,7 +305,7 @@ def _process_role(role_file, base_envs, stack_name, args):
'overcloud_tenant_net',
]
allowed_registry_keys = ['OS::OVB::BaremetalPorts', 'OS::OVB::BMCPort',
'OS::OVB::UndercloudNetworks',
'OS::OVB::UndercloudNetworks', 'OS::OVB::BMC',
]
# NOTE(bnemec): Not sure what purpose this serves. Can probably be removed.
role_env = role_data

View File

@ -185,7 +185,7 @@ environments:
the host cloud, but at the cost of potential inconsistency if the state
of a baremetal instance is changed without using the BMC.
files:
templates/virtual-baremetal.yaml:
templates/bmc.yaml:
parameters:
- bmc_use_cache
sample_values:
@ -254,4 +254,13 @@ environments:
traffic through the undercloud.
resource_registry:
OS::OVB::UndercloudNetworks: ../templates/undercloud-networks-public-router.yaml
-
name: disable-bmc
title: Disable BMC
description: |
Deploy a stack without a BMC. This will obviously make it impossible to
control the instances via IPMI. It will also prevent use of
ovb-build-nodes-json because there will be no BMC addresses.
resource_registry:
OS::OVB::BMC: ../templates/bmc-none.yaml

10
templates/bmc-none.yaml Normal file
View File

@ -0,0 +1,10 @@
heat_template_version: newton
parameters:
cloud_data:
type: string
hidden: true
resources:
bmc:
type: OS::Heat::None

155
templates/bmc.yaml Normal file
View File

@ -0,0 +1,155 @@
heat_template_version: newton
parameters:
bmc_flavor:
type: string
default: m1.small
description: The Nova flavor to use for the bmc instance
bmc_image:
type: string
default: CentOS-7-x86_64-GenericCloud
description: |
The base image for the bmc instance. A CentOS 7 image is currently the
only one supported.
bmc_use_cache:
type: boolean
default: false
description: |
Enable instance status caching on the BMC. This can reduce load on the
host cloud, but if an instance's status is changed outside the BMC it may
become out of sync.
key_name:
type: string
default: default
description: Nova keypair to inject into the undercloud and bmc
private_net:
type: string
default: private
description: Name of a private network which can have floating ips associated with it
bmc_prefix:
type: string
default: bmc
description: Prefix for the name of the bmc instance
os_user:
type: string
default: admin
description: |
The user on the host cloud that will be used to provision the
environment
os_password:
type: string
default: password
hidden: true
description: The password for os_user
os_tenant:
type: string
default: admin
description: The tenant for os_user
os_auth_url:
type: string
default: http://127.0.0.1:5000/v2.0
description: The Keystone auth_url of the host cloud
os_project:
type: string
default: ''
description: |
The project for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
os_user_domain:
type: string
default: ''
description: |
The user domain for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
os_project_domain:
type: string
default: ''
description: |
The project domain for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
cloud_data:
type: string
hidden: true
baremetal_prefix:
type: string
default: baremetal
description: Prefix for the name of the baremetal instances
node_count:
type: number
description: Number of baremetal nodes to deploy
resources:
bmc_port:
type: OS::OVB::BMCPort
properties:
bmc_prefix: {get_param: bmc_prefix}
private_net: {get_param: private_net}
bmc_other_ports:
type: OS::Heat::ResourceGroup
properties:
count: {get_param: node_count}
resource_def:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - {get_param: bmc_prefix}
- _%index%
network: {get_param: private_net}
bmc_handle:
type: OS::Heat::WaitConditionHandle
bmc_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: bmc_handle}
timeout: 600
bmc_server:
type: OS::Nova::Server
depends_on: [bmc_other_ports, bmc_port]
properties:
flavor: {get_param: bmc_flavor}
image: {get_param: bmc_image}
key_name: {get_param: key_name}
networks: {get_attr: [bmc_port, port]}
name: {get_param: bmc_prefix}
user_data_format: RAW
user_data:
str_replace:
params:
$os_user: {get_param: os_user}
$os_password: {get_param: os_password}
$os_tenant: {get_param: os_tenant}
$os_auth_url: {get_param: os_auth_url}
$os_project: {get_param: os_project}
$os__user_domain: {get_param: os_user_domain}
$os__project_domain: {get_param: os_project_domain}
$bm_node_count: {get_param: node_count}
$bmc_prefix: {get_param: bmc_prefix}
$bmc_utility: {get_attr: [bmc_port, ip_address]}
$bmc_use_cache: {get_param: bmc_use_cache}
$bm_prefix: {get_param: baremetal_prefix}
$private_net: {get_param: private_net}
$openstackbmc_script: {get_file: ../bin/openstackbmc}
$cloud_data: {get_param: cloud_data}
$signal_command: {get_attr: [bmc_handle, curl_cli]}
template: {get_file: ../bin/install_openstackbmc.sh}

View File

@ -183,17 +183,7 @@ resources:
node_count: {get_param: node_count}
private_net: {get_attr: [private_network, private_net]}
networks: {get_attr: [undercloud_networks, networks]}
bmc_flavor: {get_param: bmc_flavor}
bmc_prefix: {get_param: bmc_prefix}
bmc_image: {get_param: bmc_image}
baremetal_prefix: {get_param: baremetal_prefix}
os_user: {get_param: os_user}
os_password: {get_param: os_password}
os_tenant: {get_param: os_tenant}
os_auth_url: {get_param: os_auth_url}
os_project: {get_param: os_project}
os_user_domain: {get_param: os_user_domain}
os_project_domain: {get_param: os_project_domain}
cloud_data: {get_param: cloud_data}
dhcp_ips: {get_param: dhcp_ips}

View File

@ -6,6 +6,7 @@ resource_registry:
OS::OVB::PrivateNetwork: private-net-existing.yaml
OS::OVB::BaremetalNetworks: baremetal-networks-none.yaml
OS::OVB::BaremetalPorts: baremetal-ports-default.yaml
OS::OVB::BMC: bmc.yaml
OS::OVB::BMCPort: bmc-port.yaml
OS::OVB::UndercloudPorts: undercloud-ports.yaml
OS::OVB::UndercloudNetworks: undercloud-networks.yaml

View File

@ -5,26 +5,6 @@ description: Template for deploying OpenStack BMC nodes. Can be wrapped in a Re
# Ensure force_config_drive is _not_ set in nova.conf
parameters:
bmc_flavor:
type: string
default: m1.small
description: The Nova flavor to use for the bmc instance
bmc_image:
type: string
default: CentOS-7-x86_64-GenericCloud
description: |
The base image for the bmc instance. A CentOS 7 image is currently the
only one supported.
bmc_use_cache:
type: boolean
default: false
description: |
Enable instance status caching on the BMC. This can reduce load on the
host cloud, but if an instance's status is changed outside the BMC it may
become out of sync.
baremetal_flavor:
type: string
default: baremetal
@ -55,11 +35,6 @@ parameters:
default: {"private": "private", "provision": "provision"}
description: A map of networks to their names.
bmc_prefix:
type: string
default: bmc
description: Prefix for the name of the bmc instance
baremetal_prefix:
type: string
default: baremetal
@ -73,53 +48,8 @@ parameters:
The value should usually include '%index%' to differentiate multiple
instances. For example: 'my-custom-name-%index%'
os_user:
type: string
default: admin
description: |
The user on the host cloud that will be used to provision the
environment
os_password:
type: string
default: password
hidden: true
description: The password for os_user
os_tenant:
type: string
default: admin
description: The tenant for os_user
os_auth_url:
type: string
default: http://127.0.0.1:5000/v2.0
description: The Keystone auth_url of the host cloud
os_project:
type: string
default: ''
description: |
The project for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
os_user_domain:
type: string
default: ''
description: |
The user domain for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
os_project_domain:
type: string
default: ''
description: |
The project domain for os_user. Required for Keystone v3, should be left
blank for Keystone v2.
cloud_data:
type: string
default: '{}'
hidden: true
dhcp_ips:
@ -159,65 +89,11 @@ conditions:
- ''
resources:
bmc_port:
type: OS::OVB::BMCPort
bmc:
type: OS::OVB::BMC
depends_on: openstack_baremetal_servers
properties:
bmc_prefix: {get_param: bmc_prefix}
private_net: {get_param: private_net}
bmc_other_ports:
type: OS::Heat::ResourceGroup
properties:
count: {get_param: node_count}
resource_def:
type: OS::Neutron::Port
properties:
name:
list_join:
- ''
- - {get_param: bmc_prefix}
- _%index%
network: {get_param: private_net}
bmc_handle:
type: OS::Heat::WaitConditionHandle
bmc_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: bmc_handle}
timeout: 600
bmc_server:
type: OS::Nova::Server
depends_on: [openstack_baremetal_servers, bmc_other_ports, bmc_port]
properties:
flavor: {get_param: bmc_flavor}
image: {get_param: bmc_image}
key_name: {get_param: key_name}
networks: {get_attr: [bmc_port, port]}
name: {get_param: bmc_prefix}
user_data_format: RAW
user_data:
str_replace:
params:
$os_user: {get_param: os_user}
$os_password: {get_param: os_password}
$os_tenant: {get_param: os_tenant}
$os_auth_url: {get_param: os_auth_url}
$os_project: {get_param: os_project}
$os__user_domain: {get_param: os_user_domain}
$os__project_domain: {get_param: os_project_domain}
$bm_node_count: {get_param: node_count}
$bmc_prefix: {get_param: bmc_prefix}
$bmc_utility: {get_attr: [bmc_port, ip_address]}
$bmc_use_cache: {get_param: bmc_use_cache}
$bm_prefix: {get_param: baremetal_prefix}
$private_net: {get_param: private_net}
$openstackbmc_script: {get_file: ../bin/openstackbmc}
$cloud_data: {get_param: cloud_data}
$signal_command: {get_attr: [bmc_handle, curl_cli]}
template: {get_file: ../bin/install_openstackbmc.sh}
cloud_data: {get_param: cloud_data}
baremetal_networks:
type: OS::OVB::BaremetalNetworks