HI I m provisioning Mikrotik Routers and as there is No cloud-init M trying to use the guest exec
when I use guest exec by hand via socat I can get it to work below
But I m having a hell time with qm guest exec 689 or via the API or
pvesh create /nodes/{node}/qemu/{vmid}/agent/exec
basically I need to send no PATH just attributes called input-data
like
input-data ':ip address add address=192.168.201.100/24 interface=wan
OR maybe my question is HOW to pass a string that gets converted to an array as I see the work is done by
so how to pass that array
/usr/share/perl5/PVE/QemuServer/Agent.pm
sub qemu_exec {
my ($vmid, $cmd) = @_;
my $path = shift @$cmd;
my $arguments = $cmd;
Basically I have to send something like this as the final output e.g there is no PATH
in socat this works
{"execute": "guest-exec", "arguments": {"input-data": "OmlwIGFkZHJlc3MgYWRkIGFkZHJlc3M9MTkyLjE2OC4wLjEvMjQgaW50ZXJmYWNlPWV0aGVyMTs=" ,"capture-output": true } }
Thanks
when I use guest exec by hand via socat I can get it to work below
But I m having a hell time with qm guest exec 689 or via the API or
pvesh create /nodes/{node}/qemu/{vmid}/agent/exec
basically I need to send no PATH just attributes called input-data
like
input-data ':ip address add address=192.168.201.100/24 interface=wan
OR maybe my question is HOW to pass a string that gets converted to an array as I see the work is done by
so how to pass that array
/usr/share/perl5/PVE/QemuServer/Agent.pm
sub qemu_exec {
my ($vmid, $cmd) = @_;
my $path = shift @$cmd;
my $arguments = $cmd;
Basically I have to send something like this as the final output e.g there is no PATH
in socat this works
{"execute": "guest-exec", "arguments": {"input-data": "OmlwIGFkZHJlc3MgYWRkIGFkZHJlc3M9MTkyLjE2OC4wLjEvMjQgaW50ZXJmYWNlPWV0aGVyMTs=" ,"capture-output": true } }
Thanks