-
Notifications
You must be signed in to change notification settings - Fork 899
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
Smart State Analysis for Hyper-V Disks #2428
Conversation
@@ -0,0 +1,46 @@ | |||
|
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.
Can you remove all these bonus blank lines at the start of every file?
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.
Absatootly. :-)
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.
which of the requires below is coming from util? if none, then we do not need this push.
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.
miq_winrm
3363723
to
fdaa683
Compare
fdaa683
to
443795a
Compare
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
443795a
to
9c2d4f7
Compare
9c2d4f7
to
642d1ac
Compare
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@@ -0,0 +1,69 @@ | |||
$LOAD_PATH.push("#{File.dirname(__FILE__)}/../util") |
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.
which of the requires below is coming from util? if none, then we do not need this push.
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.
miq_winrm
df6b6db
to
967962d
Compare
@vhdx_file | ||
end | ||
|
||
def d_read(pos, len) |
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 would be nice to have targeted tests for complicated methods like this.
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 wonder if we could run VCR like tests of this method by running a full end to end test of some scvmm disks, recording the inputs and outputs as test cases. It might help better understand the conditionals in this method.
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 would suppose that is a possibility. I'm not sure if we have anything like that for any of the disk formats we already support, by the way. Not that two wrongs make a right.
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 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.
And in the meantime I would think that the lack of the general test would not be a blocker to merging.
@Fryguy yes I'll look into that in VhdxDisk.rb, VhdxDiskProbe.rb, MSVSDiskProbe.rb, miq_hyperv_disk.rb, miq_scvmm_vm_ssa_info.rb, as well as host.rb and infra_manager.rb in the microsoft provider. I do see it still out there in a few spots besides this - are these places that were left over, or places it was added back by other PRs? For instance under app/models host.rb, filesystem.rb, miq_server/server_smart_proxy.rb. |
@jerryk55 In general, this PR has several challenges.
Lets discuss further in 2016. Thanks, |
@chessbyte okie dokie. Yes I've always thought that VhdxDisk could be its own PR, and the HyperVDisk methods could also stand on their own. Thanks. |
e9d93f6
to
ef39884
Compare
@roliveri @chessbyte @Fryguy @jrafanie This PR has been amended to pull the VhdxDisk module out as discussed. I will try to reword the log message of one or two of the commit messages but otherwise it is ready for any further review and merging when ready. |
@@ -1,4 +1,4 @@ | |||
$LOAD_PATH << File.join(GEMS_PENDING_ROOT, "Scvmm") | |||
# encoding: US-ASCII |
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 is this line being added?
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.
Because I was under the mistaken impression that was standard practice in our code, but now I see that not to be the case.
ef39884
to
62a0df0
Compare
@chessbyte Removed the above extraneous encoding comments and re-pushed. |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
Get Hard disk information for VMs managed by SCVMM from the SCVMM via powershell functions. Read the hard disk from the Hyper-V host. Gets the vhd, host, vhd type from the SCVMM. Opens and reads the vhd on the Hyper-V host. This is part of the functionality to perform Hyper-V/SCVMM VM fleecing This commit was amended with peer review comments.
Get Hard disk information for VMs managed by SCVMM from the SCVMM via powershell functions. Read the hard disk from the Hyper-V host. Gets the vhd, host, vhd type from the SCVMM. Opens and reads the vhd on the Hyper-V host. This is part of the functionality to perform Hyper-V/SCVMM VM fleecing.
Add a new MiqDisk Disk Module to handle the VHDX virtual disk format supported by the new version of Hyper-V and SCVMM. Supports remote and local copies of vhdx and avhdx disk files although remote disks need additional testing.
Allow VHD files to be accessed remotely via miq_hyperv_disk to enable Smart State Analysis of VMs managed by SCVMM on Hyper-V servers. Note that pre-existing checksum handling for the header and footer in this code is non-functional and has been turned off via the "skip_check" argument.
Add a new MiqDisk Disk Module to handle the VHDX virtual disk format supported by the new version of Hyper-V and SCVMM. Supports remote and local copies of vhdx and avhdx disk files although remote disks need additional testing.
Add a new MiqDisk Disk Module to handle the VHDX virtual disk format supported by the new version of Hyper-V and SCVMM. Also supports older VHD virtual disk format. Supports remote and local copies of files.
Multiple RuboCop Warning cleanup. Of note is that MiqVM.rb has been modified to clean up all spacing issues. This was previously handled but is being accomodated again due to rebasing issues with this PR eliminating the previous spacing fix.
Multiple RuboCop Warning cleanup. Of note is that MiqVM.rb has been modified to clean up all spacing issues. This was previously handled but is being accomodated again due to rebasing issues with this PR eliminating the previous spacing fix.
1) Bug in server_smart_proxy.rb caused VMware SSA to fail with "VM not found" 2) Reduce blocks read in miq_hyperv_disk.rb from 16 to 4. 3) Minor Rubocop cleanup.
1) Increase miq_hyperv_disk buffer cache from 200 to 300 entries. 2) Add a per-provider timeout adjustment to the VmScan object. It defaults to 1 but is set to 4 for Microsoft so that very slow scans may succeed.
Fix timeout adjustment so that it does not occur when rspec is running. Remove test which expected failure when running SSA on microsoft.
1. Fix test failures caused by timeout mods for Microsoft provider. 2. Mods for review comments by @roliveri to make provider->MiqVM interaction consistent with other providers - specifically change so that connect_to_ems connects and passed the handle to the connection in the ost structure.
1. Fix test failures caused by timeout mods for Microsoft provider. 2. Mods for review comments by @roliveri to i) make provider->MiqVM interaction consistent with other providers - specifically change so that connect_to_ems connects and passed the handle to the connection in the ost structure. ii) fix calculation of blocks in a disk in miq_hyperv_disk 3) Add debugging miq_hyperv_disk cache statistics code.
62a0df0
to
d17004d
Compare
<github_pr_commenter_batch />Some comments on commits jerryk55/manageiq@3fabb83~...d17004d |
Checked commits jerryk55/manageiq@3fabb83~...d17004d with ruby 2.2.3, rubocop 0.34.2, and haml-lint 0.13.0 app/models/manageiq/providers/microsoft/infra_manager/host.rb
app/models/manageiq/providers/microsoft/infra_manager/vm_or_template_shared/scanning.rb
gems/pending/MiqVm/MiqVm.rb
gems/pending/MiqVm/miq_scvmm_vm.rb
gems/pending/Scvmm/miq_hyperv_disk.rb
gems/pending/Scvmm/miq_scvmm_parse_powershell.rb
gems/pending/Scvmm/miq_scvmm_vm_ssa_info.rb
gems/pending/disk/modules/MSCommon.rb
gems/pending/util/miq_winrm.rb
|
Smart State Analysis for Hyper-V Disks
See the summary - "What Works and What Doesn't" at the bottom.
Add a new MiqDisk Disk Module to handle the VHDX virtual disk
format supported by the new version of Hyper-V and SCVMM.
Get Hard disk information for VMs managed
by SCVMM from the SCVMM and Hyper-V host via powershell
functions.
Read the hard disk from the Hyper-V host.
Gets the vhd, host, vhd type from the Hyper-V Host.
Opens and reads the vhd on the Hyper-V host.
This supports both VHDX files via the new VHDXDisk disk module
and the older VHD files via the existing disk modules. Support
for communicating to Hyper-V via miq_hyperv_disk was added
to the VHD modules.
The Microsoft Provider has been extended to allow SSA scans to be
run in addition to the MiqDisk, MiqVm, and Scvmm gems/pending code.
Enhancements still required:
Currently Snapshots are created using VMNAME__EVM_SNAPSHOT
as the snapshot name. An enhancement will add the date/time into the
snapshot name.
Caching has been implemented in the miq_hyperv_disk code which
allows the VHD and VHDX disk modules to communicate to Hyper-V
to read the files. We need to continue to look at this caching to speed this
up as much as possible.
Virtual disk files residing on network-mapped drives on the Hyper-V server, seen
as starting with \ rather than a drive letter when the inventory is taken from the server,
show up in the database with a NULL datastore ID. These files currently fail SSA
because of this NULL ID. Hyper-V Inventory Doesn't Add Storage for VMs with VHDs on Network Drive #5383
describes this issue. In addition to handling the parsing the code in MiqScvmmVm::getCfg
needs to handle this situation. it currently does not.
Certain VMs seem to timeout after looping doing I/O for an inordinate amount of time while
local copies of the same VM VHD files run extremely quickly. Further investigation is needed;
this may be related to the caching item in Use anand version #2 above.
What Works And What Doesn't -
@roliveri @Fryguy @chessbyte Please Review
By the way - an update to this old comment - this all works at this point.