Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSASINFRA-3495: Adding a StrageNFS Network to work with Manila/Ganesha and Ceph #228

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
16 changes: 16 additions & 0 deletions playbooks/prepare_stack.yaml
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I'm creating the StorageNFS network using the default datacentre provider and the VLAN 70

Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@
fi
environment:
OS_CLOUD: standalone

Check failure on line 156 in playbooks/prepare_stack.yaml

View workflow job for this annotation

GitHub Actions / build

yaml[trailing-spaces]

Trailing spaces
- name: Create hostonly nfs network # noqa no-changed-when
when: manila_enabled
ansible.builtin.shell: |
if ! openstack network show StorageNFS; then
openstack network create StorageNFS --share --provider-network-type vlan --provider-physical-network datacentre --provider-segment 70
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 basic security group which allows SSH # noqa no-changed-when
ansible.builtin.shell: |
Expand Down
43 changes: 43 additions & 0 deletions playbooks/roles/ceph/tasks/storage-network.yml
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I'm defining the StorageNFS network to be used by Ceph

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
storage_subnet:
ip_subnet: '{{ ceph_network }}'
allocation_pools: [{'start': '{{ start }}', 'end': '{{ end }}'}]
- name: StorageNFS
mtu: 1500
vlan: 70
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:
Expand All @@ -35,6 +45,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_cidr | nthhost(1) }}
ControlPlaneVipData:
fixed_ips:
- ip_address: {{ control_plane_ip }}
Expand All @@ -49,6 +63,12 @@
ip_address: {{ dummy_vip }}
ip_address_uri: {{ dummy_vip }}
ip_subnet: {{ dummy_vip ~ '/' ~ control_plane_prefix | string }}
storage_nfs:
ip_address: {{ hostonly_nfs_ganesha }}
ip_address_uri: {{ hostonly_nfs_ganesha }}
ip_subnet: {{ hostonly_nfs_cidr }}
VipSubnetMap:
StorageNFS: storage_nfs_subnet
DeployedNetworkEnvironment:
net_attributes_map:
storage:
Expand All @@ -69,8 +89,31 @@
host_routes: []
ip_version: 4
name: storage_subnet
storage_nfs:
network:
dns_domain: storagenfs.mydomain.tld.
mtu: 1500
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
tags:
- tripleo_vlan_id=70
net_cidr_map:
storage:
- {{ ceph_network }}
storage_nfs:
- {{ hostonly_nfs_cidr }}
net_ip_version_map:
storage: 4
storage_nfs: 4
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the standalone_parameters.ceph_ansible.yaml to use the hostonly_nfs_ganesha defined defaults.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
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 }}"
{% endif %}
16 changes: 14 additions & 2 deletions playbooks/templates/standalone_parameters.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ resource_registry:
{% endif %}
parameter_defaults:
CloudName: {{ hostname }}.{{ clouddomain }}
# Enable ganesha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be conditional whether manila is enabled

EnableGanesha: true
# Enable StorageNFS network
StorageNFS: true
ServiceNetMap:
GaneshaNetwork: storage_nfs
StorageNFSNetworkVlanID: 70
# Define network configuration for StorageNFS
StorageNFSNetCidr: {{ hostonly_nfs_cidr }}
StorageNFSAllocationPools:
- start: {{ hostonly_sriov_fip_pool_start }}
- end: {{ hostonly_sriov_fip_pool_end }}
ContainerCli: podman
Debug: true
DeploymentUser: {{ ansible_env.USER }}
Expand Down Expand Up @@ -183,9 +195,9 @@ parameter_defaults:
oslo_messaging_rpc_use_ssl: false
{% endif %}
{% if manila_enabled %}
ganesha_vip: "{{ public_api }}"
ganesha_vip: {{ 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() %}
Expand Down
6 changes: 6 additions & 0 deletions playbooks/vars/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ 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) }}"

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) }}"

# Configuration used only by prepare_stack_testconfig, which is not run by
# default.
testconfig_private_cidr: 192.168.100.0/24
Expand Down
Loading