-
-
Notifications
You must be signed in to change notification settings - Fork 344
incusd/instance/qemu: Cleanup volume eject/detach logic #2330
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
Conversation
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
@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 |
There was a problem hiding this 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"]) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
Yeah, I did a quick test both with the special drives and with a regular one, behaved as expected. |
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