Undercloud deploy - fail if ctlplane-network not defined in undercloud.conf

Bug #1820330 reported by Harald Jensås on 2019-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Critical
Harald Jensås

Bug Description

$ cat undercloud.conf
[DEFAULT]
local_interface = eth0
local_ip = 192.168.24.1/24
undercloud_ntp_servers=clock.redhat.com
hieradata_override = /home/stack/hiera_override.yaml
container_images_file=/home/stack/containers-prepare-parameter.yaml
container_insecure_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888
undercloud_service_certificate = /etc/pki/instack-certs/undercloud.pem
enable_routed_networks = true
subnets = leaf0,leaf1,leaf2
local_subnet = leaf0

[leaf0]
cidr = 192.168.24.0/24
dhcp_start = 192.168.24.10
dhcp_end = 192.168.24.90
inspection_iprange = 192.168.24.100,192.168.24.190
gateway = 192.168.24.254
masquerade = False

[leaf1]
cidr = 192.168.34.0/24
dhcp_start = 192.168.34.10
dhcp_end = 192.168.34.90
inspection_iprange = 192.168.34.100,192.168.34.190
gateway = 192.168.34.254
masquerade = False

[leaf2]
cidr = 192.168.44.0/24
dhcp_start = 192.168.44.10
dhcp_end = 192.168.44.90
inspection_iprange = 192.168.44.100,192.168.44.190
gateway = 192.168.44.254
masquerade = False

$ cat tripleo-config-generated-env-files/undercloud_parameters.yaml
parameter_defaults:
 { .. SNIP .. }
  ControlPlaneStaticRoutes:
  - ip_netmask: 192.168.34.0/24
    next_hop: 192.168.24.254
  - ip_netmask: 192.168.44.0/24
    next_hop: 192.168.24.254
 { .. SNIP .. }
  IronicInspectorInterface: br-ctlplane
 { .. SNIP .. }
  IronicInspectorSubnets:
  - gateway: 192.168.24.254
    ip_range: 192.168.24.100,192.168.24.190
    netmask: 255.255.255.0
    tag: leaf0
  - gateway: 192.168.34.254
    ip_range: 192.168.34.100,192.168.34.190
    netmask: 255.255.255.0
    tag: leaf1
  - gateway: 192.168.44.254
    ip_range: 192.168.44.100,192.168.44.190
    netmask: 255.255.255.0
    tag: leaf2
 { .. SNIP .. }
  MasqueradeNetworks: {}
 { .. SNIP .. }
  UndercloudCtlplaneLocalSubnet: leaf0
  UndercloudCtlplaneSubnets:
    leaf0:
      AllocationPools:
      - end: 192.168.24.90
        start: 192.168.24.10
      HostRoutes: []
      NetworkCidr: 192.168.24.0/24
      NetworkGateway: 192.168.24.254
    leaf1:
      AllocationPools:
      - end: 192.168.34.90
        start: 192.168.34.10
      HostRoutes: []
      NetworkCidr: 192.168.34.0/24
      NetworkGateway: 192.168.34.254
    leaf2:
      AllocationPools:
      - end: 192.168.44.90
        start: 192.168.44.10
      HostRoutes: []
      NetworkCidr: 192.168.44.0/24
      NetworkGateway: 192.168.44.254
  UndercloudEnableRoutedNetworks: true

There are no `ctlplane-subnet` subnet defined in undercloud.conf.
python-tripleoclient - does _not_ put `ctlplane-subnet` into the parameters.

Yet, when https://github.com/openstack/tripleo-heat-templates/blob/master/extraconfig/post_deploy/undercloud_post.yaml#L248 passes `UndercloudCtlplaneSubnets` to the script setting up the networks there is a `ctlplane-subnet`.

config={\"cloud_name\": \"undercloud\", \"enable_routed_networks\": true, \"home_dir\": \"/home/stack\", \"local_ip\": \"192.168.24.3\", \"local_subnet\": \"leaf0\", \"mtu\": 1500, \"nameservers\": [], \"physical_network\": \"ctlplane\", \"subnets\": {\"ctlplane-subnet\": {\"DhcpRangeEnd\": \"192.168.24.24\", \"DhcpRangeStart\": \"192.168.24.5\", \"NetworkCidr\": \"192.168.24.0/24\", \"NetworkGateway\": \"192.168.24.1\"}, \"leaf0\": {\"AllocationPools\": [{\"end\": \"192.168.24.90\", \"start\": \"192.168.24.10\"}], \"HostRoutes\": [], \"NetworkCidr\": \"192.168.24.0/24\", \"NetworkGateway\": \"192.168.24.254\"}, \"leaf1\": {\"AllocationPools\": [{\"end\": \"192.168.34.90\", \"start\": \"192.168.34.10\"}], \"HostRoutes\": [], \"NetworkCidr\": \"192.168.34.0/24\", \"NetworkGateway\": \"192.168.34.254\"}, \"leaf2\": {\"AllocationPools\": [{\"end\": \"192.168.44.90\", \"start\": \"192.168.44.10\"}], \"HostRoutes\": [], \"NetworkCidr\": \"192.168.44.0/24\", \"NetworkGateway\": \"192.168.44.254\"}}}

Changed in tripleo:
assignee: nobody → Harald Jensås (harald-jensas)
Harald Jensås (harald-jensas) wrote :

2019-03-15 15:42:00.832 14286 WARNING tripleoclient.v1.undercloud.InstallUndercloud [ ] Running: sudo --preserve-env \
 openstack tripleo deploy \
   --standalone \
   --standalone-role Undercloud \
   --stack undercloud \
   --local-domain=localdomain \
   --local-ip=192.168.24.1/24 \
   --templates=/usr/share/openstack-tripleo-heat-templates/ \
   --networks-file=network_data_undercloud.yaml \
   ## The following file includes the values:
   ## https://github.com/openstack/tripleo-heat-templates/blob/master/environments/undercloud.yaml#L154-L159
   --heat-native -e /usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/use-dns-for-vips.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/podman.yaml \
   -e /home/stack/containers-prepare-parameter.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/ironic.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/ironic-inspector.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/mistral.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/zaqar-swift-backend.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/tripleo-ui.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/tempest.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-haproxy.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-keepalived.yaml \
   --public-virtual-ip 192.168.24.2 \
   --control-virtual-ip 192.168.24.3 \
   -e /usr/share/openstack-tripleo-heat-templates/environments/ssl/tls-endpoints-public-ip.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-haproxy.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-keepalived.yaml \
   --deployment-user stack \
   --output-dir=/home/stack \
   --cleanup \
   ## The following file should override what's in environments/undercloud.yaml#L154-L159
   #
   # Yet it looks like it's somehow merged?
   #
   -e /home/stack/tripleo-config-generated-env-files/undercloud_parameters.yaml \
   --hieradata-override=/home/stack/hiera_override.yaml \
   -e /usr/share/openstack-tripleo-heat-templates/environments/tripleo-validations.yaml \
   --log-file=install-undercloud.log \
   -e /usr/share/openstack-tripleo-heat-templates/undercloud-stack-vstate-dropin.yaml

Harald Jensås (harald-jensas) wrote :

Workaround:

Remove default values from environments/undercloud.yaml, for some reason the dict value's are merged. Removing the defaults in this environment file makes the deployment work.

--- /usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml_orig 2019-03-15 18:44:12.112625876 +0000
+++ /usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml 2019-03-15 18:45:34.737481097 +0000
@@ -115,8 +115,6 @@
   IronicForcePowerStateDuringSync: false
   IronicInspectorCollectors: default,extra-hardware,numa-topology,logs
   IronicInspectorInterface: br-ctlplane
- IronicInspectorSubnets:
- - ip_range: '192.168.24.100,192.168.24.200'
   IronicProvisioningNetwork: 'ctlplane'
   IronicRescuingNetwork: 'ctlplane'
   ZaqarMessageStore: 'swift'
@@ -150,14 +148,6 @@
   # next_hop: 192.168.24.1
   # - ip_netmask: 192.168.26.0/24
   # next_hop: 192.168.24.1
- ControlPlaneStaticRoutes: []
- UndercloudCtlplaneSubnets:
- ctlplane-subnet:
- NetworkCidr: '192.168.24.0/24'
- NetworkGateway: '192.168.24.1'
- DhcpRangeStart: '192.168.24.5'
- DhcpRangeEnd: '192.168.24.24'
- UndercloudCtlplaneLocalSubnet: 'ctlplane-subnet'
   MistralDockerGroup: true
   PasswordAuthentication: 'yes'
   HeatEngineOptVolumes:

Harald Jensås (harald-jensas) wrote :

tripleo-heat-installer-templates/puppet/role.role.j2.yaml: merge_behavior: deeper
tripleo-heat-installer-templates/puppet/undercloud-role.yaml: merge_behavior: deeper
undercloud-ansible-NonBB9/Undercloud/undercloud/UndercloudDeployment: "merge_behavior": "deeper"

Harald Jensås (harald-jensas) wrote :

The above 'merge_behaviour' is related to writing hieradata.
Afaict that merge should not affect how heat is merging parameter_defaults.

Fix proposed to branch: master
Review: https://review.openstack.org/644373

Changed in tripleo:
status: Triaged → In Progress
tags: added: rocky-backport-potential

Reviewed: https://review.openstack.org/644373
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=ea80847f9697f6b02f9cbaedcafc909e37ce5161
Submitter: Zuul
Branch: master

commit ea80847f9697f6b02f9cbaedcafc909e37ce5161
Author: Harald Jensås <email address hidden>
Date: Mon Mar 18 18:09:15 2019 +0100

    Remove UndercloudCtlplaneSubnets defaults in UC env

    The defaults in environments/undercloud.yaml will be
    merged with what the was defined in undercloud.conf.
    If the 'ctlplane-subnet' is not used in undercloud.conf
    the default is merged, and we end up with an additional
    subnet that was not requested by the undercloud installed.

    This change set the default to {} in:
      environments/undercloud.yaml

    Also add's a comment to hightlight that there should be
    a empty dict default.

    Closes-Bug: #1820330
    Change-Id: Idc17154b2e1e143ba4e84b9b96f5355fc9230172

Changed in tripleo:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/644849
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=50063195ebd2161b2283e5fdd2ab21f83e58cf48
Submitter: Zuul
Branch: stable/rocky

commit 50063195ebd2161b2283e5fdd2ab21f83e58cf48
Author: Harald Jensås <email address hidden>
Date: Mon Mar 18 18:09:15 2019 +0100

    Remove UndercloudCtlplaneSubnets defaults in UC env

    The defaults in environments/undercloud.yaml will be
    merged with what the was defined in undercloud.conf.
    If the 'ctlplane-subnet' is not used in undercloud.conf
    the default is merged, and we end up with an additional
    subnet that was not requested by the undercloud installed.

    This change set the default to {} in:
      environments/undercloud.yaml

    Also add's a comment to hightlight that there should be
    a empty dict default.

    Closes-Bug: #1820330
    Change-Id: Idc17154b2e1e143ba4e84b9b96f5355fc9230172
    (cherry picked from commit ea80847f9697f6b02f9cbaedcafc909e37ce5161)

tags: added: in-stable-rocky

Change abandoned by Harald Jensås (<email address hidden>) on branch: master
Review: https://review.openstack.org/643682

This issue was fixed in the openstack/tripleo-heat-templates 10.5.0 release.

This issue was fixed in the openstack/tripleo-heat-templates 9.4.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers