[PR #112] [MERGED] Fix storage check to ignore bind mounts in LXC containers (issue #108) #112

Closed
opened 2026-02-26 17:44:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Corsinvest/cv4pve-autosnap/pull/112
Author: @franklupo
Created: 12/24/2025
Status: Merged
Merged: 12/24/2025
Merged by: @franklupo

Base: masterHead: fix/issue-108-ignore-bind-mounts


📝 Commits (1)

  • 84bc604 Fix storage check to ignore bind mounts in LXC containers

📊 Changes

2 files changed (+10 additions, -5 deletions)

View changed files

📝 Directory.Build.props (+1 -1)
📝 src/Corsinvest.ProxmoxVE.AutoSnap.Api/Application.cs (+9 -4)

📄 Description

Summary

Fixed bug #108 where LXC containers with bind mount directories were incorrectly skipped during snapshot creation with the message "Skip VM problem storage space out of 100%".

Problem

After upgrading to Proxmox VE 9, LXC containers configured with bind mount directories (e.g., mp1: /storage1,mp=/storage1) were being skipped during snapshot operations. The storage validation logic was checking ALL disk storage entries, including bind mounts, which are not Proxmox-managed storages and therefore not present in the storagesCheck dictionary.

When a bind mount directory was encountered:

  • TryGetValue returned false (storage not found)
  • validStorage was set to false
  • VM was skipped with "problem storage space" message

Solution

Modified the storage validation logic to:

  • Initialize validStorage = true (optimistic approach)
  • Check only if storage exists in storagesCheck (Proxmox-managed storage)
  • Skip validation for storages not found (bind mounts, external directories)
  • Set validStorage = false only when a Proxmox-managed storage exceeds the space threshold

Why This Is Correct

Snapshots in Proxmox only capture Proxmox-managed storage volumes (ZFS subvolumes, LVM volumes, etc.). Bind mount directories are external filesystem paths that:

  • Are not included in snapshots
  • Do not consume space in Proxmox storage pools
  • Should not prevent snapshot creation

Testing

Containers with configurations like:

rootfs: local-zfs:subvol-100-disk-0,size=8G
mp0: local-zfs:subvol-100-disk-1,mp=/data,size=10G
mp1: /storage1,mp=/storage1

Will now correctly create snapshots, ignoring the /storage1 bind mount during storage space validation.

Fixes #108


🔄 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/Corsinvest/cv4pve-autosnap/pull/112 **Author:** [@franklupo](https://github.com/franklupo) **Created:** 12/24/2025 **Status:** ✅ Merged **Merged:** 12/24/2025 **Merged by:** [@franklupo](https://github.com/franklupo) **Base:** `master` ← **Head:** `fix/issue-108-ignore-bind-mounts` --- ### 📝 Commits (1) - [`84bc604`](https://github.com/Corsinvest/cv4pve-autosnap/commit/84bc604312853e7a7835b5a1d3ecc73b9544acf3) Fix storage check to ignore bind mounts in LXC containers ### 📊 Changes **2 files changed** (+10 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `Directory.Build.props` (+1 -1) 📝 `src/Corsinvest.ProxmoxVE.AutoSnap.Api/Application.cs` (+9 -4) </details> ### 📄 Description ## Summary Fixed bug #108 where LXC containers with bind mount directories were incorrectly skipped during snapshot creation with the message "Skip VM problem storage space out of 100%". ## Problem After upgrading to Proxmox VE 9, LXC containers configured with bind mount directories (e.g., `mp1: /storage1,mp=/storage1`) were being skipped during snapshot operations. The storage validation logic was checking ALL disk storage entries, including bind mounts, which are not Proxmox-managed storages and therefore not present in the `storagesCheck` dictionary. When a bind mount directory was encountered: - `TryGetValue` returned `false` (storage not found) - `validStorage` was set to `false` - VM was skipped with "problem storage space" message ## Solution Modified the storage validation logic to: - Initialize `validStorage = true` (optimistic approach) - Check only if storage exists in `storagesCheck` (Proxmox-managed storage) - Skip validation for storages not found (bind mounts, external directories) - Set `validStorage = false` only when a Proxmox-managed storage exceeds the space threshold ## Why This Is Correct Snapshots in Proxmox only capture Proxmox-managed storage volumes (ZFS subvolumes, LVM volumes, etc.). Bind mount directories are external filesystem paths that: - Are not included in snapshots - Do not consume space in Proxmox storage pools - Should not prevent snapshot creation ## Testing Containers with configurations like: ``` rootfs: local-zfs:subvol-100-disk-0,size=8G mp0: local-zfs:subvol-100-disk-1,mp=/data,size=10G mp1: /storage1,mp=/storage1 ``` Will now correctly create snapshots, ignoring the `/storage1` bind mount during storage space validation. Fixes #108 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:44:28 +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/cv4pve-autosnap#112
No description provided.