Re: [libvirt-users] can't find how to solve "QEMU guest agent is not connected"

2018-04-18 Thread Matt
Thanks for your answer.

It turns out that I admitted a bit too fast that the agent was running
and your question made me refocus on it. I reread the PR, especially
the systemd part I tend to skip as I get tired of learning yet another
protocol/configuration. Turned out it had some conditions that when
removed made the whole thing worked !
+ systemd.services.qemu-guest-agent = {
+ description = "QEMU Guest Agent";
+ bindsTo = [ "dev-virtio\\x2dports-org.qemu.guest_agent.0.device" ];
+ after = [ "dev-virtio\\x2dports-org.qemu.guest_agent.0.device" ];

So thanks for the hint :D

>> virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive
>> file=/var/lib/libvirt/images/nixops-0084610a-4150-11e8-aef5-309c233b770e-server.qcow2,format=qcow2,if=none,id=drive-ide0-0-0
>> -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
>
> Why do you use IDE instead of VirtIO? IDE is slow and if the guest OS is
> linux it most likely has VirtIO drivers.
I use linux/nixos. The command is generated but thanks for the advice,
I might fix this later.

Cheers !

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] can't find how to solve "QEMU guest agent is not connected"

2018-04-17 Thread Pavel Hrdina
On Tue, Apr 17, 2018 at 07:54:14PM +0900, Matt wrote:
> I am trying to make Qemu agent work with libvirt thanks to
> https://github.com/NixOS/nixops/pull/922 with libvirt 4.1.0. I've been
> trying to make it work for quite some time but I still haven't the
> slightest idea of what is wrong, I keep seeing "Guest agent is not
> responding: QEMU guest agent is not connected" as the program I use
> (nixops) calls the libvirt python API.
> 
> I apologize in advance for dropping so many details but in case
> someone is interested in answering this post, I thought I would
> provide details upfront.

Hi,

It's always better to share a lot of details instead of no details at
all :), no need to apologize.

> The failure surprises me as typically a socket is created when I start
> the VM with a priori the correct rights myuser:libvirtd (libvirtd is
> the default libvirt group on nixos, different from upstream IIRC):
> /var/lib/libvirt/qemu/channel/target/domain-10-nixops-3cb2c9c2-41ea/org.qemu.guest_agent.0

Maybe an obvious question, but what is the OS installed inside the guest
and is the qemu-guest-agent running in that guest?

> My domain contains
> ```
> 
>   
>   
> 
> ```

If you run "virsh dumpxml $domain" on running domain you should be able
to see if it's connected or not:

  ...
  
  ...

> as requested per the doc (I tried with source=bind to no avail, btw
> the doc for `source` is not that great)
> 
> my libvirtd.conf has the following setting
> 
> ```
>   log_level = 1
>   # no filter for now
>   log_filters="1:qemu.qemu_agent 1:qemu.qemu_monitor"
>   # log_filters="3:remote 4:event 3:json 3:rpc"
>   log_outputs="1:file:/var/log/libvirt/libvirtd.log"
> ```
> 
> `journalctl -b -u libvirtd.service` returns
> 
> ```
> avril 17 12:31:05 jedha libvirtd[22804]: 2018-04-17 03:31:05.482+:
> 22806: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:06 jedha libvirtd[22804]: 2018-04-17 03:31:06.487+:
> 22807: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:07 jedha libvirtd[22804]: 2018-04-17 03:31:07.493+:
> 22805: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:08 jedha libvirtd[22804]: 2018-04-17 03:31:08.499+:
> 22809: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:09 jedha libvirtd[22804]: 2018-04-17 03:31:09.506+:
> 22808: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:10 jedha libvirtd[22804]: 2018-04-17 03:31:10.513+:
> 22806: error : qemuDomainAgentAvailable:7755 : Guest agent is not
> responding: QEMU guest agent is not connected
> avril 17 12:31:11 jedha libvirtd[22804]: 2018-04-17 03:31:11.512+:
> 22804: error : virNetSocketReadWire:1809 : End of file while reading
> data: Input/output error
> ```
> 
> Here is an excerpt just before the error "GUest agent is not
> connected" (full log of 82MB available at
> https://drive.google.com/file/d/1sYpyJ2WQMlyFqNKkPkvSAJ13Tm2JjpVk/view?usp=sharing)
> ```
> 2018-04-17 03:56:41.982+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=5 w=6, f=12 e=1 d=0
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=6 w=7, f=13 e=1 d=0
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=7 w=8, f=15 e=1 d=0
> 2018-04-17 03:56:41.983+: 807: debug :
> virAccessManagerCheckDomain:234 : manager=0x55fa67d0d450(name=stack)
> driver=QEMU domain=0x7f2c5800c040 perm=1
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=8 w=9, f=17 e=25 d=0
> 2018-04-17 03:56:41.983+: 807: debug :
> virAccessManagerCheckDomain:234 : manager=0x55fa67d0d6f0(name=none)
> driver=QEMU domain=0x7f2c5800c040 perm=1
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=9 w=10, f=18 e=1 d=0
> 2018-04-17 03:56:41.983+: 807: info : virObjectUnref:350 :
> OBJECT_UNREF: obj=0x55fa67d0d450
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=10 w=11, f=19 e=1 d=0
> 2018-04-17 03:56:41.983+: 807: info : virObjectRef:388 :
> OBJECT_REF: obj=0x7f2c14026460
> 2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
> : Prepare n=11 w=13, f=23 e=25 d=0
> 2018-04-17 03:56:41.983+: 807: debug :
> qemuDomainObjBeginJobInternal:5393 : Starting job: query
> (vm=0x7f2c58004770
> name=nixops-4f58a5c0-41f3-11e8-9858-309c233b770e-server, current
> job=none async=none)
> 2018-04-17 03:56:41.983+: 806: debug :
> virEventPollCalculateTimeout:338 : Calculate expiry of 1 timers
> 2018-04-17 03:56:41.983+: 807: debug :
> qemuDomainObjBeginJobInternal:5434 : Started job: 

[libvirt-users] can't find how to solve "QEMU guest agent is not connected"

2018-04-17 Thread Matt
I am trying to make Qemu agent work with libvirt thanks to
https://github.com/NixOS/nixops/pull/922 with libvirt 4.1.0. I've been
trying to make it work for quite some time but I still haven't the
slightest idea of what is wrong, I keep seeing "Guest agent is not
responding: QEMU guest agent is not connected" as the program I use
(nixops) calls the libvirt python API.

I apologize in advance for dropping so many details but in case
someone is interested in answering this post, I thought I would
provide details upfront.

The failure surprises me as typically a socket is created when I start
the VM with a priori the correct rights myuser:libvirtd (libvirtd is
the default libvirt group on nixos, different from upstream IIRC):
/var/lib/libvirt/qemu/channel/target/domain-10-nixops-3cb2c9c2-41ea/org.qemu.guest_agent.0

My domain contains
```

  
  

```
as requested per the doc (I tried with source=bind to no avail, btw
the doc for `source` is not that great)

my libvirtd.conf has the following setting

```
  log_level = 1
  # no filter for now
  log_filters="1:qemu.qemu_agent 1:qemu.qemu_monitor"
  # log_filters="3:remote 4:event 3:json 3:rpc"
  log_outputs="1:file:/var/log/libvirt/libvirtd.log"
```

`journalctl -b -u libvirtd.service` returns

```
avril 17 12:31:05 jedha libvirtd[22804]: 2018-04-17 03:31:05.482+:
22806: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:06 jedha libvirtd[22804]: 2018-04-17 03:31:06.487+:
22807: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:07 jedha libvirtd[22804]: 2018-04-17 03:31:07.493+:
22805: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:08 jedha libvirtd[22804]: 2018-04-17 03:31:08.499+:
22809: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:09 jedha libvirtd[22804]: 2018-04-17 03:31:09.506+:
22808: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:10 jedha libvirtd[22804]: 2018-04-17 03:31:10.513+:
22806: error : qemuDomainAgentAvailable:7755 : Guest agent is not
responding: QEMU guest agent is not connected
avril 17 12:31:11 jedha libvirtd[22804]: 2018-04-17 03:31:11.512+:
22804: error : virNetSocketReadWire:1809 : End of file while reading
data: Input/output error
```

Here is an excerpt just before the error "GUest agent is not
connected" (full log of 82MB available at
https://drive.google.com/file/d/1sYpyJ2WQMlyFqNKkPkvSAJ13Tm2JjpVk/view?usp=sharing)
```
2018-04-17 03:56:41.982+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=5 w=6, f=12 e=1 d=0
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=6 w=7, f=13 e=1 d=0
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=7 w=8, f=15 e=1 d=0
2018-04-17 03:56:41.983+: 807: debug :
virAccessManagerCheckDomain:234 : manager=0x55fa67d0d450(name=stack)
driver=QEMU domain=0x7f2c5800c040 perm=1
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=8 w=9, f=17 e=25 d=0
2018-04-17 03:56:41.983+: 807: debug :
virAccessManagerCheckDomain:234 : manager=0x55fa67d0d6f0(name=none)
driver=QEMU domain=0x7f2c5800c040 perm=1
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=9 w=10, f=18 e=1 d=0
2018-04-17 03:56:41.983+: 807: info : virObjectUnref:350 :
OBJECT_UNREF: obj=0x55fa67d0d450
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=10 w=11, f=19 e=1 d=0
2018-04-17 03:56:41.983+: 807: info : virObjectRef:388 :
OBJECT_REF: obj=0x7f2c14026460
2018-04-17 03:56:41.983+: 806: debug : virEventPollMakePollFDs:401
: Prepare n=11 w=13, f=23 e=25 d=0
2018-04-17 03:56:41.983+: 807: debug :
qemuDomainObjBeginJobInternal:5393 : Starting job: query
(vm=0x7f2c58004770
name=nixops-4f58a5c0-41f3-11e8-9858-309c233b770e-server, current
job=none async=none)
2018-04-17 03:56:41.983+: 806: debug :
virEventPollCalculateTimeout:338 : Calculate expiry of 1 timers
2018-04-17 03:56:41.983+: 807: debug :
qemuDomainObjBeginJobInternal:5434 : Started job: query (async=none
vm=0x7f2c58004770
name=nixops-4f58a5c0-41f3-11e8-9858-309c233b770e-server)
2018-04-17 03:56:41.983+: 806: debug :
virEventPollCalculateTimeout:371 : No timeout is pending
2018-04-17 03:56:41.983+: 807: info : virObjectUnref:350 :
OBJECT_UNREF: obj=0x7f2c14026460
2018-04-17 03:56:41.983+: 806: info : virEventPollRunOnce:640 :
EVENT_POLL_RUN: nhandles=12 timeout=-1
2018-04-17 03:56:41.983+: 807: error :
qemuDomainAgentAvailable:7755 : Guest agent is not responding: QEMU
guest agent is not connected
```

This is the VM log from a machine similar to the one in the previous