-
Notifications
You must be signed in to change notification settings - Fork 107
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
Introduce Amazon Block Storage Manager (EBS) #101
Conversation
@aiperon please review |
e206395
to
45b0bc7
Compare
45b0bc7
to
13d5e74
Compare
@agrare @Ladas could ManageIQ/manageiq@d557f19 be affecting travis tests?
Is there any doc on how to approach the refresh parsers now? |
This pull request is not mergeable. Please rebase and repush. |
This commit sets up the core structure of the new AWS EC2 block storage manager. It provides just the basic stubs and tests that are to be extended to allow for complete management of Amazon block storage The refresher collects data about existing volumes and private snapshots. Volumes are not yet linked to disks of virtual machines collected by the cloud manager. Signed-off-by: Gregor Berginc <gregor.berginc@xlab.si>
@gberginc the CI should be fixed, but I've caused a conflict in the specs, you'll need to rebase |
@Ladas thanks. The conflict is simple to resolve as just the number of Another thing I wanted to ask: I currently only use stubbed specs, but there are also those that are using actual AWS account - how should I approach this as using our account will change the VCR as well as all the existing spec data. |
@gberginc cool So the VCR kinda sucks there, because we have a VCR env, that we use for that. So option would be that I would record it for you, once you are ready, or we would share some readonly creds for the VCR env. So for now, I think easiest will be that I will record and send the VCRs, once you have all the API calls in place. We were thinking about getting away from the VCRs and just use stubbed specs, but then it's nice to have a spec that is using real env. data. |
13d5e74
to
3684e11
Compare
@Ladas I've just added additional commit for the inventory object support. I am not sure if you are the one to review this PR (if not, please let me know so that I can ask someone else). Regarding VCR recording: do I understand correctly, I should now add Then you run the spec and share the VCR with me so that I can update the actual tests? |
@gberginc I'll do the review Regarding the VCR, yes, lets do the VCR specs as a next PR |
Hey @Ladas, did you review it? |
I think this is partly dependent on the current changes to the refresh parsers, #105. I would nevertheless appreciate feedback to continue working on storage managers. |
end | ||
|
||
private | ||
def get_volumes |
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.
We're using the same parsing code for RefreshParser and RefreshParserInventoryObject.
Wouldn't it be better if we move it into ManageIQ::Providers::Amazon::RefreshHelperMethods ?
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.
there is a slight difference in the parsing code. But yeah, we can abstract the parsing part. But that can be done in another PR.
But my goal is to deprecate/delete the old parsing code and use the new one, so maybe it won't be needed. :-)
end | ||
end | ||
|
||
|
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.
extra blank lines
inventory_collections | ||
end | ||
|
||
private |
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.
blank line before and after private
block_storage_manager.name = "#{name} Block Storage Manager" | ||
block_storage_manager.zone_id = zone_id | ||
block_storage_manager.provider_region = provider_region | ||
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.
why we return true?
@@ -54,6 +72,14 @@ def ensure_managers | |||
network_manager.provider_region = provider_region | |||
end | |||
|
|||
def ensure_block_storage_managers | |||
build_block_storage_manager unless block_storage_manager |
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 think we can just put this body to ensure_managers. Or calling this from the body of ensure_managers, then we should extract the current into :ensure_network_manager, then add :ensure_block_storage_manager
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.
@Ladas I've merged the two into ensure_managers
as there is currently no need to have them separated. I also fixed the other rubocop issues.
@gberginc just few nits, mostly rubocop that should be fixed. After that I am ready to merge, so we can move forward. :-) |
3684e11
to
6e048be
Compare
Similarly to ManageIQ#102 this patch adds support for inventory collection using inventory abstraction. Corresponding targets as well as the refresh parser inventory object. It mimics existing cloud and network managers. Signed-off-by: Gregor Berginc <gregor.berginc@xlab.si>
6e048be
to
66465a6
Compare
Checked commits gberginc/manageiq-providers-amazon@db2a32f~...66465a6 with ruby 2.2.6, rubocop 0.46.0, and haml-lint 0.19.0 app/models/manageiq/providers/amazon/block_storage_manager/refresh_parser.rb
app/models/manageiq/providers/amazon/block_storage_manager/refresh_parser_inventory_object.rb
app/models/manageiq/providers/amazon/block_storage_manager/refresher.rb
app/models/manageiq/providers/amazon/inventory/targets/block_storage_manager.rb
spec/models/manageiq/providers/amazon/aws_stubs.rb
spec/models/manageiq/providers/amazon/block_storage_manager/stubbed_refresher_spec.rb
|
@Ladas I amended the commit, so the following comment is not visible. Just reposting to make sure it doesn't get lost. I've merged the two into ensure_managers as there is currently no need to have them separated. I also fixed the other rubocop issues - I think the remaining issues can be left as they are following existing code. |
@gberginc awesome :-) Thank you for a great contribution. Yeah, the rest of the robocop warnings are on the edge of a correctness. :-) |
👍 |
@gberginc @Ladas @Fryguy Actually, this shouldn't have been merged yet. We've been naming managers based on concrete names instead of type. This enables providers to support different/multiple implementations of the same type of manager. So, I would suggest a name change. From: ManageIQ::Providers::Amazon::BlockStorageManager < ManageIQ::Providers::StorageManager To: ManageIQ::Providers::Amazon:: StorageManager::EBS < ManageIQ::Providers::StorageManager |
@roliveri do you think we could proceed with the pending PRs on the manageiq repo and then introduce this change now that it's merged? |
@gberginc Is there a benefit in doing that? It seems that 2 of the pending PRs rely on the same naming scheme: ManageIQ/manageiq#13458 So I would make the same comment on those. If I merge those, you'll only have to submit new PRs updating those as well. |
@roliveri the only consideration was that |
@gberginc Ah, i see. It looks like ManageIQ/manageiq#13458 has been merged, and doing so has fixed the test failures. So, ManageIQ/manageiq#13457 remains. I can hold off merging that until the names are fixed, or I can merge it, but then I'd like for you to open a Github issue for the name change - just to make sure it doesn't get overlooked. let me know which way you'd like to go. |
@roliveri I already started on renaming the class. I therefore suggest you wait with the worker as it is not required for functional test. |
This commit sets up the core structure of the new AWS EC2 block storage
manager. It provides just the basic stubs and tests that are to be
extended to allow for complete management of Amazon block storage
The refresher collects data about existing volumes and private
snapshots. Volumes are not yet linked to disks of virtual machines
collected by the cloud manager.
Depends on Add storage manager mixins PR from core repo.
@miq-bot add_label enhancement