Add mount options whenever formatting disks

This change provides mount options for all of the file system types
we use. These mount options will ensure that the underlying file systems
react with the best possible performance when building a test cloud. The
main motivation behind this patch is to help resolve bug 1753790 which
is causing sporatic failure when gating on RAX test instances that have
a secondary data disks. We were providing no options when mounting a
secondary disk which results in using the system defaults which may not
be very optimal under general workloads. The options have been added to
the bootstrap role and will be consistently applied whenever a given FS
is used.

> Part of this chagne is to modify the FS type for /var/lib/nova. We
  were using EXT4 and the recommended FS for VM workloads is XFS.

> The mount options have largely been derived from the following posts,
  https://www.phoronix.com/scan.php?page=article&item=linux414-fs-compare&num=1
  https://www.phoronix.com/scan.php?page=article&item=linux-415-fs&num=1

Change-Id: I75e00af687d46551e19178604b60665342cf2cae
Closes-Bug: #1753790
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-05-17 13:47:53 -05:00 committed by Kevin Carter (cloudnull)
parent 3067deaa4e
commit 986e35ab4e
7 changed files with 24 additions and 10 deletions

View File

@ -236,13 +236,25 @@ bootstrap_host_data_disk2_formats:
machinectl: btrfs
zfs: zfs
btrfs: btrfs
xfs: xfs
dir: ext4
lvm: ext2
#
# Set the data disk mount options.
bootstrap_host_data_mount_options:
machinectl: "noatime,nodiratime,compress=lzo,commit=120,{{ (ansible_kernel is version_compare('4.5', '>=')) | ternary('space_cache=v2', 'space_cache') }}"
zfs: "defaults"
btrfs: "noatime,nodiratime,compress=lzo,commit=120,{{ (ansible_kernel is version_compare('4.5', '>=')) | ternary('space_cache=v2', 'space_cache') }}"
xfs: "noatime,nodiratime,nobarrier,logbufs=8,logbsize=256k"
ext4: "noatime,nobh,barrier=0,data=writeback"
dir: "defaults"
lvm: "defaults"
swap: "%%"
bootstrap_host_data_disk2_fs: "{{ bootstrap_host_data_disk2_formats[lxc_container_backing_store] }}"
bootstrap_host_data_disk2_fs_mount_options: "{{ bootstrap_host_data_mount_options[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']) | bool }}"

View File

@ -86,6 +86,7 @@
- what: "/dev/{{ _bootstrap_host_data_disk_device }}1"
where: "/openstack"
type: "ext4"
options: "{{ bootstrap_host_data_mount_options['ext4'] }}"
state: 'started'
enabled: true
tags:
@ -100,6 +101,7 @@
- what: "/dev/{{ _bootstrap_host_data_disk_device }}2"
where: "{{ bootstrap_host_data_disk2_path }}"
type: "{{ bootstrap_host_data_disk2_fs }}"
options: "{{ bootstrap_host_data_disk2_fs_mount_options }}"
state: 'started'
enabled: true
when:

View File

@ -31,7 +31,7 @@
systemd_mounts:
- what: "/openstack/lxc-btrfs.img"
where: "/var/lib/lxc"
options: "loop"
options: "loop,{{ bootstrap_host_data_mount_options['btrfs'] }}"
type: "btrfs"
state: 'started'
enabled: true

View File

@ -35,7 +35,7 @@
systemd_mounts:
- what: "/openstack/machines.img"
where: "/var/lib/machines"
options: "loop,defaults,noatime,nodiratime,compress=lzo,commit=120,{{ (ansible_kernel is version_compare('4.5', '>=')) | ternary('space_cache=v2', 'space_cache') }}"
options: "loop,{{ bootstrap_host_data_mount_options['btrfs'] }}"
type: "btrfs"
state: 'started'
enabled: true

View File

@ -22,7 +22,7 @@
- name: Format the Nova file
filesystem:
fstype: ext4
fstype: xfs
dev: /openstack/nova.img
tags:
- nova-format-file
@ -35,8 +35,8 @@
systemd_mounts:
- what: "/openstack/nova.img"
where: "/var/lib/nova/instances"
options: "loop"
type: "ext4"
options: "loop,{{ bootstrap_host_data_mount_options['xfs'] }}"
type: "xfs"
state: 'started'
enabled: true
tags:

View File

@ -37,7 +37,7 @@
systemd_mounts:
- what: "/openstack/swap.img"
priority: "0"
options: "%%"
options: "{{ bootstrap_host_data_mount_options['swap'] }}"
type: "swap"
state: 'started'
enabled: true

View File

@ -44,19 +44,19 @@
systemd_mounts:
- what: "/openstack/swift1.img"
where: "/srv/swift1.img"
options: "loop,noatime,nodiratime,nobarrier,logbufs=8"
options: "loop,{{ bootstrap_host_data_mount_options['xfs'] }}"
type: "xfs"
state: 'started'
enabled: true
- what: "/openstack/swift2.img"
where: "/srv/swift2.img"
options: "loop,noatime,nodiratime,nobarrier,logbufs=8"
options: "loop,{{ bootstrap_host_data_mount_options['xfs'] }}"
type: "xfs"
state: 'started'
enabled: true
- what: "/openstack/swift3.img"
where: "/srv/swift3.img"
options: "loop,noatime,nodiratime,nobarrier,logbufs=8"
options: "loop,{{ bootstrap_host_data_mount_options['xfs'] }}"
type: "xfs"
state: 'started'
enabled: true