ProxmoxVE: Big-bang bang update (#333) broke most of my LXC updates

Please verify that you have read and understood the guidelines.

yes

A clear and concise description of the issue.

In #333 the resource checks were changed in a way that now breaks almost all my LXC updates, e.g.:

⚠️  Required: 1 CPU, 1024MB RAM | Current: 1 CPU, 512MB RAM
Please ensure that the Uptime Kuma LXC is configured with at least 1 vCPU and 1024 MB RAM for the build process.

I fine-tuned the resources of my LXC containers to what they actually need, the new resource checks however would require me to:

  1. switch back to default resource values (might not be available on the PVE node)
  2. reboot the container (downtime)
  3. run the update
  4. switch back to chosen values (downtime, again)

Am I holding this wrong? Is there a better way to do the updates?

This only happened after running sed -i 's/tteck\/Proxmox/community-scripts\/ProxmoxVE/g' /usr/bin/update to switch to the new repo (😢). The old update scripts, still work fine, but will be outdated soon enough.

To be honest, I think the previous approach of briefly over-provisioning the container, in case of resource intensive build processes, was perfectly fine. Especially considering the resources were reverted, after install or update, to the chosen/previous values, which makes this effortless for the user.

What settings are you currently utilizing?

  • Default Settings
  • Advanced Settings

Which Linux distribution are you employing?

Debian 12

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

No response

Please provide detailed steps to reproduce the issue.

  1. Adjust the resources on any LXC container, so they deviate from the defaults.
  2. Migrate the update scripts to the new community-scripts repo: sed -i 's/tteck\/Proxmox/community-scripts\/ProxmoxVE/g' /usr/bin/update
  3. run update

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

not pushed yet, i think tomorrow or today evening (GMT)

Do an Example with 2-3 CT.sh and then we take a look.

I can also imagine a rollback mechanism, that would not necessarily incur data loss, by having the old release next to the new one and switching symlinks on them. It’s a pattern I’ve seen quite often in real world projects. Not sure if that’s feasible for all the scripts, since I don’t know all of them (yet). But it’s definitely something i’d be willing to give a try, when I find the time.

Can we do, if there are many issues in the next time because this, we revert

Adding a data loss warning and requiring a full yes in a prompt like this might be acceptable @MickLesk ?

  if [[ "$current_ram" -lt "$var_ram" ]] || [[ "$current_cpu" -lt "$var_cpu" ]]; then
    echo -e "\n⚠️${HOLD} ${GN}Required: ${var_cpu} CPU, ${var_ram}MB RAM ${CL}| ${RD}Current: ${current_cpu} CPU, ${current_ram}MB RAM${CL}"
    echo -e "${YWB}Please ensure that the ${APP} LXC is configured with at least ${var_cpu} vCPU and ${var_ram} MB RAM for the build process.${CL}\n"
    read -r -p "⚠️ May cause data loss! ⚠️ Continue update with under-provisioned LXC? <yes/No>  " prompt  
    # Check if the input is 'yes', otherwise exit with status 1
    if [[ ! ${prompt,,} =~ ^(yes)$ ]]; then
      echo -e "❌${HOLD} ${YWB}Exiting based on user input.${CL}"
      exit 1
    fi
  else
    echo -e ""
  fi