lae / ansible-role-proxmox

IaC for Proxmox VE clusters.
MIT License
468 stars 139 forks source link

Removing old kernels attempts to uninstall PVE completely when Linux 6.2 is installed #223

Open agross opened 1 year ago

agross commented 1 year ago

I installed pve-kernel-6.2 on Proxmox 7.4 as per https://forum.proxmox.com/threads/opt-in-linux-6-2-kernel-for-proxmox-ve-7-x-available.124189/

After rerunning the role this happened:

TASK [lae.proxmox : Remove old Debian/PVE kernels] ******************************************************************************************************
fatal: [proxmox]: FAILED! => changed=false
  msg: |-
    'apt-get remove 'pve-kernel-5.15.107-1-pve'' failed: E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (1)
    E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
  rc: 100
  stderr: |-
    E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (1)
    E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
  stderr_lines: <omitted>
  stdout: |-
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following package was automatically installed and is no longer required:
      proxmox-kernel-helper
    Use 'sudo apt autoremove' to remove it.
    The following packages will be REMOVED:
      proxmox-ve* pve-kernel-5.15* pve-kernel-5.15.107-1-pve*
    W: (pve-apt-hook) !! WARNING !!
    W: (pve-apt-hook) You are attempting to remove the meta-package 'proxmox-ve'!
    W: (pve-apt-hook)
    W: (pve-apt-hook) If you really want to permanently remove 'proxmox-ve' from your system, run the following command
    W: (pve-apt-hook)       touch '/please-remove-proxmox-ve'
    W: (pve-apt-hook) run apt purge proxmox-ve to remove the meta-package
    W: (pve-apt-hook) and repeat your apt invocation.
    W: (pve-apt-hook)
    W: (pve-apt-hook) If you are unsure why 'proxmox-ve' would be removed, please verify
    W: (pve-apt-hook)       - your APT repository settings
    W: (pve-apt-hook)       - that you are using 'apt full-upgrade' to upgrade your system
    0 upgraded, 0 newly installed, 3 to remove and 49 not upgraded.
    After this operation, 400 MB disk space will be freed.
  stdout_lines: <omitted>
lae commented 1 year ago

Please set the pve_remove_old_kernels role variable to false for the time being, and ensure that you have enough disk space in /boot if you use a separate partition for it.

This was brought up on Discord a few days ago but I haven't yet thought up a solution about how to handle this situation.

agross commented 1 year ago

Yes, setting the flag works around the issue. I'm glad that there is this warning in place!