Add a Nexus internal API endpoint for disk remove read only parent#2157
Merged
Conversation
Created a new internal API endpoint that allows a caller to remove a read only parent from a volume if they only know the UUID of the disk associated with that volume. This is basically just a wrapper that takes a disk UUID, extracts the volume_id from that disk, then calls the volume saga to remove the read only parent.
smklein
approved these changes
Jan 13, 2023
smklein
pushed a commit
that referenced
this pull request
Jan 18, 2023
…2157) When we create a disk, the saga generates both a disk_id and a volume_id We use both ids when we create the disk database record However, the `volume_id` here is only used as the key to store the volume data in the database. That volume_id is never exposed to anyone outside Nexus. For the actual volume data structure and later the VolumeConstructionRequest, we use the value in the disk_id, but call it volume_id. However, Propolis (who needs to call Nexus and tell it to remove a read only parent only has the top level disk UUID. The internal volume_id is not exposed. This adds a new internal API endpoint that will take the disk UUID, then lookup the volume_id and then call the volume layer remove read only parent saga. Adding a layer like this also allows tests that operate only on a volume level to not require any changes. Co-authored-by: Alan Hanson <alan@oxide.computer>
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.
When we create a disk, the saga generates both a
disk_idand avolume_idWe use both ids when we create the disk database record:
However, the
volume_idhere is only used as the key to store the volume datain the database. That volume_id is never exposed to anyone outside Nexus.
For the actual volume data structure and later the VolumeConstructionRequest,
we use the value in the
disk_id, but call itvolume_idThis is nice because it means the
volume_idthat propolis receives in the VCRwill match what the console has for a disk uuid, and it means stats will be
recorded under the same UUID.
However, Propolis (who needs to call Nexus and tell it to remove a read only parent
only has the top level disk UUID. The internal "volume_id" is not exposed.
This PR adds a new internal API endpoint that will take the disk UUID, then lookup
the volume_id and then call the volume layer remove read only parent saga. Adding
a layer like this also allows tests that operate only on a volume level to not require
any changes.