Allow customizable HTTP block size when reading from remote OVA#692
Open
waldner wants to merge 1 commit into
Open
Allow customizable HTTP block size when reading from remote OVA#692waldner wants to merge 1 commit into
waldner wants to merge 1 commit into
Conversation
|
|
||
| p = urlparse(url) | ||
|
|
||
| conn = http.client.HTTPSConnection(p.netloc, context=ssl_context, |
Contributor
There was a problem hiding this comment.
I'm not an expert here, but if the url provided is not https, would this still work? (not sure how many people still use plain http, but might be used on internal sites)
Author
There was a problem hiding this comment.
All the clusters I've worked with were always using https, (even if with self-signed certs most of the time), but I think it's a fair point. Let me see if I can come up with a fix that takes it into consideration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using a remote OVA source,
urlopen's default is to read 8192 bytes at a time, which is very slow (a simple ~1GB OVA might take tens of hours). This proposal useshttp.clientdirectly to allow setting the block size (10 MB by default, but depending on the actual environment it can be even higher). In my tests, a 10 MB block size resulted in a 80x reduction of download times from a local LAN web server, and a 100 MB block size produced a 500x reduction. Differences might not be so dramatic depending on the actual conditions, but I think we're still much better off with the new default, and anyway it's tweakable if desired.As noted in "upload_ova.py" fails if there is an iso file inside the ova #392, for non-disk objects (like ISO, or NVRAM files)
PUTshould be used instead ofPOST. This proposal also applies the change suggested in that issue.