Add mnaio_data_disk_suffix var to support NVMe partition naming

NVMe partitions generally show a `p` before the partition number,
causing the existing data disk partitioning script to fail. The
new var support changing the suffix to support alternative naming
schemes. The default remains '1' for backwards compatibility.

Change-Id: I7c0039ee13ba301c152424fc0b327195ec6a4367
This commit is contained in:
James Denton 2019-01-11 19:11:30 +00:00
parent a1d6ebe4d3
commit 08edc0c696
3 changed files with 12 additions and 2 deletions

View File

@ -33,6 +33,14 @@ by exporting the extra var before running build.sh, eg:
export MNAIO_ANSIBLE_PARAMETERS="-e mnaio_data_disk=sdb"
./build.sh
NVMe partitions generally show a ``p`` before the partition number. The default
suffix of ``1`` for ``sdb1`` can be changed to ``p1`` to support NVMe naming
conventions using the ``mnaio_data_disk_suffix`` extra var shown here:
.. code-block:: bash
export MNAIO_ANSIBLE_PARAMETERS="-e mnaio_data_disk=nvme0n1 -e mnaio_data_disk_suffix=p1"
./build.sh
The playbooks will look for a volume group named "vg01", if this volume group
exists no partitioning or setup on the data disk will take place. To effectively
use this process for testing it's recommended that the host machine have at least

View File

@ -107,6 +107,8 @@ images:
# mnaio_data_disk: 'sdc' # str - not required, set this to define a given data disk if no data disk
# is defined the largest unpartitioned disk will be used.
# mnaio_data_disk_suffix: 1 # str - not required, set this correspond to partition scheme
mnaio_host_networks:
dhcp:
iface: 'vm-br-dhcp' # str - required, interface name

View File

@ -365,14 +365,14 @@
- name: Prepare the data disk file system
filesystem:
fstype: ext4
dev: "/dev/{{ mnaio_data_disk }}1"
dev: "/dev/{{ mnaio_data_disk }}{{ mnaio_data_disk_suffix | default('1') }}"
force: yes
when:
- _add_partition is changed
- name: Mount the data disk
mount:
src: "/dev/{{ mnaio_data_disk }}1"
src: "/dev/{{ mnaio_data_disk }}{{ mnaio_data_disk_suffix | default('1') }}"
path: /data
state: mounted
fstype: ext4