Bug 1095637 - virsh dominfo for LXC domain causes spurious error "this function is not supported by the connection driver: virDomainHasManagedSaveImage"
Summary: virsh dominfo for LXC domain causes spurious error "this function is not supp...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-05-08 09:05 UTC by Malte Starostik
Modified: 2015-11-19 05:46 UTC (History)
10 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-11-19 05:46:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Malte Starostik 2014-05-08 09:05:17 UTC
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create an LXC domain and start it
2. virsh -c lxc:/// dominfo <thatdomain>
3. view system journal/logs

Actual results:
The above call results in the useless "error" log "this function is not supported by the connection driver: virDomainHasManagedSaveImage"

Expected results:
No log entry should be generated at all, if at all, this should have a severity of debug

Additional info:
When managing containers with crm (ocf:heartbeat:VirtualDomain), every time the resource is monitored, the journal is spammed with the above useless message as the monitor operation will run virsh dominfo.  This results in one such message per affected domain every 30 seconds.

Comment 1 Miroslav Lisik 2015-01-09 13:01:12 UTC
I have the same problem when running LXC container in cluster as resource.

Libvirt version: libvirt-1.2.8-11.el7.x86_64

It spams log file every 3-5 seconds, so the file size grows quickly.

Comment 2 Daniel Berrangé 2015-01-09 13:05:08 UTC
The cluster software really should not use virsh to monitor the VMs in this way. It should use the libvirt API directly, which is available in every common programming language. Not only would this avoid calling functions that are not required & so avoid this error message, but it would be much more efficient too.

Comment 3 Malte Starostik 2015-01-09 13:14:44 UTC
Agreed.  But then VirtualDomain, like ca. 99% of the Linux HA resource agents, is in fact just a shell script making virsh its natural interace to libvirtd.

Comment 4 Jaroslav Kortus 2015-01-12 14:06:16 UTC
changing product to RHEL so that we can track it better. As I understand it it's RHEL 7 issue.

Comment 6 Jiri Denemark 2015-01-12 14:47:37 UTC
There are two possible ways of fixing this... First, the resource agent should be rewritten to python or perl and use libvirt API directly. Second, virDomainHasManagedSaveImage could be trivially implemented for LXC.

Comment 7 Jaroslav Kortus 2015-01-12 18:27:45 UTC
we would definitely prefer the second option :)

Comment 8 Ján Tomko 2015-01-26 16:57:31 UTC
Upstream patch implementing the second option:

Comment 10 Ján Tomko 2015-02-06 12:02:52 UTC
Pushed upstream:
commit 481881f50ae3e3bc4699baf42d35b3ef7d95c685
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2015-02-06 12:52:50 +0100

    Trivially support DomainHasManagedSaveImage
    Return 0 instead of ERR_NO_SUPPORT in each driver
    where we don't support managed save or -1 if
    the domain does not exist.
    This avoids spamming daemon logs when 'virsh dominfo' is run.

git describe: v1.2.12-82-g481881f

Comment 12 Yang Yang 2015-05-14 03:26:07 UTC
Verified on libvirt-1.2.15-1.el7.x86_64

1. define/start a lxc
# virsh -c lxc:/// define lxc.xml
# virsh -c lxc:/// start helloworld
# cat lxc.xml 
<domain type='lxc'>
  <memory unit='KiB'>102400</memory>
  <currentMemory unit='KiB'>102300</currentMemory>
  <vcpu placement='static' cpuset='1-3'>2</vcpu>
    <type arch='x86_64'>exe</type>
  <clock offset='utc'/>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
    <console type='pty'>
      <target type='lxc' port='0'/>
  <seclabel type='dynamic' model='selinux' relabel='yes'/>

2. # virsh -c lxc:/// dominfo helloworld
Id:             14079
Name:           helloworld
UUID:           ed1955f7-4e72-40ae-8265-c193e7436c8a
OS Type:        exe
State:          running
CPU(s):         2
CPU time:       0.0s
Max memory:     102400 KiB
Used memory:    564 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0
Security label: system_u:system_r:svirt_lxc_net_t:s0:c822,c883 (enforcing)

Comment 14 errata-xmlrpc 2015-11-19 05:46:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.