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

[cinder-csi-plugin] add cluster id to snapshot metadata #1544

Merged
merged 1 commit into from Jun 16, 2021

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented May 27, 2021

What this PR does / why we need it:

Now cluster id is set by --cluster argument at the driver's start. When it's set, cinder CSI controller appends the cluster id to volumes metadata during creation. Unfortunately it doesn't happen for volume snapshots, which makes it harder to find them after cluster deletion.

This commit adds cluster id to snapshots metadata to unify the behavior with volumes.

[cinder-csi-plugin] Append cluster ID (value of `--cluster`) to metadata of snapshots in the cloud when creating VolumeSnapshot.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 27, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 27, 2021
@Fedosin Fedosin force-pushed the snapshot_metadata_clusterid branch from c6d66ad to 5a7b499 Compare May 27, 2021 08:16
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 27, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build succeeded.

// TODO: Delegate the check to openstack itself and ignore the conflict
snap, err = cs.Cloud.CreateSnapshot(name, volumeId, &req.Parameters)
snap, err = cs.Cloud.CreateSnapshot(name, volumeId, &properties)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not related to this PR
but seems CreateSnapshot and CreateVolume take req.Parameters in different manner

CreateVolume doesn't contain req.parameter into tags and in turn put into metadata...

https://github.com/container-storage-interface/spec/blob/master/spec.md
says param

// Plugin specific parameters passed in as opaque key-value pairs.
  // This field is OPTIONAL. The Plugin is responsible for parsing and
  // validating these parameters. COs will treat these as opaque.
  // Use cases for opaque parameters:
  // - Specify a policy to automatically clean up the snapshot.
  // - Specify an expiration date for the snapshot.
  // - Specify whether the snapshot is readonly or read/write.
  // - Specify if the snapshot should be replicated to some place.
  // - Specify primary or secondary for replication systems that
  //   support snapshotting only on primary.

so we should re-consider this to avoid put all those param into metadata or vice versa (line 107 above) , make all param to volume req ..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's what I was going to ask... As you said, for volumes we sanitize req parameters, but for snapshots we put them all in metadata.
I didn't modify this behavior in my PR to support backward compatibility, but I agree that we need to reconsider what we actually put there.

Copy link
Contributor

Choose a reason for hiding this comment

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

#1545 opened

Now cluster id is set by --cluster argument at the driver's start.
When it's set, cinder csi controller appends volumes metadata with
the cluster id.

Unfortunatelly it doesn't happen for volume snapshots, which makes
it harder to find them after cluster deletion.

This commit adds cluster id to snapshots metadata to unify the
behavior with volumes.
@Fedosin Fedosin force-pushed the snapshot_metadata_clusterid branch from 5a7b499 to 71da4d1 Compare May 27, 2021 09:51
@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build failed.

@Fedosin
Copy link
Contributor Author

Fedosin commented May 27, 2021

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@Fedosin: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 27, 2021

Build failed.

@Fedosin
Copy link
Contributor Author

Fedosin commented May 30, 2021

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@Fedosin: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 30, 2021

Build failed.

@Fedosin
Copy link
Contributor Author

Fedosin commented May 31, 2021

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@Fedosin: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 31, 2021

Build failed.

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 7, 2021

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@Fedosin: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 7, 2021

Build failed.

@jichenjc
Copy link
Contributor

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@jichenjc: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jichenjc
Copy link
Contributor

/test cloud-provider-openstack-multinode-csi-migration-test

@k8s-ci-robot
Copy link
Contributor

@jichenjc: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-multinode-csi-migration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 10, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 10, 2021

Build failed.

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 15, 2021

/test cloud-provider-openstack-e2e-test-csi-cinder

@k8s-ci-robot
Copy link
Contributor

@Fedosin: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-e2e-test-csi-cinder

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 15, 2021

Build succeeded.

@lingxiankong
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2021
@ramineni
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ramineni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit f88591c into kubernetes:master Jun 16, 2021
powellchristoph pushed a commit to powellchristoph/cloud-provider-openstack that referenced this pull request Jan 19, 2022
)

Now cluster id is set by --cluster argument at the driver's start.
When it's set, cinder csi controller appends volumes metadata with
the cluster id.

Unfortunatelly it doesn't happen for volume snapshots, which makes
it harder to find them after cluster deletion.

This commit adds cluster id to snapshots metadata to unify the
behavior with volumes.
stephenfin added a commit to shiftstack/installer that referenced this pull request May 17, 2022
This reverts commit a272e59. As noted
in the corresponding bug [1], the expectation was always to revert this
once cloud-provided-openstack started providing cluster ID information
in snapshot metadata, which has been the case for some time now [2].

Conflicts:
  pkg/destroy/openstack/openstack.go

Changes:
  pkg/destroy/openstack/openstack.go

NOTE(stephenfin): Conflicts are due to commit 375fe6f ("OpenStack:
Optimize cluster deletion") which changed two blocks so that we now
continue in a loop rather than returning early. We introduce this same
logic into a newly restored block inside 'deleteSnapshots' to prevent a
regression here.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1965468
[2] kubernetes/cloud-provider-openstack#1544

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
TrilokGeer pushed a commit to TrilokGeer/installer that referenced this pull request Sep 14, 2022
This reverts commit a272e59. As noted
in the corresponding bug [1], the expectation was always to revert this
once cloud-provided-openstack started providing cluster ID information
in snapshot metadata, which has been the case for some time now [2].

Conflicts:
  pkg/destroy/openstack/openstack.go

Changes:
  pkg/destroy/openstack/openstack.go

NOTE(stephenfin): Conflicts are due to commit 375fe6f ("OpenStack:
Optimize cluster deletion") which changed two blocks so that we now
continue in a loop rather than returning early. We introduce this same
logic into a newly restored block inside 'deleteSnapshots' to prevent a
regression here.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1965468
[2] kubernetes/cloud-provider-openstack#1544

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants