canonical / canonical/cloud-init

[enhancement] Allow / Choose a way to tell cc_mounts.py to use UUID for the entries added to fstab

Open
#5,207 5 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

### Problem

On our systems, we have found that relying on /dev/sdX paths is not reliable and have tried various workarounds to avoid issues.

The solution we have recently implemented is to use the path provided in /dev/disk/by-id/. This has been working well so far.

However, we would prefer to rely on the disk's UUID, and the fstab is populated by cc_mounts.py, which we don't have much control over through configuration.

Would it be possible to provide a configuration option to use the newly created disk's UUID instead of the path ?

### Configuration sample

```
device_aliases:
disk-os: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0
swap: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1
disk_setup:
disk-os:
table_type: gpt
overwrite: false
swap:
table_type: gpt
layout: [[100, 82]]
overwrite: true
fs_setup:
- device: swap
filesystem: swap
```

This is how the fstab entry is filled :

` - cc_mounts.py[DEBUG]: Changes to fstab: ['+ /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part1 none swap sw,comment=cloudconfig 0 0']`

### Additional note

If UUIDs are not reliable either, would it be possible to at least provide an alternative ?

### Closure

Thank you for considering this feature request. We appreciate your time and effort in improving cloud-init.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.