Blame docs/operations/ci/create_etcd_backup.md

47c289
# Create etcd backup
47c289
This SOP should be followed in the following scenarios:
47c289
47c289
- When the need exists to create an etcd backup. 
47c289
- When shutting a cluster down gracefully.
47c289
47c289
## Steps
47c289
47c289
1. Connect to a master node
47c289
47c289
```
47c289
oc debug node/<node_name>
47c289
```
47c289
47c289
2. Chroot to the /host directory on the containers filesystem
47c289
47c289
```
47c289
sh-4.2# chroot /host
47c289
```
47c289
47c289
3. Run the cluster-backup.sh script and pass in the location to save the backup to
47c289
47c289
```
47c289
sh-4.4# /usr/local/bin/cluster-backup.sh /home/core/assets/backup
47c289
```
47c289
47c289
4. Chown the backup files to be owned by user `core` and group `core`
47c289
47c289
```
47c289
chown -R core:core /home/core/assets/backup
47c289
```
47c289
47c289
5. From the admin machine, see inventory group: `ocp-ci-management`, become the Openshift service account, see the inventory hostvars for the host identified in the previous step and note the `ocp_service_account` variable.
47c289
47c289
```
47c289
ssh <host>
47c289
sudo su - <ocp_service_account>
47c289
```
47c289
47c289
6. Copy the files down to the admin machine.
47c289
47c289
```
47c289
scp -i <ssh_key> core@<node_name>:/home/core/assets/backup/* ocp_backups/
47c289
```
47c289
47c289
47c289
### Resources
47c289
47c289
- [1] [Creating an etcd backup](https://docs.openshift.com/container-platform/4.5/backup_and_restore/backing-up-etcd.html#backing-up-etcd-data_backup-etcd)