openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_loopback_machines.yml
Kevin Carter 986e35ab4e 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>
2018-05-18 22:14:50 +00:00

44 lines
1.3 KiB
YAML

---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create sparse machines file
command: "truncate -s {{ bootstrap_host_loopback_machines_size }}G /openstack/machines.img"
args:
creates: /openstack/machines.img
tags:
- machines-file-create
- name: Format the machines file
filesystem:
fstype: btrfs
dev: /openstack/machines.img
tags:
- machines-format-file
- name: Run the systemd mount role
include_role:
name: systemd_mount
private: true
vars:
systemd_mounts:
- what: "/openstack/machines.img"
where: "/var/lib/machines"
options: "loop,{{ bootstrap_host_data_mount_options['btrfs'] }}"
type: "btrfs"
state: 'started'
enabled: true
tags:
- machines-config