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

Improve the speed of finding an individual VM #422

Merged
merged 5 commits into from
Mar 19, 2018

Commits on Mar 19, 2018

  1. Improve the speed of finding an individual VM

    This PR makes use of the
    [ContainerView](https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.view.ViewManager.html)
    to retrieve a cut down list of servers from which the desired object can
    be found, after which the object itself can be downloaded. Previously,
    we'd download each VM (about 3.5K and several round trips to the server)
    to find the VM we want.
    
    From
    ```
    sean~/play/knife-vsphere (find_speed %)$ time knife vsphere vm disk list myserver
      0          Hard disk 1      nosnapshots_ds4 64.00 GiB
    
    real    1m56.153s
    user    0m9.536s
    sys    0m1.713s
    ```
    to
    ```
    sean~/play/knife-vsphere (find_speed *%)$ time be knife vsphere vm disk list myserver
    /Users/sean/.gem/ruby/2.4.1/gems/builder-3.2.2/lib/builder/xchar.rb:111: warning: constant ::Fixnum is deprecated
      0          Hard disk 1      nosnapshots_ds4 64.00 GiB
    
    real    0m2.929s
    user    0m1.038s
    sys    0m0.236s
    ```
    
    This'll have to be retrofitted to the other commands, which we can do
    over time.
    
    See vmware-archive/rbvmomi#117 for some more context
    swalberg committed Mar 19, 2018
    Configuration menu
    Copy the full SHA
    555e096 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a20588f View commit details
    Browse the repository at this point in the history
  3. Add this to vm state, too

    swalberg committed Mar 19, 2018
    Configuration menu
    Copy the full SHA
    72c06df View commit details
    Browse the repository at this point in the history
  4. Add same thing to vm config

    swalberg committed Mar 19, 2018
    Configuration menu
    Copy the full SHA
    79f7f08 View commit details
    Browse the repository at this point in the history
  5. Add vm lookup to snapshot

    swalberg committed Mar 19, 2018
    Configuration menu
    Copy the full SHA
    4e1ad96 View commit details
    Browse the repository at this point in the history