Browse Source

Use UUID for mounted SwiftRawDisks

When SwiftRawDisks is set, try to mount the disks using uuids instead of
paths. This makes mounts more stable, eg. if a kernel gets updates and
device orders are changed.

This patch will also update existing entries in /etc/fstab and replaces
the device path with the corresponding UUID.

Change-Id: I275b962447015e804638ccf85c63a22d1bb6e3d6
(cherry picked from commit 6206d19592)
changes/07/750307/1
Christian Schwede 1 month ago
committed by Giulio Fidente
parent
commit
ea0cd3c37e
2 changed files with 13 additions and 1 deletions
  1. +7
    -1
      deployment/swift/swift-storage-container-puppet.yaml
  2. +6
    -0
      releasenotes/notes/swift-mount-by-uuid-7744fe7696db4b85.yaml

+ 7
- 1
deployment/swift/swift-storage-container-puppet.yaml View File

@@ -633,10 +633,16 @@ outputs:
opts: -f -i size=1024
with_items: "{{ swift_raw_disks }}"
when: swift_raw_disks
- name: Refresh facts if SwiftRawDisks is set to get uuids if newly created partitions
setup:
gather_subset:
- '!all'
- 'hardware'
when: swift_raw_disks
- name: Mount devices defined in SwiftRawDisks
mount:
name: /srv/node/{{ item }}
src: "{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}"
src: "{% if lsblk.results['uuids'][item] is defined %}UUID={{ ansible_device_links['uuids'][item][0] }}{% else %}{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}{% endif %}"
fstype: xfs
opts: noatime
state: mounted


+ 6
- 0
releasenotes/notes/swift-mount-by-uuid-7744fe7696db4b85.yaml View File

@@ -0,0 +1,6 @@
---
features:
- |
When SwiftRawDisks is set, try to mount the disks using uuids instead of
paths. This makes mounts more stable, eg. if a kernel gets updates and
device orders are changed.

Loading…
Cancel
Save