Working with snapshots and groups

Snapshots and groups can be used to help prepare your environment for recovery. A snapshot allows for a complete copy of a volume at a point in time to be created. There are two types of groups that work in the same way: consistency groups and generic groups. However, consistency groups have been deprecated and support will be removed in a future release. Consistency groups and generic groups allow the volume driver to snapshot a group of volumes at one point in time. This allows you to produce a set of volumes with consistent data that could be used to restore the data in a virtual machine to a known point in time.

Users with the Administrator or Storage manager role can create snapshots and groups. Before creating a group, ensure that your environment is properly prepared:

  • The volumes must all reside on the same backend storage controller. However, the volumes can be attached to different virtual machines.
  • The volumes must be in Available or In-use state.
  • The volume cannot be attached. If you want to add an attached volume to a group, you must detach it first.
  • If the virtual machine that is using a volume has data cached in memory buffers, that data will not be included in the snapshot. Therefore, the application is required to flush data to disk before starting the snapshots to get a true record of the current state.
Important: When PowerVC is installed, a default generic group called default_cgsnapshot_type is created.

Follow these steps to create a consistency group and take a snapshot of it:

  1. Create the group by using one of the Block Storage (Cinder) consistency group or generic volume group API. In the examples below, the user ID and project ID are optional:
    • Create a new consistency group. You must specify the appropriate storage template (called volume type in OpenStack). For example:
      POST- https://198.51.100.0/powervc/openstack/volume/v2/921bfb1f99be49e8b4cd68b7da813201/consistencygroups
      
      {
          "consistencygroup": {
              "name": "secondcg",
              "description": "second consistency group",
              "volume_types": "SVC188 base template",
              "user_id": "0688b01e6439ca32d698d20789d52169126fb41fb1a4ddfacebb97d854e836c9",
              "project_id": "921bfb1f99be49e8b4cd68b7da813201",
              "status": "creating"
          }
      } 
    • Create a new generic group by creating the group type and then using that group type to create the group.
      For example:
      POST   https://192.0.2.0:9000/v3/2f0d1200294a4a8a8e00f1b4799fc0b5/group_types
      
      {
          "group_type": {
              "name": "group_type1",
              "description": "group type 1",
              "is_public": "True",
              "group_specs": {
                  "consistent_group_snapshot_enabled": "<is> False"
              }
          }
      }
      POST   https://192.0.2.0:9000/v3/2f0d1200294a4a8a8e00f1b4799fc0b5/groups
      
      {
          "group": {
              "name": "group1",
              "description": "first group",
              "group_type": "4ec0b103-89d9-4cee-8dfc-36daa2cdde09",
              "volume_types": [
                  "93b4c305-f151-4aad-8a0c-78b05346159b"
              ]
          }
      }
    • Create a group based on existing snapshot by specifying the cgsnapshot_id parameter on the Consistency groups API or by specifying the group_snapshot_id on the Groups API.
      Note: This is not supported on IBM Spectrum Scale devices.
      For example:
      POST  https://192.0.2.0:9000/v3/2f0d1200294a4a8a8e00f1b4799fc0b5/groups/action
      
      {
          "create-from-src": {
              "name": "group_clone1",
              "description": "group from snapshot",
              "group_snapshot_id": "81f70c1a-6e36-4272-b5d0-b3e1acb437d6",
              "status": "creating"
          }
      } 
    • Create a group based on existing group by specifying the source_cgid parameter on the Consistency groups API or by specifying the source_snapshot_id on the Groups API .
      Note: This is not supported on EMC VMAX devices or Spectrum Scale devices.
      For example:
      POST  https://192.0.2.0:9000/v3/2f0d1200294a4a8a8e00f1b4799fc0b5/groups/action
      
      {
          "create-from-src": {
              "name": "group_clone1",
              "description": "group from group",
              "source_group_id": "81f70c1a-6e36-4272-b5d0-b3e1acb437d6",
              "status": "creating"
          }
      } 

    For details about using this API, refer to the OpenStack Block Storage API documentation.

  2. To change volumes associated with the group, update the group by using the add_volumes or remove_volumes parameters on the appropriate API. The input for these parameters is a comma separated string of volume IDs.
  3. To take a snapshot of a consistency group, run the create_cg_snapshot API and specify the consistency group's ID. To take a snapshot of a generic group, run the group_snapshots API and specify the group's ID.
    Note: A VNX volume is not a candidate for volume snapshot if it is a member of a group.