Restore Longhorn System
- What does the Longhorn system restore rollout to the cluster
- What are the limitations
- How to restore from Longhorn system backup
- How to delete Longhorn system restore
- How to restart Longhorn System Restore
- What settings are configurable
- How to troubleshoot
- History
Longhorn System Restore Rollouts
- Longhorn restores the resource from the Longhorn System Backup Bundle.
- Longhorn does not restore existing
Volumes
and their associatedPersistentVolume
andPersistentVolumeClaim
. - Longhorn automatically restores a
Volume
from its latest backup. - To prevent overwriting eligible settings, Longhorn does not restore the
ConfigMap/longhorn-default-setting
. - Longhorn does not restore configurable settings.
Limitations
Restore Path
Longhorn does not support cross-major/minor version system restore except for upgrade failures, ex: 1.4.x -> 1.5.
Create Longhorn System Restore
You can restore the Longhorn system using Longhorn UI. Or with the kubectl
command.
Prerequisite
A running Longhorn cluster for Longhorn to roll out the resources in the system backup bundle.
Set up the
Nodes
and disk tags forStorageClass
.Have a Longhorn system backup.
See Backup Longhorn System - Create Longhorn System Backup for instructions.
Have volume
BackingImages
available in the cluster.In case of the
BackingImage
absence, Longhorn will skip the restoration for thatVolume
and itsPersistentVolume
andPersistentVolumeClaim
.All existing
Volumes
are detached.
Using Longhorn UI
- Go to the
System Backup
page in theSetting
. - Select a system backup to restore.
- Click
Restore
in theOperation
drop-down menu. - Give a
Name
for the system restore. - The system restore starts and show the
Completed
state when done.
Using kubectl
Command
Find the Longhorn
SystemBackup
to restore.> kubectl -n longhorn-system get systembackup
NAME VERSION STATE CREATED
demo v1.4.0 Ready 2022-11-24T04:23:24Z
demo-2 v1.4.0 Ready 2022-11-24T05:00:59Z
Execute
kubectl create
to create a LonghornSystemRestore
of theSystemBackup
.apiVersion: longhorn.io/v1beta2
kind: SystemRestore
metadata:
name: restore-demo
namespace: longhorn-system
spec:
systemBackup: demo
The system restore starts.
The
SystemRestore
change to stateCompleted
when done.> kubectl -n longhorn-system get systemrestore
NAME STATE AGE
restore-demo Completed 59s
Delete Longhorn System Restore
Warning: Deleting the SystemRestore also deletes the associated job and will abort the remaining resource rollouts. You can Restart the Longhorn System Restore to roll out the remaining resources.
You can abort or remove a completed Longhorn system restore using Longhorn UI. Or with the kubectl
command.
Using Longhorn UI
- Go to the
System Backup
page in theSetting
. - Delete a single system restore in the
Operation
drop-down menu next to the system restore. Or delete in batch with theDelete
button.
Using kubectl
Command
Execute
kubectl delete
to delete a LonghornSystemRestore
.> kubectl -n longhorn-system get systemrestore
NAME STATE AGE
restore-demo Completed 2m37s
> kubectl -n longhorn-system delete systemrestore/restore-demo
systemrestore.longhorn.io "restore-demo" deleted
Restart Longhorn System Restore
- Delete Longhorn System Restore that is in progress.
- Create Longhorn System Restore.
Configurable Settings
Some settings are excluded as configurable before the Longhorn system restore.
- Concurrent volume backup restore per node limit
- Concurrent replica rebuild per node limit
- Backup Target
- Backup Target Credential Secret
Troubleshoot
System Restore Hangs
- Check the longhorn-system-rollout Pod log for any errors.
> kubectl -n longhorn-system logs --selector=job-name=longhorn-system-rollout-<SYSTEM-RESTORE-NAME>
- Resolve if the issue is identifiable, ex: remove the problematic restoring resource.
- Restart the Longhorn system restore.
History
Available since v1.4.0
© 2019-2023 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2023 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.