This cookbook is available at https://github.com/rightscale/rightscale_cookbooks.
This cookbook provides the building blocks for multi-cloud backup/restore support. It leverages RightScale's 1.0 and 1.5 API for performing volume management across multiple clouds.
- The block device tools depend on the
rightscale::install_toolsrecipe. - Requires a virtual machine launched from a RightScale-managed RightImage.
Please see metadata.rb file for the latest dependencies.
- Rackspace requires an instance size of 512MB or larger. An instance size of 256MB is not supported. (w-3947)
- Multiple block devices are not supported on Rackspace.
- Import the latest version of 'Storage Toolbox (Chef)' ServerTemplate into your RightScale account.
- Set up a new deployment. Add a server into the deployment using the toolbox ServerTemplate and launch the server.
- Once the server is operational consider it in a 'pristine state'. Nothing will happen other than installing the tools until you run an operational recipe. You can modify this behavior by cloning the ServerTemplate and changing the list of recipes to run on boot.
- Run the "block_device::setup_block_device" recipe, which attaches storage based on the volume size and number of volumes you have specified. The storage is located in '/mnt/storage1' by default.
- Add your data into /mnt/storage1.
- Run the recipe "block_device::do_primary_backup". This recipe detects what cloud you are on and performs a backup to the local cloud persistence service.
- Enable continuous backups by running the recipe "block_device::setup_continuous_backups". This sets up a cron job.
- You can disable backups at any time by running the "block_device::do_disable_continuous_backups" recipe, which removes the cron job that was performing backups.
- WARNING: The "block_device::do_force_reset" recipe detaches all storage related to your lineage and DESTROYS the volumes! You should only run this recipe if you want to restore your database to a pristine state and do not want to save any of its data. After running the "block_device::do_force_reset" recipe you can then run the "block_device::setup_block_device" or "block_device::do_restore" recipes.
- Start from a pristine state (fresh launch of a new server or using a server that's been reset).
- Run the "block_device::do_restore" recipe.
Mix and match recipes to get the right combination for your deployments.
- Delete the attached volumes and terminate the server. Note: if this script is not used to terminate the server the volumes will persist.
- To set up ephemeral file systems on clouds supporting ephemeral devices,
place the
block_device::setup_ephemeralrecipe in your runlist. - The file system type set up in the ephemeral device can be configured by setting the "Ephemeral File System Type" input. By default, this input is set to 'xfs'. NOTE: On RedHat images, this input is ignored and 'ext3' file system is installed by default (RedHat does not support the 'xfs' file system type).
Multiple block device support is controlled by the
block_device/devices_to_use input. It can be a comma-separated list of
device names or '*' to indicate all devices. By default, there are two available
block devices. Currently, in order to add more block devices you need to
customize the cookbook. Instructions can be found at: Increase the Number of
Block Devices
The volume nicknames are made unique by appending the RightScale instance's uuid to the provided nickname input. In case of "stop/start" operation (supported by instances launched with EBS images), the uuid of the first instance before the "stop" operation is used.
Copyright RightScale, Inc. All rights reserved. All access and use subject to the RightScale Terms of Service available at http://www.rightscale.com/terms.php and, if applicable, other agreements such as a RightScale Master Subscription Agreement.