diff --git a/playbooks/install_stack.yaml b/playbooks/install_stack.yaml index 636ab20..dc45a7e 100644 --- a/playbooks/install_stack.yaml +++ b/playbooks/install_stack.yaml @@ -280,7 +280,7 @@ block: - name: Set fact for base_bridge_mappings when DPDK is disabled ansible.builtin.set_fact: - base_bridge_mappings: "external:br-ex,hostonly:br-hostonly" + base_bridge_mappings: "external:br-ex,hostonly:br-hostonly,storage_nfs:br-storage_nfs" when: - dpdk_interface is not defined - name: Set fact for base_bridge_mappings when DPDK is enabled @@ -486,6 +486,16 @@ when: - (tripleo_repos_branch is defined and tripleo_repos_branch not in ['train', 'ussuri', 'victoria']) or (tripleo_repos_branch is not defined) + - name: Add StorageNFS into Network Data Undercloud + ansible.builtin.blockinfile: + dest: /usr/share/openstack-tripleo-heat-templates/network_data_undercloud.yaml + block: | + - name: StorageNFS + vip: true + name_lower: storage_nfs + become: true + become_user: root + - name: Deploy Ceph ansible.builtin.include_role: name: ceph diff --git a/playbooks/network.yaml b/playbooks/network.yaml index b842135..b586c1f 100644 --- a/playbooks/network.yaml +++ b/playbooks/network.yaml @@ -50,6 +50,13 @@ enabled: false ipv6: enabled: false + - name: dummy2 + type: dummy + state: up + ipv4: + enabled: false + ipv6: + enabled: false - name: Define dummy interfaces to be created when using DPDK when: diff --git a/playbooks/prepare_stack.yaml b/playbooks/prepare_stack.yaml index e5a05e4..3972ba6 100644 --- a/playbooks/prepare_stack.yaml +++ b/playbooks/prepare_stack.yaml @@ -136,6 +136,22 @@ environment: OS_CLOUD: standalone + - name: Create hostonly nfs network # noqa no-changed-when + when: manila_enabled + ansible.builtin.shell: | + if ! openstack network show StorageNFS; then + openstack network create --project openshift --share --external --provider-physical-network storage_nfs --provider-network-type flat StorageNFS + fi + if ! openstack subnet show StorageNFSSubnet; then + openstack subnet create --project openshift StorageNFSSubnet --subnet-range "{{ hostonly_nfs_cidr }}" \ + --dhcp --gateway none \ + --dns-nameserver "{{ network_info.dns | first }}" \ + --allocation-pool "start={{ hostonly_nfs_fip_pool_start }},end={{ hostonly_nfs_fip_pool_end }}" \ + --network StorageNFS + fi + environment: + OS_CLOUD: standalone + - name: Create hostonly-sriov network # noqa no-changed-when when: sriov_interface is defined ansible.builtin.shell: | diff --git a/playbooks/roles/ceph/tasks/storage-network.yml b/playbooks/roles/ceph/tasks/storage-network.yml index a82ddb3..5b5d49f 100644 --- a/playbooks/roles/ceph/tasks/storage-network.yml +++ b/playbooks/roles/ceph/tasks/storage-network.yml @@ -14,6 +14,15 @@ storage_subnet: ip_subnet: '{{ ceph_network }}' allocation_pools: [{'start': '{{ start }}', 'end': '{{ end }}'}] + - name: StorageNFS + mtu: 1350 + vip: true + name_lower: storage_nfs + service_net_map_replace: storage_nfs + subnets: + storage_subnet: + ip_subnet: '{{ hostonly_nfs_cidr }}' + allocation_pools: [{'start': '{{ hostonly_nfs_fip_pool_start }}', 'end': '{{ hostonly_nfs_fip_pool_end }}'}] - name: Create deployed_network environment file (with VIPs) ansible.builtin.copy: @@ -35,6 +44,10 @@ ip_address: {{ mon_ip }} ip_subnet: {{ dummy_ip_cidr }} ip_address_uri: {{ mon_ip }} + storage_nfs: + ip_address: {{ hostonly_nfs_cidr | nthhost(1) }} + ip_subnet: {{ hostonly_nfs_cidr }} + ip_address_uri: {{ hostonly_nfs_ganesha }} ControlPlaneVipData: fixed_ips: - ip_address: {{ control_plane_ip }} @@ -49,6 +62,12 @@ ip_address: {{ dummy_vip }} ip_address_uri: {{ dummy_vip }} ip_subnet: {{ dummy_vip ~ '/' ~ control_plane_prefix | string }} + storage_nfs: + ip_address: {{ hostonly_nfs_cidr | nthhost(1) }} + ip_subnet: {{ hostonly_nfs_cidr }} + ip_address_uri: {{ hostonly_nfs_ganesha }} + VipSubnetMap: + StorageNFS: storage_nfs_subnet DeployedNetworkEnvironment: net_attributes_map: storage: @@ -69,8 +88,29 @@ host_routes: [] ip_version: 4 name: storage_subnet + storage_nfs: + network: + dns_domain: storagenfs.mydomain.tld. + mtu: 1350 + name: storage_nfs + tags: + - tripleo_network_name=StorageNFS + - tripleo_net_idx=1 + - tripleo_service_net_map_replace=storage_nfs + - tripleo_vip=true + subnets: + storage_nfs_subnet: + cidr: {{ hostonly_nfs_cidr }} + dns_nameservers: [] + gateway_ip: null + host_routes: [] + ip_version: 4 + name: storage_nfs_subnet net_cidr_map: storage: - {{ ceph_network }} + storage_nfs: + - {{ hostonly_nfs_cidr }} net_ip_version_map: storage: 4 + storage_nfs: 4 diff --git a/playbooks/templates/dev-install_net_config.yaml.j2 b/playbooks/templates/dev-install_net_config.yaml.j2 index dbddb3e..18875a5 100644 --- a/playbooks/templates/dev-install_net_config.yaml.j2 +++ b/playbooks/templates/dev-install_net_config.yaml.j2 @@ -64,6 +64,26 @@ network_config: name: dummy1 nm_controlled: true mtu: {{ dcn_az is defined | ternary(hostonly_mtu, public_mtu) }} +- type: ovs_bridge + name: br-storage_nfs + use_dhcp: false + ovs_extra: + - br-set-external-id br-storage_nfs bridge-id br-storage_nfs + addresses: + - ip_netmask: {{ hostonly_nfs_cidr | nthhost(1) }}/{{ hostonly_nfs_cidr | ansible.utils.ipaddr('prefix') }} + members: +{% for ip in tunnel_remote_ips %} + - type: ovs_tunnel + name: "tun-storage_nfs-{{ ip | to_uuid }}" + tunnel_type: vxlan + ovs_options: + - remote_ip={{ ip }} + - key=102 +{% endfor %} + - type: interface + name: dummy2 + nm_controlled: true + mtu: {{ dcn_az is defined | ternary(hostonly_mtu, public_mtu) }} {% if sriov_interface is defined %} - type: sriov_pf name: {{ sriov_interface }} diff --git a/playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2 b/playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2 index f753718..ee851b9 100644 --- a/playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2 +++ b/playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2 @@ -26,5 +26,6 @@ cluster_network: {{ control_plane_cidr }} public_network: {{ control_plane_cidr }} {% if manila_enabled %} - ceph_nfs_bind_addr: "{{ public_api }}" + ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}" + tripleo_cephadm_ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}" {% endif %} diff --git a/playbooks/templates/standalone_parameters.yaml.j2 b/playbooks/templates/standalone_parameters.yaml.j2 index 0cbbd55..fa9b572 100644 --- a/playbooks/templates/standalone_parameters.yaml.j2 +++ b/playbooks/templates/standalone_parameters.yaml.j2 @@ -46,6 +46,20 @@ resource_registry: {% endif %} parameter_defaults: CloudName: {{ hostname }}.{{ clouddomain }} + # Enable ganesha + EnableGanesha: true + # Enable StorageNFS network + StorageNFS: true + ServiceNetMap: + GaneshaNetwork: storage_nfs + # Define StorageNFSIPs + StorageNfsIp: {{ hostonly_nfs_cidr | nthhost(1) }} + StorageNfsVip: {{ hostonly_nfs_ganesha }} + # Define network configuration for StorageNFS + StorageNFSNetCidr: {{ hostonly_nfs_cidr }} + StorageNFSAllocationPools: + - start: {{ hostonly_nfs_fip_pool_start }} + - end: {{ hostonly_nfs_fip_pool_end }} ContainerCli: podman Debug: true DeploymentUser: {{ ansible_env.USER }} @@ -183,9 +197,9 @@ parameter_defaults: oslo_messaging_rpc_use_ssl: false {% endif %} {% if manila_enabled %} - ganesha_vip: "{{ public_api }}" + ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}" # for cephadm support on OSP 17 - tripleo_cephadm_ceph_nfs_bind_addr: "{{ public_api }}" + tripleo_cephadm_ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}" {% endif %} {% if standalone_extra_config|length > 0 %} {% for key, value in standalone_extra_config.items() %} diff --git a/playbooks/vars/defaults.yaml b/playbooks/vars/defaults.yaml index d89a97c..2896ede 100644 --- a/playbooks/vars/defaults.yaml +++ b/playbooks/vars/defaults.yaml @@ -80,6 +80,19 @@ hostonly_sriov_prefix: "{{ hostonly_sriov_cidr | ansible.utils.ipaddr('prefix') hostonly_sriov_fip_pool_start: "{{ hostonly_sriov_cidr | nthhost(2) }}" hostonly_sriov_fip_pool_end: "{{ hostonly_sriov_cidr | nthhost(-2) }}" +# StorageNFSNetwork +hostonly_nfs_cidr: 172.17.5.0/24 +hostonly_nfs_ganesha: "{{ hostonly_nfs_cidr | nthhost(129) }}" +hostonly_nfs_prefix: "{{ hostonly_nfs_cidr | ansible.utils.ipaddr('prefix') }}" +hostonly_nfs_fip_pool_start: "{{ hostonly_nfs_cidr | nthhost(150) }}" +hostonly_nfs_fip_pool_end: "{{ hostonly_nfs_cidr | nthhost(-2) }}" + +storage_nfs: "{{ hostonly_nfs_cidr | nthhost(2) }}" +storage_nfs_subnet: "{{ hostonly_nfs_cidr }}" +storage_nfs_uri: "{{ hostonly_nfs_ganesha }}" +storage_nfs_ip: "{{ hostonly_nfs_cidr | nthhost(1) }}" +storage_nfs_vip: "{{ hostonly_nfs_ganesha }}" + # Configuration used only by prepare_stack_testconfig, which is not run by # default. testconfig_private_cidr: 192.168.100.0/24 @@ -121,7 +134,7 @@ low_memory_usage: false # This param can be overriden, but only when overriding the network_config, otherwise the default # should work as is: # neutron_bridge_mappings: -neutron_flat_networks: "external,hostonly,hostonly-sriov" +neutron_flat_networks: "external,hostonly,hostonly-sriov,storage_nfs" # If we have more than one SR-IOV device, it can be useful to override this one, but the default is safe # if we only use `sriov_interface` for one device.