KVM Network Configuration

Jul 7, 2017
1
0
21
54
We have proxmox up and running without issues. We also setup HostBill (a hosting billing/automation system) to integrate with proxmox. We can purchase containers via HostBill, it uses the proxmox api and sets up the container and configures networking properly.

The issue we are having has to do with Windows/Linux KVM VMs. When purchasing one of these, HostBill communicates with the proxmox api, clones a template, configures HA, moves the VM to the least loaded node and starts it up. The problem is that networking is not configured in the VM. To resolve this, someone needs to manually VNC/Spice into the VM and configure networking which defeats the purpose of getting things fully automated.

We have been looking into ways to resolve this and found that the qemu-agent does support a way to either read/write files and/or execute commands. If you look at the following article, at the bottom is "guest-exec" which is supposed to allow execution of commands within the guest VM:

qemu.weilnetz.de/doc/qemu-ga-ref.html

However, I believe this may be a patched qemu-agent and I have not found a way from within proxmox to do this. I have found that from proxmox command line you can run:

qm agent <dmid> <command>

However, it shows the only valid commands are:

ping, get-time, info, fsfreeze-status, fsfreeze-freeze, fsfreeze-thaw, fstrim, network-get-interfaces, get-vcpus, get-fsinfo, get-memory-blocks, get-memory-block-info, suspend-hybrid, suspend-ram, suspend-disk, shutdown

My assumption is that qm agent does not have all the same commands that are available via the qemu-agent installed in the windows guest node.

Does anyone know how to execute a command within a KVM Windows guest using the qemu-agent?