Skip to content
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

Implement SSA of network-mounted HyperV virtual disks #6945

Merged
merged 3 commits into from Mar 15, 2016

Conversation

jerryk55
Copy link
Member

Add changes to implement running SSA on HyperV virtual disks which are
network mounted on the server.

  1. in the MiqScvmmVm.init_disk_info determine whether a disk is network mounted.
  2. in the Vhdx and Vhd disk modules pass the network attribute when instantiating
    a MiqHyperVDisk, and pass the attribute along when getting a parent disk (in the
    case of checkpoints/snapshots).
  3. Add the winrm-elevated accessor to MiqWinRM, and make sure MiqHyperVDisk uses the correct
    accessor to run remote commands depending upon whether the virtual disk is remote-mounted
    or not.
  4. Allow scanning of Microsoft VMs without storage in the DB (See Issue Hyper-V Inventory Doesn't Add Storage for VMs with VHDs on Network Drive #5383)

Prerequisites:

  1. Support for WinRM 1.5+ WinRb/winrm-elevated#2
  2. Upgrade RubyZip Gem to 1.2 #6938

@Fryguy @jrafanie @chessbyte @roliveri Please review, comment, and merge when appropriate.
I will reach out to the winrm-elevated gem owner to see what we can expect from him.

Thanks.

@jerryk55
Copy link
Member Author

(most) Rubocop issues addressed and re-pushed.

@jerryk55
Copy link
Member Author

Added the Gemfile changes for Rubyzip from #6938 otherwise dependencies cannot be met.

@miq-bot
Copy link
Member

miq-bot commented Mar 1, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 1, 2016

@Fryguy @roliveri @djberg96 I have two PRs in to the winrm-elevated gem (I split the original one). One in particular changes the gemspec file to allow us to use a winrm gem of 1.5 or greater - it is set to ~>1.3 right now which will not allow us to use the "executor" methods of winrm 1.5 to speed up our SSA on HyperV.
When I spoke to @Fryguy about this he suggested going this route, adding the PR to the winrm-elevated repo, etc. When I submitted my original PR the owner said he didn't want to tie down the gem to any particular versions - however that is exactly what he is doing now. Unfortunately he has not been responding to my further attempts to clarify his stance.
How long should we wait before adding our own winrm-elevated repo? This PR, which allows us to run SSA on network-mounted disks, waits in the balance.

@jerryk55 jerryk55 force-pushed the winrm-elevated branch 3 times, most recently from f374397 to 591cf41 Compare March 2, 2016 18:12
@jerryk55
Copy link
Member Author

jerryk55 commented Mar 2, 2016

@Fryguy @roliveri winrm-elevated gem changes have been merged into the gem as version 0.2.0. I have changed our Gemfile to point to the new version in this PR and pushed them but we cannot merge this PR until the gem is deployed. Based on the speed with which the owners typically do so, it should be available within the next day or so. Til then the tests for this PR will fail since the gem won't be available.

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 3, 2016

winrm-elevated 0.2.0 has been distributed with the changes required by this PR.
@Fryguy @roliveri @jrafanie @chessbyte
Assuming tests pass this can be reviewed and merged when ready.

@@ -281,7 +281,7 @@ def get_eligible_proxies_for_job(job)
end

if @vm.storage.nil?
unless ['Amazon', 'OpenStack'].include?(@vm.vendor)
unless %w(Amazon OpenStack Microsoft).include?(@vm.vendor)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roliveri would be good (in a future PR) to ask the @vm object a question instead of having the knowledge here of which vendors are supported.

@chessbyte
Copy link
Member

@jerryk55 any possibility of adding specs? /cc @roliveri

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 3, 2016

@chessbyte I'm looking into what that would take...

@total_copy_from_remote_time += t2 - t1
@total_read_execution_time += Time.now.getlocal - t1
buffer
until retries == BREAD_RETRIES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make this;

(0...BREAD_RETRIES).each do

Then, you wouldn't need to increment and compare the retries variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 7, 2016

@djberg96 or someone else on the @blomquisg team - if I can get your ok on the changes I've made in the ManageIQ::Providers::Microsoft::InfraManager space for this PR that would be helpful. Still looking into specs for this as well as comparison testing for performance.

@miq-bot
Copy link
Member

miq-bot commented Mar 8, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 9, 2016

@djberg96 would still like sign-off on the minor (as I see it) changes made to the provider as mentioned previously.
@chessbyte @roliveri @Fryguy specs added for the interfaces modified by this PR. Have not gone as far as adding CamCorder recordings of filesystems/disks yet.
Review and merge when possible. Thanks.

@jerryk55
Copy link
Member Author

jerryk55 commented Mar 9, 2016

Rubocop spec complaints addressed as well.

@jerryk55 jerryk55 force-pushed the winrm-elevated branch 2 times, most recently from 4f8808e to 439a90e Compare March 9, 2016 21:53
Add changes to implement running SSA on HyperV virtual disks which are
network mounted on the server.

1) in the MiqScvmmVm.init_disk_info determine whether a disk is network mounted.
2) in the Vhdx and Vhd disk modules pass the network attribute when instantiating
   a MiqHyperVDisk, and pass the attribute along when getting a parent disk (in the
   case of checkpoints/snapshots).
3) Add the winrm-elevated accessor to MiqWinRM, and make sure MiqHyperVDisk uses the correct
accessor to run remote commands depending upon whether the virtual disk is remote-mounted
or not.
4) Allow scanning of Microsoft VMs without storage in the DB (See Issue ManageIQ#5383)
Add changes to implement running SSA on HyperV virtual disks which are
network mounted on the server.

1) in the MiqScvmmVm.init_disk_info determine whether a disk is network mounted.
2) in the Vhdx and Vhd disk modules pass the network attribute when instantiating
   a MiqHyperVDisk, and pass the attribute along when getting a parent disk (in the
   case of checkpoints/snapshots).
3) Add the winrm-elevated accessor to MiqWinRM, and make sure MiqHyperVDisk uses the correct
accessor to run remote commands depending upon whether the virtual disk is remote-mounted
or not.
4) Allow scanning of Microsoft VMs without storage in the DB (See Issue ManageIQ#5383)
Add rspec tests for various interfaces modified by this feature
request, including:
1) Allow a network boolean argument to be passed to the MiqHyperVDisk object
2) Allow creation of the WinRM elevated runner
3) Validate interfaces added to the ManageIQ/Providers/Microsoft/InfraManager/Vm and Template
   objects.

Also move winrm & winrm-elevated gems from the top-level Gemfile to that under gems/pending
to allow gems/pending spec tests to succeed when run by Travis.
@miq-bot
Copy link
Member

miq-bot commented Mar 10, 2016

<github_pr_commenter_batch />Some comments on commits jerryk55/manageiq@69eaa9e~...a728b9b

@miq-bot
Copy link
Member

miq-bot commented Mar 10, 2016

Checked commits jerryk55/manageiq@69eaa9e~...a728b9b with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1
23 files checked, 4 offenses detected

app/models/manageiq/providers/microsoft/infra_manager/template.rb

app/models/manageiq/providers/microsoft/infra_manager/vm.rb

@djberg96
Copy link
Contributor

Looks good to me.

I checked out this branch, added an Azure cloud provider instance, and an SCVMM infrastructure provider instance, and ran a refresh on each. Worked fine for both.

@roliveri
Copy link
Member

@jerryk55 - just double checking before merge. All the updated GEM dependencies are available?

@jerryk55
Copy link
Member Author

@roliveri yes. However please hold off on the merge for one more check. I was testing on a Raleigh-based appliance that was cobbled together manually and ran into the 1500 operations limit on winrm - which should be fixed by the correct version of the gem. I need to re-confirm that fix.

@jerryk55
Copy link
Member Author

This can be merged. The winrm 1500 ops limit is unaffected by this PR which uses winrm-elevated for running powershell commands (which does not keep the command process running as of this writing).
Thank you @roliveri @djberg96 for your comments.

chessbyte added a commit that referenced this pull request Mar 15, 2016
Implement SSA of network-mounted HyperV virtual disks
@chessbyte chessbyte merged commit a31aeeb into ManageIQ:master Mar 15, 2016
@chessbyte chessbyte added this to the Sprint 38 Ending Mar 28, 2016 milestone Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants