Disk auto-extend
A full root disk takes a server down in odd ways: databases stop writing, logs vanish, packages fail to install. Auto-extend watches how full / is and, at the threshold you set, grows the disk together with the partition and the filesystem inside. The server keeps running, there is no reboot.
What it needs
- A server created from our OS templates. Servers installed from your own ISO are not supported.
- The guest agent and Monitoring switched on. Auto-extend reads disk space from the agent and grows the filesystem through it.
- The root filesystem on a plain partition, with ext4, xfs or btrfs. That is how every template is laid out. LVM and software RAID are not supported.
Only the root disk grows. Extra volumes attached to the server are not touched.
How to turn it on
- Create wizard, disk step. It is on by default. If you pick the largest disk the account allows, it switches off, there is nothing left to grow into.
- Server page, Overview, under Agent & monitoring. Switch it on or change the settings at any time.
- API. The
autoextendobject in the create request, orPUT /api/v1/vms/{id}/autoextendlater. See the API Reference.
Servers created through the API or Terraform without the autoextend object have it off.
Settings
| Setting | Meaning | Default |
|---|---|---|
| When used space reaches | How full / gets before it grows, 50 to 95% | 85% |
| Grow by | Share of the current disk size: 10, 20, 30 or 50% | 10% |
| Up to | The disk never grows past this size. It cannot be lower than the current disk | Twice the disk size, within your account limit |
The step is a share of the disk because a fixed size does not scale. 10 GB is a lot for a 25 GB disk and nothing for a 1 TB one. Each step is rounded to 5 GB and is at least 5 GB:
| Disk | Grow by | Step |
|---|---|---|
| 25 GB | 10% | 5 GB |
| 100 GB | 10% | 10 GB |
| 250 GB | 20% | 50 GB |
| 812 GB | 10% | 80 GB |
The last step before the maximum is cut to fit, the disk stops exactly at Up to.
How a grow goes
- Once a minute we look at how full
/is, from the guest agent. A stopped server or one without fresh agent data is skipped. - At the threshold we grow the disk by one step. The server stays online.
- Through the guest agent we grow the root partition with
growpart, then the filesystem withresize2fs,xfs_growfsorbtrfs. - We wait until the agent reports
/at the new size. It has 10 minutes for that. - You get a message with the old and new size and how full
/is now.
Two grows of one server are at least 10 minutes apart, so a single step can settle. A disk that is 98% full or more skips that pause, the server is failing to write right now. Growing works on a disk that is already 100% full.
Limits
A disk never grows past the smallest of three sizes:
- Up to from the settings;
- the disk size limit of your account;
- 100 GB on trial accounts.
Reaching the limit while / is still above the threshold stops auto-extend, see below. Raise Up to and save to let it grow further.
When it stops
Auto-extend does not retry after a failure. A retry loop on a broken server would keep adding disk you pay for. It stops, tells you why, and waits for you.
| Reason | The disk |
|---|---|
| The disk reached its limit | Stays as it is |
| The disk resize failed or did not finish in 30 minutes | Stays at the old size |
The partition or filesystem inside could not grow: LVM or RAID, another filesystem, growpart or the filesystem tool missing, no answer from the guest agent | Is already bigger, / is not |
/ still shows the old size 10 minutes after the grow | Is already bigger, / is not |
The reason is in the message and on the server's Overview. Fix the cause, then save the auto-extend settings again, and it goes back to watching the disk. While a grow is in progress the settings cannot be saved.
When the disk grew but / did not, you can finish by hand. On a plain partition:
sudo growpart /dev/sda 1 # disk and partition number of /
sudo resize2fs /dev/sda1 # ext4
sudo xfs_growfs / # xfs
On LVM grow the partition, then the physical volume and the logical volume:
sudo growpart /dev/sda 3
sudo pvresize /dev/sda3
sudo lvextend -r -l +100%FREE /dev/mapper/vg-root
Check the real names with lsblk first.
Messages
Every grow and every stop sends a message. It goes to Telegram for everyone in the account who linked @serverscamp_bot with Servers notifications on, and to the account owner's email when nobody did.
If a Disk space alert on / is open or just resolved, the grow message is skipped. The alert's Resolved message already says the disk grew, and you get one message instead of two. See Monitoring & alerts.
An account gets at most 6 auto-extend messages an hour and 20 a day. Growing itself is not limited by that.
Billing
A grown disk is billed like any disk of that size, from the moment it grew. Disks do not shrink, so set Up to to a size you are ready to pay for.