Skip to content

Conversation

@waldner
Copy link

@waldner waldner commented Jan 6, 2022

  1. 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 uses http.client directly 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.

  2. 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) PUT should be used instead of POST. This proposal also applies the change suggested in that issue.


p = urlparse(url)

conn = http.client.HTTPSConnection(p.netloc, context=ssl_context,
Copy link
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Author

Choose a reason for hiding this comment

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

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.

Copy link
Author

@waldner waldner Jan 13, 2023

Choose a reason for hiding this comment

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

This should now be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants