-
Notifications
You must be signed in to change notification settings - Fork 357
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 base snapshot for EBS cloud volume provisioning #1324
Support base snapshot for EBS cloud volume provisioning #1324
Conversation
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.
@sasoc thanks!
Please, review the comments. Also attach a screenshot showing creation of Amazon cloud volume (attach it into the PR body).
@@ -113,7 +113,7 @@ ManageIQ.angular.app.controller('cloudVolumeFormController', ['miqService', 'API | |||
|
|||
vm.storageManagerChanged = function(id) { | |||
miqService.sparkleOn(); | |||
API.get('/api/providers/' + id + '?attributes=type,parent_manager.availability_zones,parent_manager.cloud_tenants') | |||
API.get('/api/providers/' + id + '?attributes=type,parent_manager.availability_zones,parent_manager.cloud_volume_snapshots,parent_manager.cloud_tenants') |
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.
Add the change to the end of the API call.
@@ -213,6 +213,7 @@ ManageIQ.angular.app.controller('cloudVolumeFormController', ['miqService', 'API | |||
// model attribute with AWS. | |||
vm.cloudVolumeModel.aws_volume_type = data.volume_type; | |||
vm.cloudVolumeModel.aws_availability_zone_id = data.availability_zone.ems_ref; | |||
//vm.cloudVolumeModel.aws_cloud_volume_snapshot_id = data.cloud_volume_snapshot_id; |
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.
The snapshot id should be set here so that, when editing the volume, the snapshot will be displayed. The ID should be returned by the current API call.
"data-live-search" => "true", | ||
"pf-select" => true} | ||
%option{"value" => "", "enabled" => ""} | ||
= "#{_('No snapshot')}" |
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.
You can change this to = _('No snapshot')
since you are not rendering any other chars, like <
and >
in other cases.
"ng-options" => "vs.ems_ref as vs.name for vs in vm.cloudVolumeSnapshotChoices", | ||
"ng-disabled" => "!vm.newRecord", | ||
:checkchange => true, | ||
"data-live-search" => "true", |
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.
Align all =>
to the widest key name.
@@ -49,6 +49,20 @@ | |||
%span.help-block{"ng-show" => "angularForm.aws_availability_zone_id.$error.required"} | |||
= _("Required") | |||
|
|||
.form-group{"ng-if" => "vm.cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} |
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.
Move this just in front of "Encryption" at the bottom.
@miq-bot add_label storage,enhancement |
03e3552
to
88f1dd3
Compare
@@ -693,6 +693,7 @@ def form_params_create | |||
# Only set IOPS if io1 (provisioned IOPS) and IOPS available | |||
options[:iops] = params[:aws_iops] if options[:volume_type] == 'io1' && params[:aws_iops] | |||
options[:availability_zone] = params[:aws_availability_zone_id] if params[:aws_availability_zone_id] | |||
options[:snapshot_id] = params[:aws_cloud_volume_snapshot_id] if params[:aws_cloud_volume_snapshot_id] |
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.
Now that we are using base_snapshot
properly from the API, I suggest you rename this to aws_base_snapshot
88f1dd3
to
18face2
Compare
18face2
to
2b1d1e0
Compare
@@ -110,6 +110,20 @@ | |||
%span.help-block{"ng-show" => "vm.cloudVolumeModel.aws_volume_type == 'io1' && angularForm.aws_iops.$error.required"} | |||
= _("Required") | |||
|
|||
.form-group{"ng-if" => "vm.cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} |
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.
Remove unnecessary spaces between "ng-if"
and =>
.
"ng-options" => "vs.ems_ref as vs.name for vs in vm.baseSnapshotChoices", | ||
"ng-disabled" => "!vm.newRecord", | ||
:checkchange => true, | ||
"data-live-search" => "true", |
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.
Does it work with true
(instead of "true"
)?
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.
It doesn't work with true instead of "true".
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.
Thanks
2b1d1e0
to
fe5aa2b
Compare
@@ -112,6 +112,20 @@ | |||
|
|||
.form-group{"ng-if" => "vm.cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | |||
%label.col-md-2.control-label | |||
= _('Cloud Snapshot') |
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.
Sorry, but I've missed this one before: please replace this with Base Snapshot
.
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.
No problem
fe5aa2b
to
48f5015
Compare
@sasoc - |
@miq-bot assign @AparnaKarve |
@bronaghs the UI shows these two properties because it allows users to specify them when creating new volumes. The referenced PR from the core will allow us to show these properties while editing cloud volume. Both IOPS and Encrypted fields are already merged in the UI repo. @sasoc just added the base snapshot field. |
No, unfortunatelly not until we update the models :(. I wanted to make this change already, but since the PR on the master has not been accepted, I waited as I wasn't sure if I am doing it correctly. |
@gberginc Regarding the CC error when "ManageIQ::Providers::StorageManager::CinderManager"
options = cinder_manager_options
when "ManageIQ::Providers::Amazon::StorageManager::Ebs"
options = aws_ebs_options |
@AparnaKarve this would make sense. We'll check what would be the best way because some options are common. Prehaps we extend the options with provider specific ones not to duplicate the common logic. |
f09b950
to
7d576c0
Compare
@AparnaKarve I've broken |
Add option to create new cloud volume from snapshot for AWS EBS Storage Maneger.
7d576c0
to
07e3b5e
Compare
Checked commit sasoc@07e3b5e with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@sasoc That looks good, and it has also addressed the cyclomatic complexity CC error. Thanks. @gberginc About the error in #1324 (comment), do you think we can address it once the model changes are in? |
@AparnaKarve that error message will require model changes. We still have just two PRs for the changes in the cloud volume. @sasoc fixed the tests, but unfortunately, they still haven't been merged. Would you propose that we simply add the PRs for the snapshots as well? |
@gberginc Can you post the PR links here, the one with the model changes? |
PR in core: ManageIQ/manageiq#14704 Both are just for the cloud volumes, but the idea for snapshots will be the same: update the model and extend the inventory. |
@gberginc I think we should get this in since the Cloud Volume creation from a snapshot does work. Let's revisit #1324 (comment) once the necessary model PRs are merged in. |
@dclarizio I think we can go ahead and merge this. If we address the issue described in #1324 (comment), it will improve the user experience, and is not a bug as such. |
Add option to create new cloud volume from snapshot for AWS EBS Storage Maneger.