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
rbd: add support to create clone in different pools #2105
Conversation
/retest ci/centos/mini-e2e-helm/k8s-1.19 |
rook deployment failed with
|
@@ -566,6 +566,7 @@ func (rv *rbdVolume) getCloneDepth(ctx context.Context) (uint, error) { | |||
depth++ | |||
} | |||
vol.RbdImageName = vol.ParentName | |||
vol.Pool = vol.ParentPool |
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.
Same issue as before, re-using a rbdVolume with different attributes is quite wrong. Needs cleanup urgently.
CI failure due to #2146 |
@@ -114,8 +114,10 @@ type rbdVolume struct { | |||
Topology map[string]string | |||
// DataPool is where the data for images in `Pool` are stored, this is used as the `--data-pool` | |||
// argument when the pool is created, and is not used anywhere else |
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.
@Yuggupta27 not introduced with this patch, but please feel free to correct the DataPool
explanation intendation.
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.
Sure, I'll send a seperate PR to fix the same
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.
Here #2154
scPath := fmt.Sprintf("%s/%s", rbdExamplePath, "storageclass.yaml") | ||
sc, err := getStorageClass(scPath) | ||
if err != nil { | ||
return nil | ||
} | ||
if name != "" { | ||
sc.Name = name |
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.
@Yuggupta27 also keep sc.Name
in proper spacing compared to outer condition check
/retest all |
@Yuggupta27 As discussed please get the comments addressed in other PR . will get this in for now! Thanks 👍 |
/retest all |
/retest ci/centos/mini-e2e/k8s-1.19 |
rook deployment failure |
/retest all |
@Mergifyio rebase |
Command
|
added support to create image in different pool. if the snapshot/rbd image exists in one pool we can create a clone the clone of the rbd image to a different pool. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
as we are supporting the creation of clone to a new pool we need to pass the correct parent volume to cleanup the snapshot on parent volume. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
when clones are created in different pool,we need to retrieve the parent pool to get the information of the parent image. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
if the parent and child clones are in different namespaces we need to open a new ioctx for pools. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
Validate Snapshot request to check if the passed pool name is not empty. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
While traversing image chain, the parent image can be present in a different pool that the one child is in. So, updating pool name in the next itteration to that of the Parent. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
made pool as a argument of listRBDImages to support listing of rbd images in different pools. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
added a new function to create rbd pool in e2e. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
added an option to set storageclass name. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
declared yaml filepath in gobal for reusing. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
added a helper function to test clone creation in a different pool. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
added a e2e to test clones in different pool. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
logErr function logs all the ocured errors with a message that is passed for occurence of each error. Co-authored-by: Niels de Vos <ndevos@redhat.com> Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
/retest ci/centos/upgrade-tests-cephfs |
/retest ci/centos/mini-e2e/k8s-1.19 |
Add support to restore a pvc into a different pool.
Assuming there are 2 pools namely "replicapool" and "testpool"
Workflow:
Co-authored-by: Madhu Rajanna madhupr007@gmail.com
Updates: #1838