Repository navigation
Move application volumes to an additional disk with volumectl #8259
Description
Since NethServer 8.7, an application volume can be placed on an additional disk, but only when the application is installed, restored or cloned. When an installed application grows and fills the root disk, the only way to move its data to a new disk is to clone the application and remove the old one, which takes a long time, needs twice the space, and changes the application name.
Proposed solution
Add a volumectl subcommand that moves the data of one volume of an installed application to another base path in two steps, sync and finalize, to keep the downtime short. For example (subcommand names to be aligned with the existing add-volume and remove-volume):
volumectl move-volume dovecot-data --for mail1 --target /mnt/disk00
volumectl move-volume dovecot-data --for mail1 --target /mnt/disk00 --finalize
- Sync copies the volume data to the target, while the application keeps running. It preserves ownership, permissions, SELinux labels and extended attributes, and shows progress, because the first copy can take hours. It can be repeated as many times as wanted: each run copies only what changed since the previous one.
- Finalize stops the application services, runs a last sync, recreates the volume at the new location, updates
/etc/nethserver/volumes.confso the assignment survives later operations, and starts the services again. It is the only step with downtime, usually short when a sync ran just before.
The command also:
- checks that the target base path exists and has enough free space for the volume data
- leaves the original data untouched until finalize completes, and can move a volume back to the root disk
Alternative solutions
- Clone the application to the same node, choosing the additional disk, then remove the original: works today, but changes the application name and needs twice the space.
- A UI action: can come later, once the command is reliable.
Additional context
The admin manual must describe the procedure, including when to run the sync steps and the expected downtime of finalize. The draft "Disk usage and size of applications" would help choose which volume to move.
See also
- Assign specific app volumes to dedicated storage: Assign specific app volumes to dedicated storage #7665
- Developer manual, volumes: https://nethserver.github.io/ns8-core/modules/volumes/
- Discussion https://mattermost.nethesis.it/nethesis/pl/z1xcei4sqtd6mr3agkkhayxysr
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsToDo
Activity
[-]Move named volume data to a new disk[/-][+]Move application volumes to an additional disk with volumectl[/+]