introspective-instance-monitor:Should not use LIBVIRT_DEFAULT_URI in function checkGuests

Bug #1844603 reported by 长孙弘奕
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
masakari-monitors
New
Undecided
Unassigned

Bug Description

in masakari-monitors/masakarimonitors/introspectiveinstancemonitor/qemu_utils.py:390
code ` conn = libvirt.open(None) # LIBVIRT_DEFAULT_URI`
will use the environment variable LIBVIRT_DEFAULT_URI.
If I run the masakari-introspective-instance-monitor service in ubuntu 18.04 with `systemctl restart masakari-introspective-instance-monitor`.LIBVIRT_DEFAULT_URI is qemu:///sessoin. and I can not get any domains.
However, in masakari-monitors/masakarimonitors/introspectiveinstancemonitor/instance.py:172,LOG debug tells to use uri with CONF.libvirt.connection_uri. It cost me a lot of time to troubleshooting the problem.
So, I think alter `conn = libvirt.open(None)` to `conn = libvirt.open(CONF.libvirt.connection_uri)` is better.

Revision history for this message
leelswngsh (lswngsh) wrote :

 the service introspectiveinstancemonitor continually output logs as below:

WARNING masakarimonitors.introspectiveinstancemonitor.qemu_utils [-] Failed to connect socket to '/var/lib/masakari/.cache/libvirt/libvirt-sock': No such file or directory: libvirt.libvirtError: Failed to connect socket to '/var/lib/masakari/.cache/libvirt/libvirt-sock': No such file or directory

WARNING masakarimonitors.introspectiveinstancemonitor.instance [-] Error from libvirt : Failed to connect socket to '/var/lib/masakari/.cache/libvirt/libvirt-sock': No such file or directory

Revision history for this message
leelswngsh (lswngsh) wrote :

in masakari-monitors/masakarimonitors/introspectiveinstancemonitor/qemu_utils.py:390
I think alter `conn = libvirt.open(None)` to `conn = libvirt.open(CONF.libvirt.connection_uri) and print the log with LOG.warning("lsw999 %s", print(type(running))).
Then ,I restart introspectiveinstancemonitor service,the log output indicates the "running" object is None;So the code in masakari-monitors/masakarimonitors/introspectiveinstancemonitor/qemu_utils.py:393

running = map(conn.lookupByID, ids) ;Is there a problem with this line of code?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.