Scott Solkhon 6496cfc0ba Support for Ceph and Swift storage networks, and improvements to Swift
In a deployment that has both Ceph or Swift deployed it can be useful to seperate the network traffic.
This change adds support for dedicated storage networks for both Ceph and Swift. By default, the storage hosts are
attached to the following networks:

* Overcloud admin network
* Internal network
* Storage network
* Storage management network

This adds four additional networks, which can be used to seperate the storage network traffic as follows:

* Ceph storage network (ceph_storage_net_name) is used to carry Ceph storage
  data traffic. Defaults to the storage network (storage_net_name).
* Ceph storage management network (ceph_storage_mgmt_net_name) is used to carry
  storage management traffic. Defaults to the storage management network
  (storage_mgmt_net_name).
* Swift storage network (swift_storage_net_name) is used to carry Swift storage data
  traffic. Defaults to the storage network (storage_net_name).
* Swift storage replication network (swift_storage_replication_net_name) is used to
  carry storage management traffic. Defaults to the storage management network
  (storage_mgmt_net_name).

This change also includes several improvements to Swift device management and ring generation.

The device management and ring generation are now separate, with device management occurring during
'kayobe overcloud host configure', and ring generation during a new command, 'kayobe overcloud swift rings generate'.

For the device management, we now use standard Ansible modules rather than commands for device preparation.
File system labels can be configured for each device individually.

For ring generation, all commands are run on a single host, by default a host in the Swift storage group.
A python script runs in one of the kolla Swift containers, which consumes an autogenerated YAML config file that defines
the layout of the rings.

Change-Id: Iedc7535532d706f02d710de69b422abf2f6fe54c
2019-04-24 12:40:20 +00:00

73 lines
2.1 KiB
YAML

---
- name: Fail if swift_block_devices is not in the expected format
fail:
msg: >-
Device {{ device_index }} in swift_block_devices is in an invalid format.
Items should be a dict, containing at least a 'device' field.
with_items: "{{ swift_block_devices }}"
when: item is not mapping or 'device' not in item
loop_control:
index_var: device_index
- name: Ensure required packages are installed
package:
name: "{{ item }}"
state: installed
become: True
when: swift_block_devices | length > 0
with_items:
- parted
- xfsprogs
- name: Check the presence of a partition on the Swift block devices
become: True
parted:
device: "{{ item.device }}"
with_items: "{{ swift_block_devices }}"
loop_control:
label: "{{ item.device }}"
register: swift_disk_info
- name: Fail if the Swift block devices have already a partition
fail:
msg: >
The physical disk {{ item.item.device }} already has a partition.
Ensure that each disk in 'swift_block_devices' does not have any
partitions.
with_items: "{{ swift_disk_info.results }}"
when:
- item.partitions | length > 0
- item.partitions.0.name != swift_block_devices_part_label
loop_control:
label: "{{ item.item.device }}"
- name: Ensure partitions exist for Swift block device
become: True
parted:
device: "{{ item.item.device }}"
number: 1
label: gpt
name: "{{ swift_block_devices_part_label }}"
state: present
with_items: "{{ swift_disk_info.results }}"
when: item.partitions | length == 0
loop_control:
label: "{{ item.item.device }}"
- name: Ensure Swift XFS file systems exist
become: true
filesystem:
dev: "{{ partition_name }}"
force: true
fstype: xfs
opts: "-L {{ fs_label }}"
with_items: "{{ swift_disk_info.results }}"
when: item.partitions | length == 0
loop_control:
label: "{{ device }}"
index_var: index
vars:
device: "{{ item.item.device }}"
partition_name: "{{ device }}{% if device.startswith('/dev/loop') %}p{% endif %}1"
fs_label: "{{ item.item.fs_label | default(device | basename) }}"