Bug 675319

Summary: qemu guests autostart problem
Product: Red Hat Enterprise Linux 5 Reporter: Joe Julian <joe>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.6CC: berrange, clalance, crobinso, dallan, dyuan, eblake, honzhang, itamar, jforbes, joe, mzhan, pseudo, redhat-bugzilla, roland.friedwagner, rwu, veillard, virt-maint, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.2-26.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 632100 Environment:
Last Closed: 2013-01-08 04:56:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 807971    

Description Joe Julian 2011-02-04 21:35:56 UTC
+++ This bug was initially created as a clone of Bug #632100 +++

Description of problem:

After upgrading from Fedora 12 to Fedora 13qemu domains is not marked as autostarted.

Version-Release number of selected component (if applicable):
libvirt-0.8.2-1.fc13.x86_64
qemu-system-x86-0.12.5-1.fc13.x86_64

How reproducible:
Upgrade working Fedora 12 system with libvirt/qemu guests marked as autostart.

Steps to Reproduce:
1.
2.
3.
  
Actual results:

lrwxrwxrwx 1 root root 27 Aug  4 15:35 /etc/libvirt/qemu/autostart/tecom.xml -> /etc/libvirt/qemu/tecom.xml

[root@xen005 ~]# virsh dominfo tecom
Id:             3
Name:           tecom
UUID:           c5f94da4-46d7-c645-8273-a2bdbd5a4327
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       80038.1s
Max memory:     262144 kB
Used memory:    262144 kB
Persistent:     yes
Autostart:      disable

[root@xen005 ~]# virsh autostart tecom
error: Failed to mark domain tecom as autostarted
error: Failed to create symlink '/etc/libvirt/qemu/autostart/tecom.xml to '/etc/libvirt/qemu/tecom.xml': File exists

Expected results:
Autostart:      enable

Additional info:

--- Additional comment from joe on 2011-02-04 16:26:03 EST ---

I had the same error with libvirt-0.8.2-15.el5_6.1

Removing the symlinks from /etc/libvirt/qemu/autostart allowed me to run "virsh autostart {dom}" successfully though.

Subsequent calls of that command are also still successful. I was not able to determine what caused autostart to be considered disabled.

Comment 1 Roland Friedwagner 2011-05-09 13:26:03 UTC
Same annoying behavior here since upgrading KVM-Hosts from RHEL 5.5 to 5.6

libvirt-0.8.2-15.el5_6.3

=> it renders the checking status via remote requests like this 
   $ virsh -c qemu+ssh://kvm-XX/system dominfo YYY
   impossible

=> this breaks autostart status monitoring

Comment 2 Roland Friedwagner 2011-05-09 13:44:54 UTC
> Subsequent calls of that command are also still successful. I was not able to
> determine what caused autostart to be considered disabled.

The autostart status disable of virsh dominfo _always_ show "disabled"
after restarting libvirt.

@Joe Julian: Did you restarted libvirtd after recreating the symlink
             via virsh autostart ?

Comment 3 Joe Julian 2011-05-09 15:02:58 UTC
No, the last time I had this happen (last night) I had just destroyed some domains and started them again.

Comment 4 Eric Blake 2011-06-14 20:20:31 UTC
Upstream patch here: https://www.redhat.com/archives/libvir-list/2011-June/msg00479.html

Comment 7 RHEL Program Management 2012-03-30 14:18:15 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 12 hongming 2012-06-26 09:10:32 UTC
Verify it using the following versions , it can't be reproduced. So move its status to verified.

Versions 
kernel 2.6.18-321.el5
libvirt-0.8.2-26.el5
kvm-83-254.el5

Steps 
1. # virsh dominfo rhel5.7
Id:             -
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      disable

2. # virsh autostart rhel5.7
Domain rhel5.7 marked as autostarted

3. # virsh dominfo rhel5.7
Id:             -
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      enable


4. # virsh start rhel5.7
Domain rhel5.7 started

5. # virsh destroy rhel5.7
Domain rhel5.7 destroyed

6. # service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]

7. # virsh list --all
 Id Name                 State
----------------------------------
  2 rhel5.7              running

Comment 13 hongming 2012-06-27 10:30:11 UTC
After do the following verifying steps , the error occurs after downgrading libvirt with guest with autostart. But It don't occur after upgrading.Move its status to ASSIGNED.

1) Upgrade libvirt 
# virsh dominfo rhel5.7
Id:             2
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       165.1s
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      enable

# rpm -Uvh libvirt-0.8.2-26.el5.x86_64.rpm libvirt-python-0.8.2-26.el5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:libvirt                ########################################### [ 50%]
   2:libvirt-python         ########################################### [100%]

# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]

# virsh dominfo rhel5.7
Id:             2
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       165.1s
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      enable

# virsh autostart rhel5.7
Domain rhel5.7 marked as autostarted


2) Downgrade libvirt

# virsh dominfo rhel5.7
Id:             2
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       6.6s
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      enable

# rpm -Uvh libvirt-0.8.2-25.el5.x86_64.rpm libvirt-python-0.8.2-25.el5.x86_64.rpm --oldpackage
Preparing...                ########################################### [100%]
   1:libvirt                ########################################### [ 50%]
   2:libvirt-python         ########################################### [100%]

# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]

# virsh dominfo rhel5.7
Id:             2
Name:           rhel5.7
UUID:           2aa631dd-46b5-4b18-dc4f-1ff5f57bf2f2
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       31.8s
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      disable

# virsh autostart rhel5.7
error: Failed to mark domain rhel5.7 as autostarted
error: Failed to create symlink '/etc/libvirt/qemu/autostart/rhel5.7.xml to '/etc/libvirt/qemu/rhel5.7.xml': File exists

Comment 14 hongming 2012-06-28 03:28:05 UTC
Because there are only libvirt-0.8.2-25.el5 and libvirt-0.8.2-26.el5 in rhel5 and the bug isn't fixed in libvirt-0.8.2-25. The above downgrade testing is invalid. The results in downgrade and upgrade testing all are correct. 


So move it to VERIFIED again.

Comment 16 errata-xmlrpc 2013-01-08 04:56:26 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.

http://rhn.redhat.com/errata/RHSA-2013-0127.html