Executing agent command via pvesh failed

Dragonn

Member
May 23, 2020
21
4
8
Prague
Hello,

I am trying to execute command via qemu-ga with pvesh but it's failing when I am trying to do it from remote node.

Executing command with qm works fine:
Code:
A ovirt9[root](14:01:56)-(~)
-> qm guest exec 158 -- date
{
   "exitcode" : 0,
   "exited" : 1,
   "out-data" : "Wed 23 Sep 2020 02:02:01 PM CEST\n"
}

Also pvesh works when VM is located on same hypervisor:
Code:
A ovirt9[root](14:02:01)-(~)
-> pvesh create /nodes/ovirt9/qemu/158/agent/exec --command date
┌─────┬───────┐
│ key │ value │
╞═════╪═══════╡
│ pid │ 6747  │
└─────┴───────┘

A ovirt9[root](14:02:28)-(~)
-> pvesh get /nodes/ovirt9/qemu/158/agent/exec-status --pid=6747
┌──────────┬──────────────────────────────────┐
│ key      │ value                            │
╞══════════╪══════════════════════════════════╡
│ exitcode │ 0                                │
├──────────┼──────────────────────────────────┤
│ exited   │ 1                                │
├──────────┼──────────────────────────────────┤
│ out-data │ Wed 23 Sep 2020 02:02:17 PM CEST │
└──────────┴──────────────────────────────────┘

But when I call the same command from another hypervisor, I got quoting error:
Code:
A ovirt5[root](13:54:26)-(~)
-> pvesh create /nodes/ovirt9/qemu/158/agent/exec --command date
shell_quote(): No way to quote string containing null (\000) bytes at /usr/share/perl5/PVE/CLI/pvesh.pm line 117.

Am I doing anything wrong here?

I am using Proxmox version pve-manager/6.2-11/22fb4983

Any help would be appreciated.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!