Openstack Cinder backup & Restore

Cinder is the code name for the open source project to develop OpenStack Block Storage, the block-based storage component of the OpenStack platform for cloud computing.

Today we are going to see how to take backup & restore with back end storage either Ceph / LVM

For better lab practice clone devstack along with swift, cinder backup

Step 1:  Clone devstack

git clone https://github.com/openstack-dev/devstack.git

Step 2: Clone localrc contains cinder backup and swift

git clone https://github.com/maestropandy/openstack_localrc.git

Step 3: Copy the localrc from devstack-cinder-backup to devstack

cp localrc.txt devstack/localrc

Step 4: Deploy devstack as non-root user

./stack.sh

Step 5: Source with admin tenant

Source admin admin

Step 6:   Check installed service list, you can see cinder, swift

Step 7:  Run “Cinder service-list”

 

Step 8: Create Volume with 1GB

cinder create –display_name pandi 1

Step 9 : Create  backup

cinder backup-create b7223f13-fd5c-462b-9318-0c47b2a306f1

Step 10 : See the created backup

 cinder backup-list

 

Step 11 : List swift volumes backups will list the created backups from cinder & Restore the backup volumes as per below command

swift list volumebackups | grep 2014c866-5939-494d-ba26-2c78acfd0230

cinder backup-restore 2014c866-5939-494d-ba26-2c78acfd0230

 

See the above screenshocinder list

| ID | Status | Migration Status | Name | Size | Volume Type | Bootable | Multiattach | Attached to |

| b7223f13-fd5c-462b-9318-0c47b2a306f1 | available | – | pandy | 1 | lvmdriver-1 | false | False | |
| fc1c6f25-bde7-4f4b-aca8-05ad70fa1c1c | available | – | restore_backup_2014c866-5939-494d-ba26-2c78acfd0230 | 1 | lvmdriver-1 | false | False | |

Successfully created backup and restored in cinder as above

Here the Cinder.conf file changes under /etc/cinder

backup_swift_url = http://10.0.2.15:8080/v1/AUTH_

default_volume_type = lvmdriver-1

enabled_backends = lvmdriver-1

backup_driver = cinder.backup.drivers.swift

 

 

backup_swift_url = http://localhost:8080/v1/AUTH_
backup_swift_auth = per_user
backup_swift_auth_version = 1
backup_swift_user = <None>
backup_swift_key = <None>
backup_swift_container = volumebackups
backup_swift_object_size = 52428800
backup_swift_retry_attempts = 3
backup_swift_retry_backoff = 2
backup_compression_algorithm = zlib

 

Note: If you are in JUNO use below url, which is later fixed in next versions

backup_swift_url = http://localhost:8080/v1/AUTH_"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s