Description of problem: The OpenStack UPI explains how to update the node subnet, however these days we also persist the apiVIP and ingressVIP in the install-config.yaml file and these two values need to be updated as well to match the new machine CIDR. As a consequence, strictly following the UPI documentation, we fail to generate the manifests with a validation error: ❯ openshift-install create manifests FATAL failed to fetch Master Machines: failed to load asset "Install Config": invalid "install-config.yaml" file: [platform.openstack.apiVIP: Invalid value: "10.0.0.5": IP is not in the machineNetwork, platform.openstack.ingressVIP: Invalid value: "10.0.0.7": IP is not in the machineNetwork] We need to either not write the apiVIP and ingressVIP to the install-config.yaml, or update the instruction in the UPI documentation to update these values as well when changing the machine CIDR. [1] https://github.com/openshift/installer/blob/f7028b2/docs/user/openstack/install_upi.md#fix-the-node-subnet
https://github.com/openshift/installer/pull/4133
Assign back this due to following issue, delete should be replaced with del python2 -c 'import yaml; import sys; path = "install-config.yaml"; data = yaml.safe_load(open(path)); if "apiVIP" in data["platform"]["openstack"]: delete data["platform"]["openstack"]["apiVIP"] ; if "ingressVIP" in data["platform"]["openstack"]: delete data["platform"]["openstack"]["ingressVIP"]; open(path, "w").write(yaml.dump(data, default_flow_style=False))' File "<string>", line 6 delete data["platform"]["openstack"]["apiVIP"] ; ^ SyntaxError: invalid syntax
Verified. 1. change the machineNetwork ... networking: clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 machineNetwork: - cidr: 192.0.0.0/24 networkType: OpenShiftSDN serviceNetwork: - 172.30.0.0/16 $ python -c 'import yaml path = "install-config.yaml" data = yaml.safe_load(open(path)) data["networking"]["machineNetwork"][0]["cidr"] = "192.0.2.0/24" open(path, "w").write(yaml.dump(data, default_flow_style=False))' ... networking: clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 machineNetwork: - cidr: 192.0.2.0/24 networkType: OpenShiftSDN serviceNetwork: - 172.30.0.0/16 2. delete the VIPs ... platform: openstack: apiVIP: 192.0.2.8 cloud: openstack computeFlavor: m1.xlarge externalDNS: - 10.0.77.163 externalNetwork: provider_net_cci_8 ingressFloatingIP: 10.0.102.230 ingressVIP: 192.0.2.9 lbFloatingIP: 10.0.103.156 octaviaSupport: '0' region: regionOne trunkSupport: '1' ... platform: openstack: cloud: openstack computeFlavor: m1.xlarge externalDNS: - 10.0.77.163 externalNetwork: provider_net_cci_8 ingressFloatingIP: 10.0.102.230 lbFloatingIP: 10.0.103.156 octaviaSupport: '0' region: regionOne trunkSupport: '1' 3. update the VIPs ... platform: openstack: cloud: openstack computeFlavor: m1.xlarge externalDNS: - 10.0.77.163 externalNetwork: provider_net_cci_8 ingressFloatingIP: 10.0.102.230 lbFloatingIP: 10.0.103.156 octaviaSupport: '0' region: regionOne trunkSupport: '1' apiVIP: 192.168.2.123 ingress: 192.168.3.234 $ python -c 'import yaml import sys path = "install-config.yaml" data = yaml.safe_load(open(path)) if "apiVIP" in data["platform"]["openstack"]: data["platform"]["openstack"]["apiVIP"] = "192.0.2.8" if "ingressVIP" in data["platform"]["openstack"]: data["platform"]["openstack"]["ingressVIP"] = "192.0.2.9" open(path, "w").write(yaml.dump(data, default_flow_style=False))' platform: openstack: apiVIP: 192.0.2.8 cloud: openstack computeFlavor: m1.xlarge externalDNS: - 10.0.77.163 externalNetwork: provider_net_cci_8 ingress: 192.168.3.234 ingressFloatingIP: 10.0.102.230 lbFloatingIP: 10.0.103.156 octaviaSupport: '0' region: regionOne trunkSupport: '1'