Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: Specify storage volume type in disk device source #14491

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

MggMuggins
Copy link
Contributor

This change lays the groundwork for attaching VM root disk devices to instances by making two changes:

Refactor

Renames (Un)MountCustomVolume -> (Un)MountVolume to allow for generic activation of virtual-machine and container volumes.

Specify volume type in disk device

Allows the following syntax for specifying custom storage volumes in disk devices:

devices:
  cosmic-dust-analyzer-data:
	pool: default
	source: custom/cosmic-dust-analyzer-data
	type: disk

(I was incorrect in my assessment that we already support this syntax; the code was there but wasn't being used consistently)

@MggMuggins MggMuggins marked this pull request as ready for review November 19, 2024 15:52
@MggMuggins MggMuggins force-pushed the jira-2160/specify-storage-volume-type branch from 3eabf13 to be19fcc Compare November 20, 2024 06:32
lxd/storage/utils.go Outdated Show resolved Hide resolved
lxd/storage/utils.go Outdated Show resolved Hide resolved
lxd/storage/utils.go Outdated Show resolved Hide resolved
lxd/device/disk.go Outdated Show resolved Hide resolved
lxd/device/disk.go Outdated Show resolved Hide resolved
@MggMuggins MggMuggins force-pushed the jira-2160/specify-storage-volume-type branch from be19fcc to 3d0131e Compare November 22, 2024 23:33
@MggMuggins MggMuggins force-pushed the jira-2160/specify-storage-volume-type branch 2 times, most recently from d546641 to 2e71130 Compare November 26, 2024 02:29
This function:
- Is not clearly named (it returns a path)
- Is used in exactly one place
- Does 1 uneeded DB query

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
This saves us 1 db query.

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
virtual-machine/container volumes in the default project do not include
the project name.

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Allows device `source` property as `custom/name`

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
This section will be expanded for virtual-machine volumes later

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
@MggMuggins MggMuggins force-pushed the jira-2160/specify-storage-volume-type branch from 2e71130 to 7b9f6d0 Compare November 26, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants