-
Notifications
You must be signed in to change notification settings - Fork 36
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
Handle Managed Disk Snapshots #23
Handle Managed Disk Snapshots #23
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.
So the implementation of non-managed disk snapshot support will be delivered in a subsequent PR?
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.
Is there anything you can do about the codeclimate issues?
@roliveri Yes the non-managed disk snapshot support will be delivered in a subsequent PR after this batch is merged. And I will look at the codeclimate issues. |
lib/disk/modules/AzureCommon.rb
Outdated
require_relative '../MiqDisk' | ||
require 'ostruct' | ||
|
||
module AzureCommon |
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.
@jerryk55 I think this name isn't specific enough. Would AzureDiskCommon
be better?
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.
@@roliveri good idea. BTW I still have some code climate issues to fix up, and for some reason the math in the spec tests is off. I will work with that in the morning.
If the Azure VM has a Managed Disk then use the new Managed Disk disk module to read its snapshot.
CodeClimate called out the fact that there was a lot of duplication between the AzureBlobDisk and AzureManagedDisk modules. I have added the AzureCommon module to be used by each of the prior modules to eliminate duplicated code.
Review suggested renaming AzureCommon to AzureDiskCommon. CodeClimate complained about duplicated code so AzureDiskCommon code was massaged and MiqAzureVm had more changes added.
7e96658
to
08ac751
Compare
Final (hopefully) set of Rubocop complaints after the last set of changes.
@roliveri the failure above is intermittent both in Travis and in my appliance when run from the command line. For instance I rebased earlier today and after that Travis passed, then after fixing a Rubcop complaint it failed again. Trying to discern the issue but it is perplexing. Originally CodeClimate complained about 9 issues - its down to 2 now with the issue being slightly duplicated code in the new methods of the two disk modules. I am currently at a loss for the spec test failures. Any suggestions? I will also need to add AzureManagedDisk tests before this should be merged. |
@jerryk55 It's strange. The numbers being read from the recorded cassettes don't match the expected values. So, unless the cassettes were re-recorded, how could the numbers change? You have to check the code that reads the info from armrest and see if it manipulates the values before returning, (lba, etc). |
AzureDiskCommon Module needed to be "included" in AzureBlobDisk and AzureManagedDisk in order to allow methods to be instance-specific rather than class specific. This was causing memo-ized values to be set incorrectly and failures in tests.
Ok @roliveri problem with the tests resolved. Still need Managed Disk tests. |
Add new Managed Disk Spec Tests and all VCR recordings for the tests.
One test checking the Managed Disk Size was commented out. Uncommented the test and re-ran the full spec file to re-record the VCR recordings
@roliveri I believe this can be merged now. New tests added and passing. |
Attempting to restart CodeClimate checks. |
CodeClimate is complaining about new "new" methods in two Disk Modules with Mass Thresholds of 24 so we are bumping the config for the Duplication engine just above that level.
Checked commits jerryk55/manageiq-smartstate@5c0c5ad~...6e1c9aa with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 lib/MiqVm/miq_azure_vm.rb
lib/disk/modules/AzureBlobDisk.rb
lib/disk/modules/AzureDiskCommon.rb
lib/disk/modules/AzureManagedDisk.rb
|
@miq-bot add_label fine/yes |
@jerryk55 Cannot apply the following label because they are not recognized: fine/yes |
ManageIQ/manageiq-smartstate#23 and ManageIQ/manageiq-smartstate#25 were added as part of the work required for blocker bug https://bugzilla.redhat.com/show_bug.cgi?id=1475540. This commit and subsequent PR track the backport of the changes into the Fine release.
Backported to Fine via ManageIQ/manageiq-gems-pending#267 |
If the Azure VM has a Managed Disk then use the new Managed Disk
disk module to read its snapshot.
On this go-round the snapshot will only be required for Managed Disks.
This is one of several PRs required to add support for SSA for Managed Disks,
that is is response to the following BZs:
https://bugzilla.redhat.com/show_bug.cgi?id=1475540
and
https://bugzilla.redhat.com/show_bug.cgi?id=1459612
A PR for the azure-armrest gem has already been merged in advance of this:
ManageIQ/azure-armrest#299
A PR for the ManageIQ repo has been added as well to work with this -
ManageIQ/manageiq#15865
A PR for the manageiq-providers-azure repo has also been added.
ManageIQ/manageiq-providers-azure#117
Links
Steps for Testing/QA
Add an Azure VM with a Managed Disk.
Run SmartState Analysis against the VM.
@roliveri @hsong-rh please review.