Bug 1416316 - [Xen][libvirt] Xen guest is shutdown when first starting libvirtd.service.
Summary: [Xen][libvirt] Xen guest is shutdown when first starting libvirtd.service.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-25 09:19 UTC by Lin Liu
Modified: 2021-05-26 01:11 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 13:34:20 UTC


Attachments (Terms of Use)

Description Lin Liu 2017-01-25 09:19:38 UTC
Description of problem:
Xen guest is shutdown when first starting libvirtd.service.

Version-Release number of selected component (if applicable):
kernel-4.9.0-0.rc6.git2.1.fc26.x86_64
libvirt-3.0.0-1.fc26.x86_64
xen-4.8.0-2.fc26.x86_64

How reproducible: Always

Steps to Reproduce:
1. Boot Fedora Rawhide system xen hypervisor.
2. Create a vm guest using command "xl create xen-guest.conf"
3. Using “xl list” to check the guest status, login to guest and the guest works OK.
4. Start libvirtd.service, check the guest status by xl list.

Actual results:
Xen guest is shutdown when executing command "service libvirtd start", the status changing like this:
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      36.4
xen-hvm-32                                   1  1024     2     -b----       0.2
[root@dhcp-10-249 ~]# service libvirtd status
Redirecting to /bin/systemctl status  libvirtd.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor pre
   Active: inactive (dead)
     Docs: man:libvirtd(8)
           http://libvirt.org
[root@dhcp-10-249 ~]# service libvirtd start
Redirecting to /bin/systemctl start  libvirtd.service
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      42.0
xen-hvm-32                                   1  1024     2     ---ss-       0.4
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      45.0
xen-hvm-32                                   1  1024     2     --pss-       0.4
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      46.3
(null)                                       1  1024     2     --pss-       0.4
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      48.0
(null)                                       1  1024     2     --pss-       0.4
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----      50.0
(null)                                       1  1024     2     --pss-       0.4
[root@dhcp-10-249 ~]# xl list
Name                                        ID   Mem VCPUs        State        Time(s)
Domain-0                                     0  6916     8     r-----     103.6


Expected results:
The libvirtd service shouldn't affect xen guest status.

Additional information:
1. Creating xen guest again, and then restart or stop/start libvirtd.service again, the guest status isn't affected. So xen guest is shutdown only when first starting libvirtd.service after booting host.
2. The xen guest logs displays the guest is shutdown:
   Waiting for domain xen-hvm-32 (domid 1) to die [pid 1634]
   Domain 1 has shut down, reason code 2 0x2
   Domain has suspended.
   Done. Exiting now

Comment 1 Fedora End Of Life 2017-02-28 11:03:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Cole Robinson 2017-05-03 19:15:03 UTC
Are you still seeing this with latest f26/rawhide packages?

Comment 3 Frank Liang 2017-06-08 02:01:56 UTC
Yes, it still exists on Fedora26 Alpha release.

[root@dell-per415-02 rhel7]# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 28221    16     r-----      51.3
guest2                                       1  4096    32     r-----      51.6
[root@dell-per415-02 rhel7]# systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:libvirtd(8)
           http://libvirt.org
[root@dell-per415-02 rhel7]# systemctl start libvirtd.service
[root@dell-per415-02 rhel7]# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 28221    16     r-----      58.2
guest2                                       1  4096    32     ---ss-     140.9

[root@dell-per415-02 ~]# rpm -qa|egrep "kernel-4|xen-4|libvirt-3"
kernel-4.11.0-0.rc3.git0.2.fc26.x86_64
libvirt-3.1.0-1.fc26.x86_64
xen-4.8.0-8.fc26.x86_64

Comment 4 Cole Robinson 2017-06-26 18:23:35 UTC
Okay since this has persisted across releases and in fedora we are largely kvm focused, moving to the upstream tracker and CCing libvirt xen maintainer

Comment 6 Jim Fehlig 2021-05-25 16:14:44 UTC
FYI, this is fixed with a newer libvirt. I vaguely recall working on it, but was unsuccessful in quickly finding the commit(s). I did verify the fix is in a somewhat older libvirt by doing a test on SLES15 SP2 (xen 4.13, libvirt 6.0.0):

# systemctl is-active libvirtd
inactive
# xl list
Name                                        ID   Mem VCPUs	State	Time(s)
Domain-0                                     0 10690    48     r-----     276.5
Xenstore                                     1    31     1     -b----       0.1
sle15sp2-hvm                                 2  4088     4     -b----      77.0
# systemctl start libvirtd
# systemctl is-active libvirtd
active
... wait some time just to be sure
# xl list
Name                                        ID   Mem VCPUs	State	Time(s)
Domain-0                                     0 10690    48     r-----     347.6
Xenstore                                     1    31     1     -b----       0.1
sle15sp2-hvm                                 2  4088     4     -b----     101.8

Comment 7 Frank Liang 2021-05-26 01:11:45 UTC
(In reply to Jim Fehlig from comment #6)
> FYI, this is fixed with a newer libvirt. I vaguely recall working on it, but
> was unsuccessful in quickly finding the commit(s). I did verify the fix is
> in a somewhat older libvirt by doing a test on SLES15 SP2 (xen 4.13, libvirt
> 6.0.0):
Thanks, Jim

Move close status to 'CURRENTRELEASE'.


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