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
mgr/dashboard: RBD copy, RBD flatten and snapshot clone (frontend) #21526
Conversation
62bf6ce
to
b1ed769
Compare
@@ -33,6 +33,12 @@ | |||
<span *ngIf="selection.first()?.is_protected"><i class="fa fa-fw fa-unlock"></i><span i18n>Unprotect</span></span> | |||
</a> | |||
</li> | |||
<li role="menuitem" | |||
[ngClass]="{'disabled': !selection.hasSingleSelection || selection.first().executing || !selection.first().is_protected}"> |
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.
Starting w/ Mimic, you do not need to use protected snapshots to clone an image if clone v2 is enabled. It would be based on the rbd_default_clone_format
configuration setting:
1
: require a protected snapshot
2
: do not require a protected snapshot
auto
: check the OSD maps' min_compat_client
/ require_min_compat_client
values and if the minimum client is at least Mimic, do not require a protected snapshot.
<a class="dropdown-item" routerLink="/rbd/clone/{{ poolName }}/{{ rbdName }}/{{ selection.first()?.name }}"> | ||
<i class="fa fa-fw fa-clone"></i><span i18n>Clone</span> | ||
</a> | ||
</li> | ||
<li role="menuitem" |
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.
Nit: add support for copying an image snapshot
request.child_pool_name = this.rbdForm.get('pool').value; | ||
request.child_image_name = this.rbdForm.get('name').value; | ||
request.obj_size = this.formatter.toBytes(this.rbdForm.get('obj_size').value); | ||
if (!this.defaultFeaturesFormControl.value) { |
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.
Nit: when I cloned an image w/ default features, the clone model didn't have the default features checkbox selected but did have each individual feature selected.
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've now created a new REST API endpoint to get the default features from the "rbd_default_features" config, which allowed me to remove the "Default features" checkbox from the UI.
Default features will now be pre-selected on the creation form, which I believe is an usability improvement.
request.dest_pool_name = this.rbdForm.get('pool').value; | ||
request.dest_image_name = this.rbdForm.get('name').value; | ||
request.obj_size = this.formatter.toBytes(this.rbdForm.get('obj_size').value); | ||
if (!this.defaultFeaturesFormControl.value) { |
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.
Nit: same comment here
<li role="menuitem" | ||
[ngClass]="{'disabled': !selection.hasSingleSelection || selection.first().executing}"> | ||
<a class="dropdown-item" routerLink="/rbd/copy/{{ selection.first()?.pool_name }}/{{ selection.first()?.name }}"><i class="fa fa-fw fa-copy"></i><span i18n>Copy</span></a> | ||
</li> | ||
<li role="menuitem" | ||
[ngClass]="{'disabled': !selection.hasSingleSelection || selection.first().executing}"> | ||
<a class="dropdown-item" (click)="deleteRbdModal()"><i class="fa fa-fw fa-trash-o"></i><span i18n>Delete</span></a> |
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.
Nit: not related to this PR, but when I attempted to delete a parent image, I correctly received an error alert but the delete modal did not automatically close (it just stuck spinning, forcing me to click cancel).
c277aed
to
68d8a94
Compare
I've pushed a new commit with RBD flatten functionality. |
68d8a94
to
2b5c3fa
Compare
You need to adapt your controller to the latest changes. |
0b2b3e3
to
0def4f0
Compare
0def4f0
to
5cd040c
Compare
qa/tasks/mgr/dashboard/test_rbd.py
Outdated
|
||
def test_flatten(self): | ||
self.create_snapshot('rbd', 'img1', 'snapf') | ||
self._rbd_cmd(['snap', 'protect', 'rbd/img1@snapf']) |
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 prefer to use our own REST API endpoints to do this, to get better coverage of our own code.
For instance, use: self.update_snapshot('rbd', 'img1', 'snapf', None, True)
qa/tasks/mgr/dashboard/test_rbd.py
Outdated
def test_flatten(self): | ||
self.create_snapshot('rbd', 'img1', 'snapf') | ||
self._rbd_cmd(['snap', 'protect', 'rbd/img1@snapf']) | ||
self._rbd_cmd(['clone', 'rbd/img1@snapf', 'rbd_iscsi/img1_snapf_clone']) |
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.
Maybe use: self.clone_image('rbd', 'img1', 'snapf', 'rbd_iscsi', 'img1_snapf_clone')
qa/tasks/mgr/dashboard/test_rbd.py
Outdated
self.assertStatus(200) | ||
self.assertIsNone(img['parent']) | ||
|
||
self._rbd_cmd(['snap', 'unprotect', 'rbd/img1@snapf']) |
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.
self.update_snapshot('rbd', 'img1', 'snapf', None, False)
qa/tasks/mgr/dashboard/test_rbd.py
Outdated
|
||
def test_default_features(self): | ||
default_features = self._task_post('/api/block/image/default_features') | ||
self.assertEquals(default_features, ['deep-flatten', 'exclusive-lock', |
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.
assertEquals
is deprecated, use assertEqual
instead
|
||
return _rbd_image_call(pool_name, image_name, _flatten) | ||
|
||
@RESTController.collection() |
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.
please specify the HTTP method allowed (I guess it should be GET): @RESTController.collection(['GET'])
qa/tasks/mgr/dashboard/test_rbd.py
Outdated
self.assertStatus(204) | ||
|
||
def test_default_features(self): | ||
default_features = self._task_post('/api/block/image/default_features') |
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.
Why using a POST request to retrieve info? this should be a GET http request.
5cd040c
to
650db96
Compare
QA tests were successful: http://pulpito.ceph.com/rdias-2018-04-24_15:10:55-rados:mgr-wip-rdias-testing-distro-basic-smithi/ |
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Signed-off-by: Ricardo Dias <rdias@suse.com>
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Signed-off-by: Ricardo Marques <rimarques@suse.com>
650db96
to
9f6e889
Compare
Would like to see the feature that the snapshot name is auto-generated using the current date, e.g. |
Would be great if the |
If i press the |
@votdev could you paste the stack trace of that 500 error? |
Run QA tests again with the latest change, and every test passed: http://pulpito.ceph.com/rdias-2018-04-25_11:46:51-rados:mgr-wip-rdias-testing-distro-basic-smithi/ |
I would like to avoid any kind of name auto-generation until we have feedback from someone that uses this features in a production environment. Otherwise we run the risk of suggesting names that do not make sense in real-world usage. |
I agree that this behavior would be an improvement, but our datatable doesn't support that. Maybe we should enhance our datatable to reflect the |
Thanks for reporting this, but this table is not part of this PR. I would say that this is an issue on What about reporting an issue on http://tracker.ceph.com/ ? |
@ricardoasmarques I've created a bug report for the cdDatePipe. |
This PR will add the frontend implementation for RBD copy, RBD flatten and snapshot clone functionalities.
Signed-off-by: Ricardo Marques rimarques@suse.com