diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index 61593cec75..0e56410214 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -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 }}" diff --git a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml index 149a3fe1b7..09161d21c7 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml @@ -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: diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_btrfs.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_btrfs.yml index 362f00581b..eebcaeaaaf 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_btrfs.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_btrfs.yml @@ -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 diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_machines.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_machines.yml index f414f7dfc4..3731f9cdf2 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_machines.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_machines.yml @@ -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 diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_nova.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_nova.yml index 298920ebdd..a59f367e22 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_nova.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_nova.yml @@ -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: diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_swap.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_swap.yml index a1578f59a5..838f934b59 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_swap.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_swap.yml @@ -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 diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_swift.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_swift.yml index e573b9074a..3175956bcf 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_swift.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_swift.yml @@ -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