Support multiple volumes per gadget.yaml
Bug #1641727 reported by
Barry Warsaw
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Image |
Fix Released
|
High
|
Barry Warsaw |
Bug Description
The gadget.yaml spec allows for multiple volumes (a.k.a. images) per gadget, but the ubuntu-image implementation only allows a single image.
The bug tracks the work to fully support multiple volumes if defined in the gadget.yaml
summary: |
- Support multiple volumes + Support multiple volumes per gadget.yaml |
Changed in ubuntu-image: | |
milestone: | none → 0.13 |
assignee: | nobody → Barry Warsaw (barry) |
Changed in ubuntu-image: | |
importance: | Undecided → High |
status: | New → In Progress |
Changed in ubuntu-image: | |
milestone: | 0.13 → 0.14 |
Changed in ubuntu-image: | |
milestone: | 0.14 → 0.15 |
Changed in ubuntu-image: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-image: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Thoughts on the impact of this on the CLI.
We have two options which assume a single disk image result, --output and --image-size. Both of these will have to change, but I think we can do it in a backward compatible way. If the gadget.yaml has only a single volume, then these can just do what they always did, i.e. name the values for that single volume.
If the gadget.yaml has multiple volumes, then what should u-i for these two options if given in previous syntax? We'd ultimately like to fail as early as possible, but we can't know there are multiple volumes in the gadget.yaml until we download the gadget snap. So that means we can't complain during argument parsing, and we'll have to throw away the little bit of work we've done downloading the gadget snap once we notice the incompatibility.
Other options:
* For --output, warn and ignore. The disk name will be taken from the volume name. my-disk- image.img -> my-disk- image-01. img etc. (Yes that likely means tricks with the suffix)
* For --output, warn and append a numeric suffix, e.g. --output=
* For --image-size, warn and use the given size for all disk images, with the current behavior if the size is too small (we ignore them, they are a minimum).
What to do about the case where --output isn't given? (We don't care about --image-size not given, those will just be calculated as normal). Instead of hardcoding the disk image file name to 'disk.img', it should be <volume-name>.img as taken from the gadget.yaml. We'll do this even if there's only a single volume in the gadget.yaml, so it's a minor CLI API break.
How to specify names and sizes for multiple volumes? Let's use a mapping from [volume- name|ordinal] -> value, e.g.
$ ubuntu-image -o 0:disk1.img -o 1:disk2.img -o first:disk3.img
This says, the first volume should be written to disk1.img, the second volume to disk2.img, and the volume named 'first' should be written to disk3.img. If there are any conflicts, (e.g. 'first' is the 0th volume), then warn and ignore.
Sanity check that there won't be any colliding disk file names.
A similar syntax would be used for --image-size, e.g.
$ ubuntu-image --image-size 0:10G --image-size second:12G
Again, if there are any conflicts, warn and ignore (first one wins).
I'm not sure how multi-volume support will affect the state machine options, but as those are mostly for debugging and development purposes, I won't worry about backward compatibility. How the implementation plays out will have a big effect on what happens here.