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

provisioning-vmware: fix explanation of govc argument limit #327

Merged
merged 2 commits into from
Oct 18, 2021
Merged

provisioning-vmware: fix explanation of govc argument limit #327

merged 2 commits into from
Oct 18, 2021

Conversation

bgilbert
Copy link
Contributor

@bgilbert bgilbert commented Oct 15, 2021

The relevant limit is OS-dependent and isn't always ARG_MAX. On Linux it's MAX_ARG_STRLEN, and on Windows, cmd.exe and PowerShell impose lower limits than the kernel does.

While we're here, switch gzip to use max compression.

cc @Okeanos

@Okeanos
Copy link
Contributor

Okeanos commented Oct 15, 2021

The 128 KiB limit you put into the hint is definitely wrong for Windows 10 using Git Bash (regardless of Windows Terminal or MSys2/MinTTY) - in that case the limit appears to be just under 32KiB. That's why I initially wrote "check your env" to see the limit and assumed the ARG_MAX is correct. I'll update my comment later on today with some examples and respective error codes.

Semi-related: once govc 0.27.0 is released we can update the documentation and remove the hint along with a change to using govc vm.change vm-name -f 'key=/path/to/ignition.config.ign' instead of the current -e flag. That works platform independently and the limit is now server side based on the max-body size the ESXi will accept during HTTP requests.

@bgilbert
Copy link
Contributor Author

Right, thanks, I forgot about non-Linux. Updated!

The relevant limit is OS-dependent and isn't always ARG_MAX.  On Linux
it's MAX_ARG_STRLEN, and on Windows, cmd.exe and PowerShell impose lower
limits than the kernel does.
We might as well use max compression.
@Okeanos
Copy link
Contributor

Okeanos commented Oct 15, 2021

No worries … I had to find out the hard way as well about this which is why I am being extra careful nowadays ;-)

Just did some test on a Windows 10 VM with Windows Terminal + Git Bash and it appears to have an overall limit slightly below 32KiB for the whole command:

Screenshot 2021-10-15 at 20 28 36

The macOS Catalina test with an equally weird value for the limit but slightly larger than 256KiB:

Screenshot 2021-10-15 at 20 48 21

@bgilbert
Copy link
Contributor Author

Thanks for testing! The macOS limit you found is smaller than 256 KiB, which is 262144 bytes. I wouldn't be surprised if the size of the environment block is also factored into that limit.

@Okeanos
Copy link
Contributor

Okeanos commented Oct 15, 2021

You are absolutely right 🤦‍♂️ – I really shouldn't be doing math that late in the day. The exact difference is moot, though, because people shaving it that close might just better be served with self-compiling govc from master and use the -f flag. That's what we did to account for our Windows-buddies at my employer.

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.

None yet

3 participants