Skip to content

Commit 3209fc2

Browse files
committed
Add StorageNFS Network
1 parent 9d4ee11 commit 3209fc2

File tree

8 files changed

+119
-5
lines changed

8 files changed

+119
-5
lines changed

playbooks/install_stack.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
block:
281281
- name: Set fact for base_bridge_mappings when DPDK is disabled
282282
ansible.builtin.set_fact:
283-
base_bridge_mappings: "external:br-ex,hostonly:br-hostonly"
283+
base_bridge_mappings: "external:br-ex,hostonly:br-hostonly,storage_nfs:br-storage_nfs"
284284
when:
285285
- dpdk_interface is not defined
286286
- name: Set fact for base_bridge_mappings when DPDK is enabled
@@ -486,6 +486,16 @@
486486
when:
487487
- (tripleo_repos_branch is defined and tripleo_repos_branch not in ['train', 'ussuri', 'victoria']) or (tripleo_repos_branch is not defined)
488488

489+
- name: Add StorageNFS into Network Data Undercloud
490+
ansible.builtin.blockinfile:
491+
dest: /usr/share/openstack-tripleo-heat-templates/network_data_undercloud.yaml
492+
block: |
493+
- name: StorageNFS
494+
vip: true
495+
name_lower: storage_nfs
496+
become: true
497+
become_user: root
498+
489499
- name: Deploy Ceph
490500
ansible.builtin.include_role:
491501
name: ceph

playbooks/network.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
enabled: false
5151
ipv6:
5252
enabled: false
53+
- name: dummy2
54+
type: dummy
55+
state: up
56+
ipv4:
57+
enabled: false
58+
ipv6:
59+
enabled: false
5360
5461
- name: Define dummy interfaces to be created when using DPDK
5562
when:

playbooks/prepare_stack.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@
136136
environment:
137137
OS_CLOUD: standalone
138138

139+
- name: Create hostonly nfs network # noqa no-changed-when
140+
when: manila_enabled
141+
ansible.builtin.shell: |
142+
if ! openstack network show StorageNFS; then
143+
openstack network create --project openshift --share --external --provider-physical-network storage_nfs --provider-network-type flat StorageNFS
144+
fi
145+
if ! openstack subnet show StorageNFSSubnet; then
146+
openstack subnet create --project openshift StorageNFSSubnet --subnet-range "{{ hostonly_nfs_cidr }}" \
147+
--dhcp --gateway none \
148+
--dns-nameserver "{{ network_info.dns | first }}" \
149+
--allocation-pool "start={{ hostonly_nfs_fip_pool_start }},end={{ hostonly_nfs_fip_pool_end }}" \
150+
--network StorageNFS
151+
fi
152+
environment:
153+
OS_CLOUD: standalone
154+
139155
- name: Create hostonly-sriov network # noqa no-changed-when
140156
when: sriov_interface is defined
141157
ansible.builtin.shell: |

playbooks/roles/ceph/tasks/storage-network.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
storage_subnet:
1515
ip_subnet: '{{ ceph_network }}'
1616
allocation_pools: [{'start': '{{ start }}', 'end': '{{ end }}'}]
17+
- name: StorageNFS
18+
mtu: 1350
19+
vip: true
20+
name_lower: storage_nfs
21+
service_net_map_replace: storage_nfs
22+
subnets:
23+
storage_subnet:
24+
ip_subnet: '{{ hostonly_nfs_cidr }}'
25+
allocation_pools: [{'start': '{{ hostonly_nfs_fip_pool_start }}', 'end': '{{ hostonly_nfs_fip_pool_end }}'}]
1726
1827
- name: Create deployed_network environment file (with VIPs)
1928
ansible.builtin.copy:
@@ -35,6 +44,10 @@
3544
ip_address: {{ mon_ip }}
3645
ip_subnet: {{ dummy_ip_cidr }}
3746
ip_address_uri: {{ mon_ip }}
47+
storage_nfs:
48+
ip_address: {{ hostonly_nfs_cidr | nthhost(1) }}
49+
ip_subnet: {{ hostonly_nfs_cidr }}
50+
ip_address_uri: {{ hostonly_nfs_cidr | nthhost(1) }}
3851
ControlPlaneVipData:
3952
fixed_ips:
4053
- ip_address: {{ control_plane_ip }}
@@ -49,6 +62,12 @@
4962
ip_address: {{ dummy_vip }}
5063
ip_address_uri: {{ dummy_vip }}
5164
ip_subnet: {{ dummy_vip ~ '/' ~ control_plane_prefix | string }}
65+
storage_nfs:
66+
ip_address: {{ hostonly_nfs_ganesha }}
67+
ip_address_uri: {{ hostonly_nfs_ganesha }}
68+
ip_subnet: {{ hostonly_nfs_cidr }}
69+
VipSubnetMap:
70+
StorageNFS: storage_nfs_subnet
5271
DeployedNetworkEnvironment:
5372
net_attributes_map:
5473
storage:
@@ -69,8 +88,29 @@
6988
host_routes: []
7089
ip_version: 4
7190
name: storage_subnet
91+
storage_nfs:
92+
network:
93+
dns_domain: storagenfs.mydomain.tld.
94+
mtu: 1350
95+
name: storage_nfs
96+
tags:
97+
- tripleo_network_name=StorageNFS
98+
- tripleo_net_idx=1
99+
- tripleo_service_net_map_replace=storage_nfs
100+
- tripleo_vip=true
101+
subnets:
102+
storage_nfs_subnet:
103+
cidr: {{ hostonly_nfs_cidr }}
104+
dns_nameservers: []
105+
gateway_ip: null
106+
host_routes: []
107+
ip_version: 4
108+
name: storage_nfs_subnet
72109
net_cidr_map:
73110
storage:
74111
- {{ ceph_network }}
112+
storage_nfs:
113+
- {{ hostonly_nfs_cidr }}
75114
net_ip_version_map:
76115
storage: 4
116+
storage_nfs: 4

playbooks/templates/dev-install_net_config.yaml.j2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@ network_config:
6464
name: dummy1
6565
nm_controlled: true
6666
mtu: {{ dcn_az is defined | ternary(hostonly_mtu, public_mtu) }}
67+
- type: ovs_bridge
68+
name: br-storage_nfs
69+
use_dhcp: false
70+
ovs_extra:
71+
- br-set-external-id br-storage_nfs bridge-id br-storage_nfs
72+
addresses:
73+
- ip_netmask: {{ hostonly_nfs_cidr | nthhost(1) }}/{{ hostonly_nfs_cidr | ansible.utils.ipaddr('prefix') }}
74+
members:
75+
{% for ip in tunnel_remote_ips %}
76+
- type: ovs_tunnel
77+
name: "tun-storage_nfs-{{ ip | to_uuid }}"
78+
tunnel_type: vxlan
79+
ovs_options:
80+
- remote_ip={{ ip }}
81+
- key=102
82+
{% endfor %}
83+
- type: interface
84+
name: dummy2
85+
nm_controlled: true
86+
mtu: {{ dcn_az is defined | ternary(hostonly_mtu, public_mtu) }}
6787
{% if sriov_interface is defined %}
6888
- type: sriov_pf
6989
name: {{ sriov_interface }}

playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
cluster_network: {{ control_plane_cidr }}
2727
public_network: {{ control_plane_cidr }}
2828
{% if manila_enabled %}
29-
ceph_nfs_bind_addr: "{{ public_api }}"
29+
ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}"
30+
tripleo_cephadm_ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}"
3031
{% endif %}

playbooks/templates/standalone_parameters.yaml.j2

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ resource_registry:
4646
{% endif %}
4747
parameter_defaults:
4848
CloudName: {{ hostname }}.{{ clouddomain }}
49+
# Enable ganesha
50+
EnableGanesha: true
51+
# Enable StorageNFS network
52+
StorageNFS: true
53+
ServiceNetMap:
54+
GaneshaNetwork: storage_nfs
55+
# Define StorageNFSIPs
56+
StorageNfsVip: "{{ hostonly_nfs_ganesha }}"
57+
# Define network configuration for StorageNFS
58+
StorageNFSNetCidr: {{ hostonly_nfs_cidr }}
59+
StorageNFSAllocationPools:
60+
- start: {{ hostonly_nfs_fip_pool_start }}
61+
- end: {{ hostonly_nfs_fip_pool_end }}
4962
ContainerCli: podman
5063
Debug: true
5164
DeploymentUser: {{ ansible_env.USER }}
@@ -183,9 +196,9 @@ parameter_defaults:
183196
oslo_messaging_rpc_use_ssl: false
184197
{% endif %}
185198
{% if manila_enabled %}
186-
ganesha_vip: "{{ public_api }}"
199+
ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}"
187200
# for cephadm support on OSP 17
188-
tripleo_cephadm_ceph_nfs_bind_addr: "{{ public_api }}"
201+
tripleo_cephadm_ceph_nfs_bind_addr: "{{ hostonly_nfs_ganesha }}"
189202
{% endif %}
190203
{% if standalone_extra_config|length > 0 %}
191204
{% for key, value in standalone_extra_config.items() %}

playbooks/vars/defaults.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ hostonly_sriov_prefix: "{{ hostonly_sriov_cidr | ansible.utils.ipaddr('prefix')
8080
hostonly_sriov_fip_pool_start: "{{ hostonly_sriov_cidr | nthhost(2) }}"
8181
hostonly_sriov_fip_pool_end: "{{ hostonly_sriov_cidr | nthhost(-2) }}"
8282

83+
# StorageNFSNetwork
84+
hostonly_nfs_cidr: 172.17.5.0/24
85+
hostonly_nfs_ganesha: "{{ hostonly_nfs_cidr | nthhost(129) }}"
86+
hostonly_nfs_prefix: "{{ hostonly_nfs_cidr | ansible.utils.ipaddr('prefix') }}"
87+
hostonly_nfs_fip_pool_start: "{{ hostonly_nfs_cidr | nthhost(150) }}"
88+
hostonly_nfs_fip_pool_end: "{{ hostonly_nfs_cidr | nthhost(-2) }}"
89+
8390
# Configuration used only by prepare_stack_testconfig, which is not run by
8491
# default.
8592
testconfig_private_cidr: 192.168.100.0/24
@@ -121,7 +128,7 @@ low_memory_usage: false
121128
# This param can be overriden, but only when overriding the network_config, otherwise the default
122129
# should work as is:
123130
# neutron_bridge_mappings:
124-
neutron_flat_networks: "external,hostonly,hostonly-sriov"
131+
neutron_flat_networks: "external,hostonly,hostonly-sriov,storage_nfs"
125132

126133
# If we have more than one SR-IOV device, it can be useful to override this one, but the default is safe
127134
# if we only use `sriov_interface` for one device.

0 commit comments

Comments
 (0)