Purge-kernels service not working with xen package?

Hello,

Seems that the purge-kernels service doesn’t work when the xen package is installed.
In zypp.conf I have
multiversion.kernels = latest,latest-1,latest-2,running
but i have now much more kernels

rpm -qa kernel-default\*
kernel-default-devel-4.19.4-1.4.x86_64
kernel-default-4.19.5-1.5.x86_64
kernel-default-devel-4.18.13-1.6.x86_64
kernel-default-4.19.4-1.4.x86_64
kernel-default-devel-4.18.15-1.2.x86_64
kernel-default-4.19.1-1.5.x86_64
kernel-default-devel-4.19.5-1.5.x86_64
kernel-default-4.19.2-1.3.x86_64
kernel-default-devel-4.19.2-1.3.x86_64
kernel-default-devel-4.18.14-1.5.x86_64
kernel-default-devel-4.19.1-1.5.x86_64
kernel-default-4.18.14-1.5.x86_64
kernel-default-4.18.13-1.6.x86_64
kernel-default-4.18.15-1.2.x86_64

So I did the next step
created in /boot a file do_purge_kernels via “sudo touch do_purge_kernels”
restarted the purge via

# systemctl start purge-kernels

Job for purge-kernels.service failed because the control process exited with error code.
See "systemctl status purge-kernels.service" and "journalctl -xe" for details.

# systemctl status purge-kernels.service
● purge-kernels.service - Purge old kernels
   Loaded: loaded (/usr/lib/systemd/system/purge-kernels.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-12-07 08:12:30 CET; 18s ago
  Process: 19433 ExecStart=/sbin/purge-kernels (code=exited, status=1/FAILURE)
  Process: 19432 ExecStartPre=/bin/rm -f /boot/do_purge_kernels (code=exited, status=0/SUCCESS)
 Main PID: 19433 (code=exited, status=1/FAILURE)

Dec 07 08:12:04 hpprol2 systemd[1]: Starting Purge old kernels...
Dec 07 08:12:30 hpprol2 purge-kernels[19433]: error: Failed dependencies:
Dec 07 08:12:30 hpprol2 purge-kernels[19433]:         **kernel-xen is needed by (installed) patterns-server-xen_server-20180718-1.1.x86_64**
Dec 07 08:12:30 hpprol2 purge-kernels[19433]: /sbin/purge-kernels: giving up.
Dec 07 08:12:30 hpprol2 systemd[1]: purge-kernels.service: Main process exited, code=exited, status=1/FAILURE
Dec 07 08:12:30 hpprol2 systemd[1]: purge-kernels.service: Failed with result 'exit-code'.
Dec 07 08:12:30 hpprol2 systemd[1]: Failed to start Purge old kernels.

AFAIK the kernel-xen doesn’t more exist and the xen.gz use the standard kernel since one or two years

cat /boot/grub2/grub.cfg
...
    multiboot    /boot/xen-4.11.0_09-3.gz placeholder "" "" ${xen_rm_opts}
    echo    'Loading Linux 4.19.5-1-default ...'
    module    /boot/vmlinuz-4.19.5-1-default placeholder root=UUID=0d169d88-fe6d-4ca8-bebf-916cae9ec3d7 "" resume=/dev/disk/by-id/scsi-3600508b1001c99233458581ffb65cc88-part1 splash=verbose showopts vga=838
    echo    'Loading initial ramdisk ...'
    module    --nounzip   /boot/initrd-4.19.5-1-default
....

I have the feeling that this service has not been updated for this new situation :frowning:

Should I open a bug report?
I can still remove the old kernels via Yast or rpm but I prefer that it occurs automatically

Many thanks in advance
Philippe

That might be a good idea.

I can still remove the old kernels via Yast or rpm but I prefer that it occurs automatically

Can you run the “purge-kernels” command as root? That might be easier than using Yast.

Really?
Although I don’t ordinarily run Xen so don’t keep up on it on a day to day basis, I try to be aware of major changes and AFAIK Xen still today as always compiles and runs its own kernel… It is not integrated into the default kernel.

Also looks like there is plenty of activity within the past days and months
https://build.opensuse.org/project/show/openSUSE%3AFactory

TSU

@phil524
Your comment made me do an impromptu investigation about what I could find, if anything substantive had changed about how the Xen Dom0 kernel is built and distributed

As always,
The original Xen documentation is pretty good…

https://wiki.xenproject.org/wiki/Xen_Project_Software_Overview

After studying the above in detail (there are some new DomU developments in the last year that are noteworthy), I don’t see anything relating to Dom0 that’s changed significantly. There are plenty of new articles that describe how to build a Dom0 kernel based on the mainline vanilla kernel but for the most part the process and procedures haven’t changed much since approx 2011.

That leads me to believe that unless some momentous decision was made by openSUSE maintainers to distribute the Dom0 kernel and hypervisor differently on their own, there is nothing upstream I found that would have made a change more likely in at least the past year.
But, there seems to have always been a possibility that the Xen kernel could be compiled on the fly instead of being pre-built the way we’ve always seen in openSUSE.

I’d wonder if you really don’t have any Xen-specific GRUB entries, and what you would see if you search for all Xen packages on your machine.
And, if you want the real scoop, practically all the Xen Maintainers frequent the Virtualization mail list before you file a bug report… I don’t know how often they frequent this Forum.

Also,
I assume your HostOS is openSUSE, did you install Xen using the YaST “Install Virtualization” module or some other way?

HtH,
TSU

Hello,

My tumbleweed system is the dom0 system.
I installed this system in 2015 with both default and xen kernels and configured one VM via Yast.
in 2016 there was a change and the xen Kernel disappear even if the entry in grub is still present ( see the xen entry above);
Here a comment about this change: https://www.suse.com/c/happened-kernel-xen/

Regards
Philippe

OK, thx.
I now remember that a few years ago there was some kind of much-discussed delay change to the Xen kernel for which I can’t remember the exact details, and this might have been the change.

With a little bit of searching, the precise TW release that removed xen-kernel was 20151218.
In fact, the following discussion might be relevant to your problem, it looks like the Developers’ focus was in upgrading and not removing.

http://opensuse.14.x6.nabble.com/Use-pvops-enabled-kernel-for-Xen-fate-315712-td5048277.html#a5050561

So,
I wonder how you might still have an old xen-pattern after all this time.
Maybe a thorough cleaning out of your rpm cache followed by a rebuild would solve your problem…

Should work

zypper clean -all

But sometimes not. When the above doesn’t work, the following is more destructive (that last parameter is a zero denoting not to save any versions of your cached packages)

rpmcache -D 0

Then, follow that up with a zypper ref and zypper dup…

TSU

Hello Tsu

I did a zypper refresh --all but running purge-kernels as root give the same problem

# purge-kernels
error: Failed dependencies:
        kernel-xen is needed by (installed) patterns-server-xen_server-20180718-1.1.x86_64
        kernel-xen is needed by (installed) patterns-server-xen_server-20180718-1.1.x86_64
        kernel-xen is needed by (installed) patterns-server-xen_server-20180718-1.1.x86_64
        kernel-xen is needed by (installed) patterns-server-xen_server-20180718-1.1.x86_64
/sbin/purge-kernels: giving up.

i’ll try the rpmcache later.

Regards
Philippe

Hello,

I found this bug about purge-kernels but for Leap 15

Bug 1117086 -       Automatic cleanup of old kernels not working 
[https://bugzilla.opensuse.org/show_bug.cgi?id=1117086](https://bugzilla.opensuse.org/show_bug.cgi?id=1117086)

nothing related therein to xen kernels but i saw this only when starting purge-kernels via systemctl

Regards
Philippe

I doubt that bug relates to your issue, the person who submitted that bug hasn’t posted any specific error displayed, only says that purge=kernels "refused to run, but is based only on the result (there is no way to know if purge-kernels even ran).

I also do not see any problems on my own personal LEAP 15, so am not seeing whatever is being reported in that bug, and I don’t know that person also posted anything useful, only his configuration.

In your case though… It seems that your problem is supposed to be directly related to a faulty xen-pattern which appears to be what existed prior to December 2015. If this was a package instead of a pattern, I might suggest simply uninstalling the package but with a pattern I don’t know that’s easily done without executing the uninstall of the pattern contents.

That’s why I’m suggesting cleaning out all the package metadata instead with the hopes that when re-built, you should acquire the newer, updated version of xen-pattern.

Good Luck,
TSU

There is no such requirement in pattern xen_server in current TW (it was removed in year 2015). Show “rpm -qi patterns-server-xen_server”, “rpm -q --requires patterns-server-xen_server”, “rpm -q --whatprovides kernel-xen”.

Hello

Here the outputs

# rpm -qi patterns-server-xen_server
Name        : patterns-server-xen_server
Version     : 20180718
Release     : 1.1
Architecture: x86_64
Install Date: Mon Oct  8 20:56:19 2018
Group       : Metapackages
Size        : 56
License     : MIT
Signature   : RSA/SHA256, Thu Oct  4 19:09:57 2018, Key ID b88b2fd43dbdc284
Source RPM  : patterns-server-20180718-1.1.src.rpm
Build Date  : Thu Oct  4 19:09:24 2018
Build Host  : cloud117
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : https://github.com/openSUSE/patterns
Summary     : Xen Virtual Machine Host Server
Description :
Software to set up a server for configuring, managing, and monitoring virtual machines on a single physical machine.
Distribution: openSUSE Tumbleweed

hpprol2:/ # rpm -q --requires patterns-server-xen_server
kernel-xen
pattern() = basesystem
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
tftp
xen
xen-libs
xen-tools

hpprol2:/ # rpm -q --whatprovides kernel-xen
hpprol2:/ #

I checked the installed versions

rpm -q -i tftp xen xen-tools xen-libs          
Name        : tftp
Version     : 5.2
Release     : 17.1
Architecture: x86_64
Install Date: Wed Jul 18 11:42:28 2018
Group       : Productivity/Networking/Ftp/Clients
Size        : 90393
License     : BSD-3-Clause
Signature   : RSA/SHA256, Fri Jul 13 10:27:16 2018, Key ID b88b2fd43dbdc284
Source RPM  : tftp-5.2-17.1.src.rpm
Build Date  : Fri Jul 13 10:27:09 2018
Build Host  : lamb27
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.kernel.org/pub/software/network/tftp/
Summary     : Trivial File Transfer Protocol (TFTP)
Description :
The Trivial File Transfer Protocol (TFTP) is normally used only for
booting diskless workstations and for getting or saving network
component configuration files.
Distribution: openSUSE Tumbleweed

Name        : xen
Version     : 4.11.0_09
Release     : 3.1
Architecture: x86_64
Install Date: Wed Dec  5 15:02:12 2018
Group       : System/Kernel
Size        : 65694523
License     : GPL-2.0
Signature   : RSA/SHA256, Mon Dec  3 11:21:28 2018, Key ID b88b2fd43dbdc284
Source RPM  : xen-4.11.0_09-3.1.src.rpm
Build Date  : Mon Dec  3 11:19:53 2018
Build Host  : cloud124
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
Summary     : Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
Description :
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the Xen Hypervisor. (tm)
[Hypervisor is a trademark of IBM]
Distribution: openSUSE Tumbleweed

Name        : xen-tools
Version     : 4.11.0_09
Release     : 3.1
Architecture: x86_64
Install Date: Wed Dec  5 15:03:47 2018
Group       : System/Kernel
Size        : 5650384
License     : GPL-2.0
Signature   : RSA/SHA256, Mon Dec  3 11:21:29 2018, Key ID b88b2fd43dbdc284
Source RPM  : xen-4.11.0_09-3.1.src.rpm
Build Date  : Mon Dec  3 11:19:53 2018
Build Host  : cloud124
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
Summary     : Xen Virtualization: Control tools for domain 0
Description :
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the control tools that allow you to start, stop,
migrate, and manage virtual machines.
In addition to this package you need to install kernel-xen, xen and
xen-libs to use Xen.
Authors:
--------
    Ian Pratt <ian.pratt@cl.cam.ac.uk>
Distribution: openSUSE Tumbleweed

Name        : xen-libs
Version     : 4.11.0_09
Release     : 3.1
Architecture: x86_64
Install Date: Wed Dec  5 15:03:43 2018
Group       : System/Kernel
Size        : 1701680
License     : GPL-2.0
Signature   : RSA/SHA256, Mon Dec  3 11:21:29 2018, Key ID b88b2fd43dbdc284
Source RPM  : xen-4.11.0_09-3.1.src.rpm
Build Date  : Mon Dec  3 11:19:53 2018
Build Host  : cloud124
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
Summary     : Xen Virtualization: Libraries
Description :
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the libraries used to interact with the Xen
virtual machine monitor.
In addition to this package you need to install kernel-xen, xen and
xen-tools to use Xen.
Authors:
--------
    Ian Pratt <ian.pratt@cl.cam.ac.uk>
Distribution: openSUSE Tumbleweed

Erroneous requirements for kernel-xen?

Regards

Looks like it. It was apparently re-introduced recently by large SLE merge request. Open bug report.