Skip to content

Commit

Permalink
WIP retain host IPs on internalapi network
Browse files Browse the repository at this point in the history
Signed-off-by: Bohdan Dobrelia <[email protected]>
  • Loading branch information
bogdando committed Dec 20, 2024
1 parent 5bfb13d commit 6d3edae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ $ export COMPUTES_CELL3=(
)
# ...
$ declare -A COMPUTES_API_CELL1
$ export COMPUTES_API_CELL1=( <2>
["standalone.localdomain"]="172.17.0.100"
# ...
)
# ...
$ NODESETS=""
$ for CELL in $(echo $RENAMED_CELLS); do
ref="COMPUTES_$(echo ${CELL}|tr '[:lower:]' '[:upper:]')"
Expand All @@ -118,9 +125,9 @@ $ NODESETS="[${NODESETS%,*}]"
+
<1> The source cloud `default` cell takes a new `DEFAULT_CELL_NAME` on the destined cloud after adoption.
In a multi-cell adoption scenario, you may either retain its original name `default`, or create as `cell<X>`, by providing the incremented index of the last cell in the source cloud (which is, by adding a 1 to it).
<2> For each cell, adjust <["standalone.localdomain"]="192.168.122.100">, and complete `COMPUTES_CELL_<X>` data with the names and IP addresses of the {compute_service} nodes.
<2> For each cell, adjust <["standalone.localdomain"]="x.x.x.x">, and complete `COMPUTES_CELL<X>` and `COMPUTES_API_CELL<X>` data with the names and IP addresses of the {compute_service} nodes connected to the `ctlplane` and `internalapi` networks. Do not specify a real FQDN defined for each network, always use the same host name for each of its connected networks. Providing IP addresses and names of the hosts on remaining networks of the source cloud should be covered the similar way. Or you can adjust the generated files manually as shown below.
<3> If your deployment has a custom DNS Domain, put it in for FQDN of the nodes. The given values will be used in the dataplane node sets' `spec.nodes.<NODE NAME>.hostName`.
<4> Assign all {compute_service} nodes from the source cloud `cell1` cell into `COMPUTES_CELL1`, and so on.
<4> Assign all {compute_service} nodes from the source cloud `cell1` cell into `COMPUTES_*CELL1`, and so on.
<5> Assign all {compute_service} nodes from the source cloud `default` cell into `openstack-<X>`,
where `<X>` is the `DEFAULT_CELL_NAME` environment variable value (here, it equals 'cell3').
<6> Cells not containing compute nodes will be omitted as no node sets for it should be created.
Expand Down Expand Up @@ -344,11 +351,13 @@ $ declare -A names
$ for CELL in $(echo $RENAMED_CELLS); do
ref="COMPUTES_$(echo ${CELL}|tr '[:lower:]' '[:upper:]')"
eval names=\${!${ref}[@]}
ref_api="COMPUTES_API_$(echo ${CELL}|tr '[:lower:]' '[:upper:]')"
[ -z "$names" ] && continue
ind=0
rm -f computes-$CELL
for compute in $names; do
ip="${ref}['$compute']"
ip_api="${ref_api}['$compute']"
cat >> computes-$CELL << EOF
${compute}:
hostName: $compute
Expand All @@ -361,6 +370,7 @@ $ for CELL in $(echo $RENAMED_CELLS); do
subnetName: subnet1
- name: internalapi
subnetName: subnet1
fixedIP: ${!ip_api}
- name: storage
subnetName: subnet1
- name: tenant
Expand Down Expand Up @@ -540,7 +550,7 @@ EOF
done
----
+
<1> The networks composition must match the source cloud configuration to avoid dataplane connectivity downtime. The ctlplane network must come first.
<1> The networks composition must match the source cloud configuration to avoid dataplane connectivity downtime. The ctlplane network must come first. The above commands only retain IP addresses for the hosts on `ctlplane` and `internalapi` networks. Complete it the same way for other networks, or update the resulted files manually.
<2> Use node sets names, like `openstack-cell1`, `openstack-cell2`. Only create node sets for cells containing compute nodes.
<3> If TLS Everywhere is enabled, change `spec.tlsEnabled` to `true`.
<4> If not adopting the telemetry services, omit it from the services list.
Expand Down
7 changes: 7 additions & 0 deletions tests/roles/common_defaults/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ mariadb_copy_shell_vars_dst: |
done
# Header for the destination cloud EDPM Nova cell computes FDQN and IP pairs, per a cell
# NOTE: Assume inernalapi network comes with an index 1. Ignore FQDN on a network to simply bind IPs by a hostname.
edpm_computes_shell_vars_src: |-
{{ shell_header }}
{{ cells_env }}
Expand All @@ -172,6 +173,12 @@ edpm_computes_shell_vars_src: |-
["{{ edpm_nodes[cell][v].hostName }}"]={{ edpm_nodes[cell][v].ansible.ansibleHost }}
{% endfor -%}
)
declare -A COMPUTES_API_{{ cell.upper() }}
COMPUTES_API_{{ cell.upper() }}=(
{%- for v in edpm_nodes[cell] | default({}) %}
["{{ edpm_nodes[cell][v].hostName }}"]={{ edpm_nodes[cell][v].networks[1].fixedIP|default("") }}
{% endfor -%}
)
{% endfor %}
pull_openstack_configuration_ssh_shell_vars: |
Expand Down
3 changes: 3 additions & 0 deletions tests/roles/dataplane_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@
for CELL in $(echo $RENAMED_CELLS); do
ref="COMPUTES_$(echo ${CELL}|tr '[:lower:]' '[:upper:]')"
eval names=\${!${ref}[@]}
ref_api="COMPUTES_API_$(echo ${CELL}|tr '[:lower:]' '[:upper:]')"
[ -z "$names" ] && continue
ind=0
rm -f computes-$CELL
for compute in $names; do
ip="${ref}['$compute']"
ip_api="${ref_api}['$compute']"
cat >> computes-$CELL << EOF
${compute}:
hostName: $compute
Expand All @@ -205,6 +207,7 @@
subnetName: subnet1
- name: internalapi
subnetName: subnet1
fixedIP: ${!ip_api}
- name: storage
subnetName: subnet1
- name: tenant
Expand Down
3 changes: 3 additions & 0 deletions tests/vars.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ source_mariadb_ip:
# Defaults provided for a single-cell case.
# Provide for each cell on the target cloud, considering default_cell_name value.
# The defined 'networks' connections must match netconfig_networks which manages NetConfig CR
# to retain fixed IPs, provide values matching the source TripleO deployment
edpm_nodes:
cell1:
standalone:
Expand All @@ -33,6 +34,8 @@ edpm_nodes:
name: ctlplane
subnetName: subnet1
- name: internalapi
# uncomment to retain the source cloud fixed IP value
#fixedIP: 172.17.0.100
subnetName: subnet2
- name: storage
subnetName: subnet3
Expand Down

0 comments on commit 6d3edae

Please sign in to comment.