Corsinvest / cv4pve-autosnap

Automatic snapshot tool for Proxmox VE
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
413 stars 51 forks source link

QEMU Agent enabled but not recognized v1.1.2 #17

Closed francio87 closed 5 years ago

francio87 commented 5 years ago

Hi, the latest release, always show the warning of QEMU Agent not enabled, on both windows and linux VM:

VM XXX consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent

VM500 - W10 Pro, Latest QEMU-GA VM800 - Debian 10 apt'd get qemu-ga VM900 - Ubuntu lxc container

ACTION Snap 
VMs:   all  
Label: Daily 
Keep:  7 
State: False
----- VM 500 -----
VM 500 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily190904155355
----- VM 800 -----
VM 800 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily190904155408
----- VM 900 -----
Create snapshot: autoDaily190904155409

EDIT:

After some digging, i've found that the error show up only if the option "Run guest-trim after clone disk" it's enabled

franklupo commented 5 years ago

Hi, I check if the "Agent" option is enabled. What solution can there be?

best regards

francio87 commented 5 years ago

hi, to be honest i don't have idea what could be the solution, but i could help you debug it. Btw what's the command you send to the agent to check if it's enable ? I could try to reproduce it on proxmox host to see if it change the output when the option it's enabled / disabled.

franklupo commented 5 years ago

Hi, i'm using API, You can check using my other software CLI https://github.com/Corsinvest/cv4pve-cli. Execute

cv4pve-cli --host={host} --username=root@pam --password={password} get /nodes/{node}/qemu/500/status/current

or in interactive shell mode get /nodes/{node}/qemu/500/status/current

Check if key agent equal 1

Best regards

francio87 commented 5 years ago

Hi, i'm using API, You can check using my other software CLI https://github.com/Corsinvest/cv4pve-cli. Execute

cv4pve-cli --host={host} --username=root@pam --password={password} get /nodes/{node}/qemu/500/status/current

or in interactive shell mode get /nodes/{node}/qemu/500/status/current

Check if key agent equal 1

Best regards

Uhm, i've tried with pvesh since i'm at work right now and can't check your other software, but it seems that proxmox return the correct information via API.

** Run guest-trim after clone disk DISABLE **
root@px01:~# pvesh get /nodes/px01/qemu/610/status/current
┌───────────┬───────────────┐
│ key       │ value         │
├───────────┼───────────────┤
│ agent     │ 1             │
├───────────┼───────────────┤
│ cpus      │ 4             │
├───────────┼───────────────┤
│ ha        │ {"managed":0} │
├───────────┼───────────────┤
│ maxdisk   │ 128.00 GiB    │
├───────────┼───────────────┤
│ maxmem    │ 4.00 GiB      │
├───────────┼───────────────┤
│ name      │ W10P-CL-M     │
├───────────┼───────────────┤
│ pid       │ 4264          │
├───────────┼───────────────┤
│ qmpstatus │ running       │
├───────────┼───────────────┤
│ status    │ running       │
├───────────┼───────────────┤
│ uptime    │ 2h 58m 6s     │
├───────────┼───────────────┤
│ vmid      │ 610           │
└───────────┴───────────────┘
----- VM 610 -----
Create snapshot: autoDaily190905110121
Remove snapshot: autoDaily190904235014
-----------------------------------------------------------

** Run guest-trim after clone disk ENABLE **
root@px01:~# pvesh get /nodes/px01/qemu/610/status/current
┌───────────┬───────────────┐
│ key       │ value         │
├───────────┼───────────────┤
│ agent     │ 1             │
├───────────┼───────────────┤
│ cpus      │ 4             │
├───────────┼───────────────┤
│ ha        │ {"managed":0} │
├───────────┼───────────────┤
│ maxdisk   │ 128.00 GiB    │
├───────────┼───────────────┤
│ maxmem    │ 4.00 GiB      │
├───────────┼───────────────┤
│ name      │ W10P-CL-M     │
├───────────┼───────────────┤
│ pid       │ 10324         │
├───────────┼───────────────┤
│ qmpstatus │ running       │
├───────────┼───────────────┤
│ status    │ running       │
├───────────┼───────────────┤
│ uptime    │ 50s           │
├───────────┼───────────────┤
│ vmid      │ 610           │
└───────────┴───────────────┘

----- VM 610 -----
VM 610 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily190905110121
Remove snapshot: autoDaily190904235014
--------------------------------------------------------------------------

Also if you compare the output in json format, you will recive the simple agent : 1 there aren't any notable difference between the enable and disable version.

https://www.diffchecker.com/lwBPWkIr

btw, can you replicate the issue ?

I'll check out cv4pve-cli as soon as i get home

Thanks

franklupo commented 5 years ago

ok run command autosnap with option --debug and save (> log.txt") to file. In output are present the password.

Send me file.

best regards

francio87 commented 5 years ago

ok run command autosnap with option --debug and save (> log.txt") to file. In output are present the password.

Send me file.

best regards

Hi, here's the logs:

With both guest-trim enable and disable, it's a test environment, so i don't mind if the passwords are shown ;)

log_guest-trim_enable.txt log_guest-trim_disable.txt

Best Regards

franklupo commented 5 years ago

Ok, found error. I check angent equal "1" but the string is structured.

"agent": "1,fstrim_cloned_disks=1",

Create fix

francio87 commented 5 years ago

Great! Thanks

franklupo commented 5 years ago

See new release 1,2.0

Best regards