Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,12 @@ def json_file_mandatory(file_path):
"primary_oim_admin_ip/netmask_bits in network_spec.yml."
)

ADMIN_ROUTER_INVALID_MSG = (
"admin_network.router is mandatory and must be a valid IPv4 address "
"(Example: 192.168.1.1). If no dedicated router is available, "
"primary_oim_admin_ip can be used as the router."
)

# additional_subnets (multi-subnet / multi-RAC support)
ADDITIONAL_SUBNET_ROUTER_INVALID_MSG = (
"router must be a valid IPv4 address within the subnet."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"netmask_bits",
"primary_oim_admin_ip",
"primary_oim_bmc_ip",
"router",
"dynamic_range"
],
"properties": {
Expand Down Expand Up @@ -53,6 +54,10 @@
}
]
},
"router": {
"type": "string",
"pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\\.){3}(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})$"
},
"dynamic_range": {
"type": "string",
"pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)-(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,17 @@ def _validate_admin_network(network):
)
)

# Validate admin_network.router (mandatory, must be a valid IPv4 address)
router = admin_net.get("router", "")
if not router or not validation_utils.validate_ipv4(router):
errors.append(
create_error_msg(
"admin_network.router",
router,
en_us_validation_msg.ADMIN_ROUTER_INVALID_MSG,
)
)

# Admin and BMC IP should not be the same
errors.extend(validate_admin_bmc_ip_not_same(primary_oim_admin_ip, primary_oim_bmc_ip))

Expand Down
3 changes: 3 additions & 0 deletions input/network_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# - 'primary_oim_bmc_ip': The iDRAC IP address of the OIM server,
# Mandatory only if idrac_telemetry is set to true and telemetry data needs to be collected from the OIM server.
# Optional — can be omitted if iDRAC telemetry for the OIM server is not required.
# - 'router': The gateway/router IP for the admin network (used as DHCP option 3).
# Mandatory. If no dedicated router is available, use 'primary_oim_admin_ip'.
# - 'dynamic_range': The range of dynamic IP addresses available on the admin network.
# - 'dns': The list of external DNS server IP address for the admin network.
# - 'ntp_servers': The list of NTP servers for the admin network. Each NTP server entry should include:
Expand Down Expand Up @@ -69,6 +71,7 @@ Networks:
netmask_bits: "24"
primary_oim_admin_ip: "172.16.107.254"
primary_oim_bmc_ip: ""
router: "172.16.107.254"
dynamic_range: "172.16.107.201-172.16.107.250"
dns: []
ntp_servers: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
{{ network_data.admin_network.dynamic_range | split('-') | last }}
coredhcp_netmask: >-
{{ (admin_nic_ip + '/' + network_data.admin_network.netmask_bits) | ansible.utils.ipaddr('netmask') }}
coredhcp_router: "{{ network_data.admin_network.router }}"
coredhcp_lease_duration: "{{ default_lease_time }}s"

- name: Set multi-subnet coredhcp facts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
{{ network_data.admin_network.dynamic_range | split('-') | last }}
coredhcp_netmask: >-
{{ (admin_nic_ip + '/' + network_data.admin_network.netmask_bits) | ansible.utils.ipaddr('netmask') }}
coredhcp_router: "{{ network_data.admin_network.router }}"
coredhcp_lease_duration: "{{ default_lease_time }}s"

- name: Set multi-subnet coredhcp facts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cluster_boot_ip: "{{ admin_nic_ip }}"
cluster_boot_interface: "{{ admin_nic }}"
coredhcp_dhcp_pool: "{{ network_data.admin_network.dynamic_range | split('-') | first }} {{ network_data.admin_network.dynamic_range | split('-') | last }}"
coredhcp_netmask: "{{ (admin_nic_ip + '/' + network_data.admin_network.netmask_bits) | ansible.utils.ipaddr('netmask') }}"
coredhcp_router: "{{ network_data.admin_network.router }}"
coredhcp_lease_duration: "{{ default_lease_time }}s"
openchami_work_dir: "{{ openchami_work_dir }}"
data_oci_dir: "{{ data_oci_dir }}"
Expand Down
5 changes: 3 additions & 2 deletions upgrade/prepare_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
- ""
- "File 1: network_spec.yml"
- " 1. admin_network.subnet (auto-computed)"
- " 2. admin_network.additional_subnets (multi-RAC PXE)"
- " 3. ib_network.dns (InfiniBand DNS)"
- " 2. admin_network.router (DHCP gateway — defaults to primary_oim_admin_ip)"
- " 3. admin_network.additional_subnets (multi-RAC PXE)"
- " 4. ib_network.dns (InfiniBand DNS)"
- ""
- "File 2: storage_config.yml"
- " 1. nfs_client_params is replaced by 'mounts' format"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# - 'primary_oim_bmc_ip': The iDRAC IP address of the OIM server,
# Mandatory only if idrac_telemetry is set to true and telemetry data needs to be collected from the OIM server.
# Optional — can be omitted if iDRAC telemetry for the OIM server is not required.
# - 'router': The gateway/router IP for the admin network (used as DHCP option 3).
# Mandatory. If no dedicated router is available, use 'primary_oim_admin_ip'.
# - 'dynamic_range': The range of dynamic IP addresses available on the admin network.
# - 'dns': The list of external DNS server IP address for the admin network.
# - 'ntp_servers': The list of NTP servers for the admin network. Each NTP server entry should include:
Expand Down Expand Up @@ -69,6 +71,7 @@ Networks:
netmask_bits: "{{ admin_network.netmask_bits | default(network_default_netmask_bits) }}"
primary_oim_admin_ip: "{{ admin_network.primary_oim_admin_ip | default('') }}"
primary_oim_bmc_ip: "{{ admin_network.primary_oim_bmc_ip | default('') }}"
router: "{{ admin_network.router | default(admin_network.primary_oim_admin_ip | default('')) }}"
dynamic_range: "{{ admin_network.dynamic_range | default('') }}"
dns: {{ admin_network.dns | default([], true) }}
ntp_servers: {{ admin_network.ntp_servers | default([], true) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
{{ (network_data.admin_network.primary_oim_admin_ip | default('0.0.0.0')
+ '/' + (network_data.admin_network.netmask_bits | default('24') | string))
| ansible.utils.ipaddr('netmask') }}
coredhcp_router: "{{ network_data.admin_network.router | default(network_data.admin_network.primary_oim_admin_ip | default('')) }}"
coredhcp_lease_duration: "{{ default_lease_time | default('86400') }}s"
cluster_shortname: "nid"
cluster_nidlength: 3
Expand Down Expand Up @@ -322,6 +323,7 @@
cluster_nidlength: "{{ cluster_config.cluster_nidlength | default('3') }}"
ochami_base_url: "https://{{ cluster_config.cluster_name }}.{{ cluster_config.cluster_domain }}:8443"
coredhcp_netmask: "{{ cluster_config.coredhcp_netmask | default('255.255.255.0') }}"
coredhcp_router: "{{ cluster_config.coredhcp_router | default(cluster_config.cluster_boot_ip | default('')) }}"
coredhcp_lease_duration: "{{ cluster_config.coredhcp_lease_duration | default('86400s') }}"
coredhcp_dhcp_pool: "{{ cluster_config.coredhcp_dhcp_pool | default('') }}"
when:
Expand Down
Loading