Skip to content

Conversation

stgraber
Copy link
Member

This removes some duplicate logic, avoids failures when volumes come from profiles and adds special-handling for our internal volumes.

Sponsored-by: https://webdock.io

This removes some duplicate logic, avoids failures when volumes come
from profiles and adds special-handling for our internal volumes.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: https://webdock.io
@stgraber
Copy link
Member Author

@bensmrs any issue with this?

It simplifies the logic a bit and fixes an issue where RHEL based systems would only boot successfully once as after that source=agent:config gets ejected and is no longer available after reboot.

Copy link
Contributor

@bensmrs bensmrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you tested it and it works well with non-agent/cloud-init drives, then LGTM

@@ -5935,8 +5910,27 @@ func (d *qemu) detachDisk(name string) error {
return err
}

// Check if it's a special device (we don't store detached state on those).
if slices.Contains([]string{"agent:config", "cloud-init:config"}, config["source"]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this would only trigger if the agent is added explicitly in Incus config. It avoids a round of DB transactions leading to an ignored error, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incus config device add MY-INSTANCE agent disk source=agent:config is what you have to do for all RHEL based images. All of those suddenly failed to start the agent with the addition of the attached property.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, I forgot how RHEL was painful to handle :)

}

// Find the disk device.
_, ok = d.localDevices[diskName]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure how I didn’t think about using localDevices in the PR.

@stgraber
Copy link
Member Author

Yeah, I did a quick test both with the special drives and with a regular one, behaved as expected.

@tych0 tych0 enabled auto-merge July 31, 2025 23:21
@tych0 tych0 merged commit c30da7e into lxc:main Jul 31, 2025
101 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants