Proxmox API file-read/file-write limitations

Feb 22, 2022
7
0
1
I am attempting to do some VM automation utilizing the Proxmox API to support doing integration testing on various target VMs including Windows XP->11 and Debian/Ubuntu/CentOS/etc. The basic concept is to have template VMs for all the target environments and then have the CI pipeline deploy VMs to support the integration tests automatically during a pipeline execution. To facilitate this, I'm using the proxmoxer Python wrapper to the Proxmox API. I am able to successfully clone/start/stop/destroy VMs from the templates as well as execute commands within the target VM. All of the templates have the qemu-guest-agent installed, which I'm leveraging to execute commands.

The challenge comes when I need to push files into or pull files from the guests. Looking at the QEMU guest agent documentation, the file size limit appears to be 48MiB After base64 encoding. My testing through pvesh/proxmoxer is resulting in more like 40KiB (I am using the REST API). The issue is two fold:

  • 1. The file size limitation is so restrictive that I can't directly accomplish what I need. I would like to avoid introducing any additional tools to all the guest VMs (e.g. Python, 7-zip) if I can avoid it.
  • 2. The files when written To the guest via file-write need to be base64 URL encoded in order to be POSTed to the API (particularly since many of these files are binary). The issue is that nothing in the Proxmox nor QEMU guest agent stack automatically decodes the file once in the guest.

So my questions are:
  • 1. Is the ~40KiB limit that I'm running into with the REST Proxmox API the true limit (I'm on 7.1-10)?
  • 2. Is there a known good way to address splitting/recombining files within the guests to work around this list?
  • 3. Is there a known good way to address the decoding of the file contents within the guests?

Given the spectrum of target OS versions under test, the most straightforward solution I can think of is to introduce Python to all the base templates along with a utility script which can encode/decode and split/combine files to augment the file-read/file-write operations. This isn't a show stopper, but I feel like this is surely an issue someone has run into and solved before.
 
Last edited:
  • 1. Is the ~40KiB limit that I'm running into with the REST Proxmox API the true limit (I'm on 7.1-10)?
yes there is a post size limit in the http server and the api limit is a bit below that

  • 2. Is there a known good way to address splitting/recombining files within the guests to work around this list?
for linux you can simply use cat?
Code:
cat part1 part2 part3 > real

  • 3. Is there a known good way to address the decoding of the file contents within the guests?
there was a recent commit([0]) that introduced the 'encode' parameter
when set to 0, we assume the parameter is already encoded, the guest agent decodes it afterwards

not that the package was not bumped yet, so it's not available in any repo for now

0: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=0cb151937f5b683196c5e39b18ad09649fc85c8d