Implementing device_aliases as described in docs#945
Merged
Conversation
TheRealFalcon
approved these changes
Aug 3, 2021
Contributor
TheRealFalcon
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Your changes look good. I am also pushing an integration test to your branch for this behavior.
547845c to
fef6cc4
Compare
TheRealFalcon
pushed a commit
to TheRealFalcon/cloud-init
that referenced
this pull request
Aug 10, 2021
Implement missing device_aliases feature The device_aliases key has been documented as part of disk_setup for years, however the feature was never implemented. This implements the feature as documented allowing usercfg (rather than dsconfig) to create a mapping of device names. This is not to be confused with disk_aliases, a very similar map but existing solely for use by datasources. LP: #1867532
This was referenced May 12, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Commit Message
Additional Context
As summarised by @blackboxsw during cloud-init bi-weekly office-hours meeting 2021-07-13.
The more common of the cases here is the avoidance of repetition and improved readability of the config, especially when running to eight plus disks. This is probably best considered as the primary motivator here, however below is an attempt to clarify one of the nebulous "migration reasons" with a fairly contrived hypothetical inspired by a real-world case I'm currently dealing with:
The headline summary of my real-world case reads something like: Reattach disks to a stopped cloud instance as different devices, without cloud-init getting upset and trying to treat them as the devices originally at those locations.
sda->sdb,sdb->sdc,sdc->sda.device_aliasesdescribing this remapping to/etc/cloud.Since the natural response is to ask why this couldn't be done using a new VM with correct configuration in userdata, it's worth addressing here. That would be the preferred option in many cases, however in this one data that must be persisted is written to the OS disk, which cannot be mounted on a separate VM. Because of course it was. 🤦
Test Steps
sanitize_devnametestsChecklist:
cc_mountonly,cc_disk_setupis DI which doesn't seem trivially testable.