Frequently Asked Question
Thin Pool Space Protection
QUESTION (short title): Thin Pool Space Protection
QUESTION (detail): Explain thin pools, the message below and how to configure protection
WARNING: You have not turned on protection against thin pools running out of space. WARNING: Set activation/thinpoolautoextend_threshold below 100 to trigger automatic extension of thin pools before they get full. Logical volume vm-104-fleece-0 created. WARNING: Sum of all thin volume sizes
What is a Thin Pool?
A thin pool in LVM (Logical Volume Manager) is a storage mechanism that allows you to create logical volumes (LVs) on-demand, using only the actual space they consume rather than reserving it upfront. This is commonly used in virtualisation environments like Proxmox, where virtual machines (VMs) are stored as thin-provisioned volumes.
- Thin provisioning saves disk space by allocating storage only when data is written.
- The thin pool acts as a container for all thin volumes (e.g., VM disks).
- It uses a metadata area to track which blocks are used and which are free.
- If the thin pool runs out of space, even if the underlying physical storage has free space, new VMs or disk expansions will fail.
Understanding the Warning Messages
The warnings you're seeing are critical and indicate a lack of automatic protection for your thin pool:
- "You have not turned on protection against thin pools running out of space."
This means no safeguards are in place to prevent the thin pool from becoming full.
- "Set activation/thinpoolautoextend_threshold below 100 to trigger automatic extension..."
This refers to a configuration setting that allows the system to automatically extend the thin pool when it reaches a certain threshold (e.g., 80% or 90%). Without this, the pool will not grow automatically when nearing capacity.
- "Sum of all thin volume sizes"
This suggests that the total size of all thin volumes (e.g., VM disks) is approaching or exceeding the available space in the thin pool. This can lead to failure when trying to create new VMs or expand existing ones.
Why This Is a Risk
- If the thin pool fills up, new VMs cannot be created, and existing VMs may fail to start or experience I/O errors.
- Manual intervention is required to resize the thin pool, which can be time-consuming and disruptive.
- Without automatic extension, you risk service outages during peak usage.
How to Configure Protection
To prevent thin pool exhaustion, you must enable automatic extension and set a threshold at which the pool will grow. Follow these steps:
1. Check Current Thin Pool Configuration
Run the following command to view your current thin pool settings:
lvs -o +thin_pool_autoextend_threshold
Look for the thinpoolautoextend_threshold field. If it’s not set or is 100, automatic extension is disabled.
2. Set the Auto-Extend Threshold
Use the lvchange command to set a threshold (e.g., 80%) below which the thin pool will automatically extend:
lvchange --autoextend_threshold 80 /dev/poolname/thinpool
Replace /dev/poolname/thinpool with the actual path to your thin pool (e.g., /dev/pve/thinpool).
✅ Best Practice: Set the threshold to 80% or 85% to allow sufficient time for automatic expansion before the pool fills.
3. Enable Automatic Extension
Ensure that automatic extension is enabled:
lvchange --autobackfill y /dev/poolname/thinpool
This ensures that when the pool is extended, the metadata is properly updated.
4. Verify the Settings
Check that the configuration has been applied:
lvs -o +thin_pool_autoextend_threshold /dev/poolname/thinpool
You should see a value less than 100 (e.g., 80).
5. Monitor Thin Pool Usage
Use the following command to monitor current usage:
lvs -o +lv_size,lv_free,lv_data_percent,lv_metadata_percent
Look for:
lvdatapercent– percentage of thin pool used by thin volumes.lvmetadatapercent– percentage of metadata used.
If either exceeds 80%, take action.
6. Set Up Monitoring Alerts
Configure alerts using tools like:
- Zabbix
- Nagios
- Prometheus + Grafana
Monitor:
- Thin pool usage (
lvdatapercent) - Free space in the thin pool (
lv_free) - Automatic extension events
Set thresholds to alert at 70% usage.
7. Consider Using a Thick Volume Instead
As noted in [FAQ #226], LVM Thin can be a support nightmare. If you're using Proxmox or similar, consider replacing the thin pool with a thick (pre-allocated) volume:
- Pros: More predictable performance, less risk of failure.
- Cons: Wastes space if not fully utilised.
To do this:
- Create a new volume group (VG) with thick volumes.
- Migrate VMs from thin pool to thick volume.
- Use standard filesystems (e.g., ext4, xfs) for better control.
Additional Recommendations
- Regularly check thin pool health using
lvsandpvs. - Avoid over-provisioning – ensure the thin pool size is sufficient for expected growth.
- Use snapshots sparingly – they consume metadata space and can contribute to pool exhaustion.
- Schedule maintenance windows to manually extend the thin pool if automatic extension fails.
Summary
| Action | Command |
|---|---|
| Check current autoextend threshold | lvs -o +thinpoolautoextend_threshold |
| Set autoextend threshold to 80% | lvchange --autoextend_threshold 80 /dev/poolname/thinpool |
| Enable automatic extension | lvchange --autobackfill y /dev/poolname/thinpool |
| Monitor usage | lvs -o +lvsize,lvfree,lvdatapercent |
| Set alerts | Use monitoring tools to alert at 70–80% usage |
???? Final Note: Always test changes in a non-production environment first. If you're unsure about modifying LVM settings, contact your IT support team for assistance.
If you need help identifying your thin pool name or configuring alerts, please provide the output of:
pvs
lvs
and we can assist further.
