Bug 995377
| Summary: | Domain without autostart can't be resumed by the libvirt-guests script after rebooting the host | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | zhenfeng wang <zhwang> |
| Component: | libvirt | Assignee: | Pavel Hrdina <phrdina> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | dyuan, gsun, lsu, mzhan, rbalakri, vivianzhang, ydu, zhwang, zpeng |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: The libvirt-guest.service was correctly started after libvirtd.service, but it was too fast that the libvirtd wasn't fully started and it couldn't accept any connection yet.
Consequence: Running domains weren't properly resumed after rebooting a host, only domains with autostart flag would start after rebooting.
Fix: Let the libvirt-guest script try several times to connect to the libvirtd with the small sleep between tries.
Result: Running domains are successfully resumed after rebooting a host.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-05 07:24:13 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
zhenfeng wang
2013-08-09 08:08:51 UTC
Hi zhwang, can you reproduce it with restart libvirt-guests but not reboot host ? hi dyuan, It works well with restart libvirt-guests, I wrote it in my description in step 7. Hi, could you please verify it with the latest libvirt? I've tried to reproduce it, but the guest started correctly after rebooting the host. If it fails again, please include output of those commands: journalctl -n 100 -u libvirt-guests journalctl -n 100 -u libvirtd Hi, I didn't reproduce the issue with the latest libvirt either, however, while i downgrade the libvirt to the libvirt-1.1.1-2.el7.x86_64, i can hit a similiar issue with the comment0 which the guest was in shut off status while the host was rebooted completely with the comment0's steps, but i can't see the guest's save img in /var/lib/libvirt/qemu/save. Maybe this issue has been fixed by the later libvirt packet. Verify this issue with libvirt-1.2.7-1.el7.x86_64: 1.start a rhel7 guest without the autostart flag #virsh start rhel7 2.Wait for the domains to fully boot up. Conduct some operations in the guest, eg # ls. 3.Edit /etc/sysconfig/libvirt-guests, and set ON_BOOT=start ON_SHUTDOWN=suspend 4.Enable the libvirt-guests service in the host #systemctl enable libvirt-guests.service 5.reboot the host #reboot 6.The guest was in running status while the host was rebooted completely, # virsh list Id Name State ---------------------------------------------------- 2 rhel7 running Verify with build libvirt-1.2.8-1.el7.x86_64 again:
1.start a rhel7 guest without the autostart flag
[root@rhel7-a1 ~]# virsh dominfo rhel7
Id: -
Name: rhel7
UUID: 2181c604-4b7a-4871-994e-352776f32ac0
OS Type: hvm
State: shut off
CPU(s): 2
Max memory: 1536000 KiB
Used memory: 0 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
[root@rhel7-a1 ~]# virsh start rhel7
Domain rhel7 started
2.Wait for the domains to fully boot up.
Conduct some operations in the guest, eg # ls.
3.Edit /etc/sysconfig/libvirt-guests, and set
ON_BOOT=start
ON_SHUTDOWN=suspend
4.Enable the libvirt-guests service in the host
[root@rhel7-a1 ~]# systemctl enable libvirt-guests
[root@rhel7-a1 ~]# systemctl status libvirt-guests
libvirt-guests.service - Suspend Active Libvirt Guests
Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service; enabled)
Active: active (exited) since Tue 2014-09-09 23:23:53 EDT; 1s ago
Docs: man:libvirtd(8)
http://libvirt.org
Process: 3757 ExecStart=/usr/libexec/libvirt-guests.sh start (code=exited, status=0/SUCCESS)
Main PID: 3757 (code=exited, status=0/SUCCESS)
[root@rhel7-a1 ~]# virsh list
Id Name State
----------------------------------------------------
2 rhel7 running
5.reboot the host
[root@rhel7-a1 ~]# reboot ; exit
Connection to 10.66.5.231 closed by remote host.
Connection to 10.66.5.231 closed.
6.The guest was in running status and resumed while the host was rebooted completely,
[root@rhel7-a1 ~]# virsh list
Id Name State
----------------------------------------------------
2 rhel7 running
[root@rhel7-a1 ~]# ls /var/lib/libvirt/qemu/save/
no files in /var/lib/libvirt/qemu/save/
I can produce this issue on build libvirt-1.1.1-2.el7.x86_64
verify it on build
libvirt-1.2.8-10.el7.x86_64
qemu-kvm-rhev-2.1.2-15.el7.x86_64
1. prepare a guest with running state with autostart disable
# virsh dominfo vm1
Id: 3
Name: vm1
UUID: 30dbd1be-8704-4586-9d0f-b75cfe351565
OS Type: hvm
State: running
CPU(s): 1
CPU time: 2.2s
Max memory: 1048576 KiB
Used memory: 1048576 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c651,c715 (permissive)
2. enable libivrt-guest service
systemctl enable libvirt-guests
[root@server libvirt]# systemctl status libvirt-guests
libvirt-guests.service - Suspend Active Libvirt Guests
Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service; enabled)
Active: active (exited) since Thu 2014-11-20 14:32:18 HKT; 12min ago
Docs: man:libvirtd(8)
http://libvirt.org
Main PID: 4609 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/libvirt-guests.service
Nov 20 14:32:18 server.englab.nay.redhat.com systemd1: Started Suspend Active Libvirt Guests.
3. reboot host
4. after host start up completely, check guest status is running, login guest, it works well and keeps at the place where it left, check save file does not exist in /var/lib/libvirt/qemu/save
5. restart the libvirt-guests and repeat step4, get the same result
# systemctl restart libvirt-guests.service
[root@intel-e31225-16-2 ~]# virsh list --all
Id Name State
----------------------------------------------------
3 vm1 running
6. keep the guest in running and autostart disable
# virsh start vm1
Domain vm1 started
# virsh dominfo vm1
Id: 6
Name: vm1
UUID: 30dbd1be-8704-4586-9d0f-b75cfe351565
OS Type: hvm
State: running
CPU(s): 1
CPU time: 0.4s
Max memory: 1048576 KiB
Used memory: 1048576 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c150,c831 (permissive)
7. edit /etc/sysconf/libvirt-guests
ON_SHUTDOWN=suspend
ON_BOOT=ignore
8. restart the libvirt-guest service, check the guest in shutoff status, and save file exist
#systemctl restart libvirt-guests
# virsh list --all
Id Name State
----------------------------------------------------
- vm1 shut off
ll /var/lib/libvirt/qemu/save/
total 1281320
-rw-------. 1 root root 340276100 Dec 4 16:45 vm1.save
9. start the guest, works well and stay the place where it lefe
10. reboot the host and repeat step8 and 9 get the same result
11. edit /etc/sysconfig/libvirt-guests
ON_SHUTDOWN=shutdown
ON_BOOT=ignore
12.Restart the libvirt-guests service, check guest in shutoff and not save file exist in /var/lib/libvirt/qemu/save
#systemctl restart libvirt-guests
# virsh list --all
Id Name State
----------------------------------------------------
- vm1 shut off
# ll /var/lib/libvirt/qemu/save/
13. start guest, it initialize from a fresh start
14. reboot host and repeat step 12 and 13, get the same result
move to verified
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. https://rhn.redhat.com/errata/RHSA-2015-0323.html |