Create standalone script to backup master node

Registered by Miroslav Anashkin on 2014-07-07

Feature Lead: M. Anashkin
Mandatory Design Reviewers: M.Mosesohn,
Developers: M.Anashkin?
QA: A. Urlapova, Y. Kotko

Customers often ask for an official way to backup/restore the already installed Fuel Admin node.

I propose to do it with standalone script, which we make available on our web site.
Script should be able to perform the following:

1. Detect master node version and set up depending internal variables properly.

2. Ask if user want to backup or to restore master node.

3. Create backup into single tarball.

4. Restore the master node settings from given backup tarball.

5. Optional. Compress/decompress the backup tarball on the fly.

6. Optional. Create/Embed/Check md5 or sha check sum or use compression formats with built-in check sum to be sure of archive integrity.

7.Optional. Check for the necessary free space before every operation. Stop and ask the user if there is less than some free space limit left on target device.

8. Optional. Ask the user which components to backup.

9. Optional. Also backup/restore the logs or restore the log directory structure only.

10. Optional. Automatically restore master node to the previous state if restore operation failed.

One may use the following procedure as a start point:

1. Write down all non-default master node settings you might did on initial master node configuration.

2. Back up your /var/lib fuel node directory.

3. Back up your /etc/ directory.

4. Back up your /root directory.

5. Dump postgres nailgun database.

Here is the easiest way to dump database:
a) Create diagnostic snapshot from support tab in fuel.
b) Untar the snapshot.
c) Go to localhost/pg_dump in the snapshot.
d) localhost_nailgun.sql is your database backup.

To restore use the following procedure:
1. Install new master node. Make the same custom settings during initial master node configuration as were on previously deployed master node. I mean these settings on red-colored prompt.
2. Restore necessary config files from /etc/ and /root.
3. Restore /var/lib
4. Restore database:

take localhost_nailgun.sql. Place it near apply.sh script on fuel master node. Run apply.sh.

#!/bin/bash

sudo -u postgres psql nailgun -S -c 'drop schema public cascade; create schema public;'
sudo -u postgres psql nailgun < localhost_nailgun.sql

Blueprint information

Status:
Complete
Approver:
Vladimir Kuklin
Priority:
High
Drafter:
Oleg S. Gelbukh
Direction:
Approved
Assignee:
Sergey Abramov
Definition:
Approved
Series goal:
Accepted for 8.0.x
Implementation:
Implemented
Milestone target:
milestone icon 8.0
Started by
Oleg S. Gelbukh on 2016-01-13
Completed by
Oleg S. Gelbukh on 2016-03-24

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/create-standalone-script-to-backup-masternode,n,z

Addressed by: https://review.openstack.org/267086
    Add backup command fuel admin node command

Addressed by: https://review.openstack.org/267702
    add restore admin node tool

Addressed by: https://review.openstack.org/271355
    Add fuel admin node backup tool

Addressed by: https://review.openstack.org/271356
    Add fuel admin node backup tool

Addressed by: https://review.openstack.org/275565
    Add restore admin node tool

Addressed by: https://review.openstack.org/275571
    Add restore admin node tool

Addressed by: https://review.openstack.org/275609
    Change names of backup and restore commands according to spec

Gerrit topic: https://review.openstack.org/#q,topic:bug/1538064,n,z

Addressed by: https://review.openstack.org/276094
    Change names of backup and restore commands according to spec

Addressed by: https://review.openstack.org/277332
    Change names of backup and restore commands according to spec

Addressed by: https://review.openstack.org/277916
    Remove redundant database sync action

Gerrit topic: https://review.openstack.org/#q,topic:277377,n,z

Addressed by: https://review.openstack.org/277377
    Run 'puppet apply' command at host

Addressed by: https://review.openstack.org/279437
    Remove redundant database sync action

Addressed by: https://review.openstack.org/279438
    Remove redundant database sync action

Addressed by: https://review.openstack.org/279478
    Run 'puppet apply' command at host

Addressed by: https://review.openstack.org/279479
    Run 'puppet apply' command at host

Addressed by: https://review.openstack.org/297094
    Remove unsupported commands

Addressed by: https://review.openstack.org/300514
    Delete unsupported commands and helpers

Addressed by: https://review.openstack.org/301022
    Extract puppet modules patching into utils

Addressed by: https://review.openstack.org/303451
    Move puppet modules patch function to utils

Addressed by: https://review.openstack.org/304156
    Move puppet modules patch function to utils

Addressed by: https://review.openstack.org/332931
    Merge master into stable/mitaka`

(?)

Work Items

Work items:
Backup tarball: DONE
Backup mirrors: DONE
Restore configs: DONE
Restore DB: DONE
Documentation: TODO

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.