From efeae0b6d3f8b95c981f151f242fb6a6259f632f Mon Sep 17 00:00:00 2001 From: Tarashish Mishra Date: Mon, 16 Dec 2024 13:16:34 +0530 Subject: [PATCH 1/4] Document how to restore home directories from snapshot --- docs/howto/features/storage-quota.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/howto/features/storage-quota.md b/docs/howto/features/storage-quota.md index 1409c4837..eb48b4dd0 100644 --- a/docs/howto/features/storage-quota.md +++ b/docs/howto/features/storage-quota.md @@ -138,6 +138,34 @@ deployer deploy Once this is deployed, the hub will automatically enforce the storage quota for each user. If a user's home directory exceeds the quota, the user's pod may not be able to start successfully. +## Restoring home directories from EBS snapshots + +On AWS, the EBS volumes used for home directories are backed up using [Data Lifecycle Manager (DLM)](https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-lifecycle.html). This means that we can restore home directories from a snapshot if they are deleted or corrupted. + +To restore a home directory from a snapshot, we need to create a new EBS volume from the snapshot, mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories, and then copy the contents from the restored EBS volume to the NFS home directories volume. + +```{note} +Please follow AWS's guidance for [restoring EBS volumes from a snapshot](https://docs.aws.amazon.com/prescriptive-guidance/latest/backup-recovery/restore.html#restore-files) to create a new EBS volume from the snapshot. +``` + +Once we have created a new EBS volume from the snapshot, we need to mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories. To do this, we need to find the instance ID of the EC2 instance attached to the existing EBS volume. This involves the following steps: + +1. Go to the EBS volumes page in the AWS console +2. Find the volume ID of the existing EBS volume containing the NFS home directories +3. Click on the volume ID and find the instance ID in the "Attached resources" section +4. Once we have the instance ID, we can mount the new EBS volume to the EC2 instance by following the steps outlined in the [Attaching an Amazon EBS volume to an instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) guide. + +Once we have mounted the new EBS volume to the EC2 instance, we can copy the contents from the restored EBS volume to the NFS home directories volume. This can be done by running the following commands on the EC2 instance: + +```bash +# Copy the contents from the restored EBS volume to the NFS home directories volume +rsync -av --info=progress2 +``` + +Once we have copied the contents from the restored EBS volume to the NFS home directories volume, we can delete the EBS volume that was created from the snapshot. + +After the restoration is complete, we should run `terraform plan` to double check that no unintended changes were made to the Terraform state. + ## Troubleshooting ### Checking the NFS server is running properly From a5d60fad753f14efaebfa3634e9b93f63eb740dc Mon Sep 17 00:00:00 2001 From: Tarashish Mishra Date: Mon, 16 Dec 2024 13:18:40 +0530 Subject: [PATCH 2/4] We only have AWS specific documentation for now --- docs/howto/features/storage-quota.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/howto/features/storage-quota.md b/docs/howto/features/storage-quota.md index eb48b4dd0..4ce66c7ca 100644 --- a/docs/howto/features/storage-quota.md +++ b/docs/howto/features/storage-quota.md @@ -140,6 +140,8 @@ Once this is deployed, the hub will automatically enforce the storage quota for ## Restoring home directories from EBS snapshots +### AWS + On AWS, the EBS volumes used for home directories are backed up using [Data Lifecycle Manager (DLM)](https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-lifecycle.html). This means that we can restore home directories from a snapshot if they are deleted or corrupted. To restore a home directory from a snapshot, we need to create a new EBS volume from the snapshot, mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories, and then copy the contents from the restored EBS volume to the NFS home directories volume. From 53f2131bc2e546324dab3570de8099d432ccd0ca Mon Sep 17 00:00:00 2001 From: Tarashish Mishra Date: Mon, 16 Dec 2024 15:54:16 +0530 Subject: [PATCH 3/4] Move the restore documentation to the right section --- docs/howto/features/storage-quota.md | 30 ------------------- .../filesystem-backups/restore-filesystem.md | 28 +++++++++++++++++ 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/docs/howto/features/storage-quota.md b/docs/howto/features/storage-quota.md index 4ce66c7ca..1409c4837 100644 --- a/docs/howto/features/storage-quota.md +++ b/docs/howto/features/storage-quota.md @@ -138,36 +138,6 @@ deployer deploy Once this is deployed, the hub will automatically enforce the storage quota for each user. If a user's home directory exceeds the quota, the user's pod may not be able to start successfully. -## Restoring home directories from EBS snapshots - -### AWS - -On AWS, the EBS volumes used for home directories are backed up using [Data Lifecycle Manager (DLM)](https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-lifecycle.html). This means that we can restore home directories from a snapshot if they are deleted or corrupted. - -To restore a home directory from a snapshot, we need to create a new EBS volume from the snapshot, mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories, and then copy the contents from the restored EBS volume to the NFS home directories volume. - -```{note} -Please follow AWS's guidance for [restoring EBS volumes from a snapshot](https://docs.aws.amazon.com/prescriptive-guidance/latest/backup-recovery/restore.html#restore-files) to create a new EBS volume from the snapshot. -``` - -Once we have created a new EBS volume from the snapshot, we need to mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories. To do this, we need to find the instance ID of the EC2 instance attached to the existing EBS volume. This involves the following steps: - -1. Go to the EBS volumes page in the AWS console -2. Find the volume ID of the existing EBS volume containing the NFS home directories -3. Click on the volume ID and find the instance ID in the "Attached resources" section -4. Once we have the instance ID, we can mount the new EBS volume to the EC2 instance by following the steps outlined in the [Attaching an Amazon EBS volume to an instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) guide. - -Once we have mounted the new EBS volume to the EC2 instance, we can copy the contents from the restored EBS volume to the NFS home directories volume. This can be done by running the following commands on the EC2 instance: - -```bash -# Copy the contents from the restored EBS volume to the NFS home directories volume -rsync -av --info=progress2 -``` - -Once we have copied the contents from the restored EBS volume to the NFS home directories volume, we can delete the EBS volume that was created from the snapshot. - -After the restoration is complete, we should run `terraform plan` to double check that no unintended changes were made to the Terraform state. - ## Troubleshooting ### Checking the NFS server is running properly diff --git a/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md b/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md index 69fa486b2..b995f8546 100644 --- a/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md +++ b/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md @@ -13,6 +13,34 @@ We follow AWS's guidance for [restoring EFS from a recovery point](https://docs. Due to the length of the steps listed in that document, we will not repeat them here. +### Restoring home directories from EBS snapshots + +On AWS, the EBS volumes used for home directories are backed up using [Data Lifecycle Manager (DLM)](https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-lifecycle.html). This means that we can restore home directories from a snapshot if they are deleted or corrupted. + +To restore a home directory from a snapshot, we need to create a new EBS volume from the snapshot, mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories, and then copy the contents from the restored EBS volume to the NFS home directories volume. + +```{note} +Please follow AWS's guidance for [restoring EBS volumes from a snapshot](https://docs.aws.amazon.com/prescriptive-guidance/latest/backup-recovery/restore.html#restore-files) to create a new EBS volume from the snapshot. +``` + +Once we have created a new EBS volume from the snapshot, we need to mount it to the EC2 instance attached to the existing EBS volume containing the NFS home directories. To do this, we need to find the instance ID of the EC2 instance attached to the existing EBS volume. This involves the following steps: + +1. Go to the EBS volumes page in the AWS console +2. Find the volume ID of the existing EBS volume containing the NFS home directories +3. Click on the volume ID and find the instance ID in the "Attached resources" section +4. Once we have the instance ID, we can mount the new EBS volume to the EC2 instance by following the steps outlined in the [Attaching an Amazon EBS volume to an instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) guide. + +Once we have mounted the new EBS volume to the EC2 instance, we can copy the contents from the restored EBS volume to the NFS home directories volume. This can be done by running the following commands on the EC2 instance: + +```bash +# Copy the contents from the restored EBS volume to the NFS home directories volume +rsync -av --info=progress2 +``` + +Once we have copied the contents from the restored EBS volume to the NFS home directories volume, we can delete the EBS volume that was created from the snapshot. + +After the restoration is complete, we should run `terraform plan` to double check that no unintended changes were made to the Terraform state. + (howto:filesystem-backup:restore:gcp)= ## GCP From 987c6c2be206e6fbe78a8e256b99373701e79cab Mon Sep 17 00:00:00 2001 From: Sarah Gibson Date: Mon, 16 Dec 2024 10:48:32 +0000 Subject: [PATCH 4/4] Add an extra sub-heading --- .../filesystem-backups/restore-filesystem.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md b/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md index b995f8546..52e2a1fc2 100644 --- a/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md +++ b/docs/howto/filesystem-management/filesystem-backups/restore-filesystem.md @@ -7,6 +7,8 @@ covers those steps for the cloud providers. (howto:filesystem-backup:restore:aws)= ## AWS +### Restoring home directories from an EFS recovery point + ```{note} We follow AWS's guidance for [restoring EFS from a recovery point](https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-efs.html#efs-restore-console) ```