Restore Longhorn System
Volumes
and their associated PersistentVolume
and PersistentVolumeClaim
.Volume
from its latest backup.ConfigMap/longhorn-default-setting
.Longhorn does not support cross-major/minor version system restore except for upgrade failures, ex: 1.4.x -> 1.5.
You can restore the Longhorn system using Longhorn UI. Or with the kubectl
command.
A running Longhorn cluster for Longhorn to roll out the resources in the system backup bundle.
Set up the Nodes
and disk tags for StorageClass
.
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 that Volume
and its PersistentVolume
and PersistentVolumeClaim
.
All existing Volumes
are detached.
System Backup
page in the Setting
.Restore
in the Operation
drop-down menu.Name
for the system restore.Completed
state when done.kubectl
CommandSystemBackup
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
kubectl create
to create a Longhorn SystemRestore
of the SystemBackup
.apiVersion: longhorn.io/v1beta2
kind: SystemRestore
metadata:
name: restore-demo
namespace: longhorn-system
spec:
systemBackup: demo
SystemRestore
change to state Completed
when done.> kubectl -n longhorn-system get systemrestore
NAME STATE AGE
restore-demo Completed 59s
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.
System Backup
page in the Setting
.Operation
drop-down menu next to the system restore. Or delete in batch with the Delete
button.kubectl
Commandkubectl delete
to delete a Longhorn SystemRestore
.> 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
Some settings are excluded as configurable before the Longhorn system restore.
> kubectl -n longhorn-system logs --selector=job-name=longhorn-system-rollout-<SYSTEM-RESTORE-NAME>
Available since v1.4.0
© 2019-2024 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2024 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.