Build In Recoverability and Failover through Persistent Instances

Persistent instances provided through HP Cloud Block Storage allow HP Cloud Compute users to build in recoverability and failover of their compute instances. With the ephemeral storage that comes natively with a compute instance, data is deleted once the associated instance is removed. Any hardware failure or termination of an instance subsequently results in data loss unless data is maintained via manual workarounds. With persistent images, on the other hand, data persists even if the instance is shut down or fails. Volumes associated with the instance can be recovered and easily attached to another instance.  

Use Cases 

Customers can use persistent, bootable volumes by in a number of ways: 

  • Test & Development Test and development environments are often shut down or may not need to run constantly. When instances are terminated, data is preserved through storage on the bootable volumes – e.g., configuration files or code changes in the system/applications. In some cases, application data may also be stored in the bootable volume and need to persist. 
  • Failover and Instance Recovery If an instance fails, it can be rebooted along with all the saved state and data in the bootable volume.  
  • Persistent Application DataIn some cases, application data (e.g., low latency databases with concurrent read/writes) may need to be stored in a local bootable volume rather than in object storage or other block storage volumes. In such cases, the application data is persisted when instances fail.  

Creating a Persistent Instance

Persistent instances are created during the initial instance setup. You can either store all your instance data on a block storage volume (persistent) or on server storage (ephemeral). With either setup, you can also take a snapshot of an instance (or volume). In the case of persistent block storage, users mount a persistent virtual storage volume that attaches to an HP Cloud Compute instance exposed as a device within that instance and acts like an unformatted hard drive.  

When you create a persistent instance using the management console, API, or the CLI, a bootable volume is created in block storage that includes all user data resident on the instance. Instead of using ephemeral storage associated with an HP Cloud Compute instance, these volumes run using separate and bootable storage. If your instance terminates, all the data (including boot information) is retained. If your instance is ever lost, you can detach the volume from your lost instance, reattach it to a new instance, and use your bootable volume to recreate an identical new instance. The root file system is persistent and continues to exist allowing the volume to remain available even if an instance terminates. In addition, you can create a file system on top of the bootable volumes and use them just like any block device (similar to how a hard drive is used). Alternatively, a block storage volume can just be used as raw, unstructured storage that runs independently of the compute instance (for data preservation) but that also ties directly to that instance for highly reliable, highly available, and highly predictable storage. 

Using the Management Console or API/CLI 

After setting up a block account, users can create a bootable volume using either the UI (management console) or the API/CLI. 

From the management console:  Simply create an instance and select “Create a new server from a Bootable Volume, using Block Storage” – it will create a bootable volume and boot the instance from that volume. 

From the API/CLI:  The API in the HP Cloud has been extended to support bootable volumes. Deploying persistent instances via the API/CLI can be achieved as follows: 

  1. Create a bootable volume. This process is similar to creating any other persistent storage volume, except that an image ID is specified in the “volume-create” command. When the volume is created, the nova-volumes code pre-initializes the volume with the bootable image from Glance. 
  2. Create a new instance, specifying that your new, bootable volume be used instead of the ephemeral disk. The instance is created with the volume as /dev/vda and is booted from persistent storage. As a result, if you terminate the instance later, the volume lives on. You can then create another instance from the same volume. 

Users can store up to two terabytes of data in bootable volumes through a single persistent instance and can scale to as many elastic instances as needed. The file system adjusts based on the size of the volume required. Since the storage is now decoupled from the traditional compute instance, data is preserved in the event of instance termination or hardware failure. Multiple volumes can also be mounted to the same instance. 

Summary 

When creating an instance in the HP Cloud, you can choose to use the ephemeral server storage associated with an instance or create a persistent block storage volume.

Persistent instances deliver highly reliable, available, and predictable storage volumes since your data persists even after the compute instance terminates. The bootable volume can quickly and easily be reattached to another instance. Persistent instances are particularly useful in test and development environments or where application data needs to be retained, recovered, or extended beyond the life of an ephemeral disk.