[PR #231] [MERGED] set backup=0 on disk if backup==false #328

Closed
opened 2026-02-28 00:41:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/231
Author: @tnyeanderson
Created: 1/24/2023
Status: Merged
Merged: 2/2/2023
Merged by: @mleone87

Base: masterHead: fix-backup-disable


📝 Commits (2)

  • 32ffad4 set backup=0 on disk if backup==false
  • 05f1c47 make the linter happy

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 proxmox/config_qemu.go (+10 -1)

📄 Description

At the moment, backup cannot be disabled with this API.

If proxmox backups have been configured, then the default behavior when backup is not set on a VM disk is to back it up:

Proxmox VE backups are always full backups - containing the VM/CT configuration and all data.

Thus, setting backup=1 is basically redundant, and backup=0 is the actual useful option.

The way that createDeviceParam logic is currently applied, it only explicitly sets a parameter for a truthy boolean value. This means that there is no way to exclude a disk from backup, since setting the backup option to false won't cause the actual backup=0 parameter to be set.

This PR adds the proper logic to allow disks to be excluded from backup. It only sets backup=0 if disk["backup"] == false; it will never set backup=1 on a VM.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/231 **Author:** [@tnyeanderson](https://github.com/tnyeanderson) **Created:** 1/24/2023 **Status:** ✅ Merged **Merged:** 2/2/2023 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `fix-backup-disable` --- ### 📝 Commits (2) - [`32ffad4`](https://github.com/Telmate/proxmox-api-go/commit/32ffad46bf015ca552a0d88299650ce10ea12393) set backup=0 on disk if backup==false - [`05f1c47`](https://github.com/Telmate/proxmox-api-go/commit/05f1c47e7829836a8e1858f31d56a648794a28ab) make the linter happy ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/config_qemu.go` (+10 -1) </details> ### 📄 Description At the moment, backup cannot be disabled with this API. If proxmox backups have been configured, then the default behavior when `backup` is not set on a VM disk [is to back it up](https://pve.proxmox.com/wiki/Backup_and_Restore#vzdump_configuration): >Proxmox VE backups are always full backups - containing the VM/CT configuration and all data. Thus, setting `backup=1` is basically redundant, and `backup=0` is the actual useful option. The way that `createDeviceParam` logic is currently applied, it only explicitly sets a parameter for a truthy boolean value. This means that there is no way to exclude a disk from backup, since setting the backup option to `false` won't cause the actual `backup=0` parameter to be set. This PR adds the proper logic to allow disks to be excluded from backup. It *only* sets `backup=0` if `disk["backup"] == false`; it will never set `backup=1` on a VM. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#328
No description provided.