Allow the data-disk fstype and directory to be set

As part of https://review.openstack.org/#/c/552047/ the ability to
specify the directory and fstype of the 2nd data disk was configured
(based on the lxc_container_backend). This wasn't backported, and since
the patch was large it would be impractical to backport the whole patch.

This PR backports only the ability to set the filesystem type and path
when configuring the data-disks, which means that using dir or other
backends will put the lxc containers onto the correct partition.

Additionally, set lxc_container_backing_store: "dir" inside the
bootstrap-hosts role. The default in the user_variables sample is dir in
anycase.

Change-Id: I60ec274d4d406aa27d24e8545085f84c6540f801
This commit is contained in:
Andy McCrae 2018-07-06 15:05:21 +01:00
parent a4fa7aee43
commit 8c59724f57
2 changed files with 15 additions and 4 deletions

View File

@ -220,9 +220,20 @@ bootstrap_host_data_disk_device_force: no
# size (in GB), the bootstrap process will use it.
bootstrap_host_data_disk_min_size: 50
bootstrap_host_data_disk2_formats:
machinectl: btrfs
zfs: zfs
btrfs: btrfs
dir: ext4
lvm: ext2
bootstrap_host_data_disk2_fs: "{{ bootstrap_host_data_disk2_formats[lxc_container_backing_store] }}"
bootstrap_host_data_disk2_path: "{{ (lxc_container_backing_store == 'machinectl' or container_tech == 'nspawn') | ternary('/var/lib/machines', '/var/lib/lxc') }}"
# Boolean option to build Amphora image and certs
bootstrap_host_octavia: "{{ (bootstrap_host_scenario in ['octavia', 'translations']) | bool }}"
lxc_container_backing_store: "dir"
### Optional Settings ###
# Specify the public IP address for the host.

View File

@ -45,7 +45,7 @@
with_items:
- "parted --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mklabel gpt"
- "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mkpart openstack-data1 ext4 0% 40%"
- "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mkpart openstack-data2 btrfs 40% 100%"
- "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mkpart openstack-data2 {{ bootstrap_host_data_disk2_fs }} 40% 100%"
tags:
- create-data-disk-partitions
@ -58,7 +58,7 @@
- dev: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}1"
fstype: "ext4"
- dev: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}2"
fstype: "btrfs"
fstype: "{{ bootstrap_host_data_disk2_fs }}"
tags:
- format-data-partitions
@ -72,8 +72,8 @@
- mount_point: /openstack
device: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}1"
fstype: ext4
- mount_point: /var/lib/machines
- mount_point: "{{ bootstrap_host_data_disk2_path }}"
device: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}2"
fstype: btrfs
fstype: "{{ bootstrap_host_data_disk2_fs }}"
tags:
- mount-data-partitions