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

Support server side copy/move of custom storage volumes in clusters #12386

Conversation

monstermunchkin
Copy link
Contributor

@monstermunchkin monstermunchkin commented Oct 13, 2023

Fixes #11445

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Oct 13, 2023
@monstermunchkin monstermunchkin force-pushed the issues/11445-server-side-move-for-custom-storage-volumes branch from 5166e54 to 8db2b54 Compare October 16, 2023 08:17
@tomponline
Copy link
Member

As discussed, lets lose the target group selection logic and always expect a specific cluster member name for target.

lxd/db/node.go Outdated Show resolved Hide resolved
lxd/storage_volumes.go Outdated Show resolved Hide resolved
lxd/storage_volumes.go Outdated Show resolved Hide resolved
lxd/storage_volumes.go Outdated Show resolved Hide resolved
@monstermunchkin monstermunchkin force-pushed the issues/11445-server-side-move-for-custom-storage-volumes branch 2 times, most recently from 08b85cf to bfd97e2 Compare October 19, 2023 20:48
@tomponline
Copy link
Member

@monstermunchkin please can you rebase and push again as the tests didnt run for some reason

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
@monstermunchkin monstermunchkin force-pushed the issues/11445-server-side-move-for-custom-storage-volumes branch from bfd97e2 to b7e758a Compare October 23, 2023 12:33
if err != nil {
// Check if the user provided an incorrect target query parameter and return a helpful error message.
_, volumeNotFound := api.StatusErrorMatch(err, http.StatusNotFound)
targetIsSet := r.URL.Query().Get("target") != ""
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the same as testing target := queryParam(r, "target") from line 1136?

serverIsClustered, _ := lxdCluster.Enabled(s.DB.Node)

if serverIsClustered && targetIsSet && volumeNotFound {
return response.NotFound(fmt.Errorf("Storage volume not found on this cluster member"))
Copy link
Member

Choose a reason for hiding this comment

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

Im a bit confused by this error as its only for ceph volumes that are not member specific?

// Check if the user provided an incorrect target query parameter and return a helpful error message.
_, volumeNotFound := api.StatusErrorMatch(err, http.StatusNotFound)
targetIsSet := r.URL.Query().Get("target") != ""
serverIsClustered, _ := lxdCluster.Enabled(s.DB.Node)
Copy link
Member

Choose a reason for hiding this comment

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

why are we doing this again here, it was ascertain on line 1139?

@@ -555,8 +555,10 @@ func (r *ProtocolLXD) CopyStoragePoolVolume(pool string, source InstanceServer,
return nil, fmt.Errorf("Failed to get destination connection info: %w", err)
}

clusterInternalVolumeCopy := r.CheckExtension("cluster_internal_custom_volume_copy") == nil

// Copy the storage pool volume locally.
Copy link
Member

Choose a reason for hiding this comment

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

comment needs updating now

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Please can you follow up with those requested changes as a separate PR?

@tomponline tomponline merged commit 9f78fdb into canonical:main Oct 25, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement server side move for custom storage volumes
2 participants