Consistency Groups¶
InfiniSDK allows creating, adding/removing members and manipulating consistency groups.
Creating Consistency Groups¶
Consistency groups are created just like all InfiniSDK objects, through the create method:
>>> cg = system.cons_groups.create(pool=pool)
Adding and Removing Volumes¶
Use the ConsGroup.add_member() method to add members to a consistency group:
>>> cg.add_member(volume)
Use the ConsGroup.remove_member() method to remove members from a consistency group:
>>> cg.remove_member(volume)
Creating Snapshot Groups¶
You can create a snapshot group from a consistency group through the ConsGroup.create_snapshot() method:
>>> cg.add_member(volume) # snap group creation is not allowed for empty CGs
>>> sg = cg.create_snapshot()
>>> sg.get_parent() == cg
True
Restoring from Snapshot Group¶
Restoring a snapshot group is done with the ConsGroup.restore() method:
>>> cg.restore(sg)
Deleting Consistency Groups¶
Deleting consistency groups is done through ConsGroup.delete():
>>> sg.delete()
>>> cg.delete()
The delete method also accepts the following optional boolean parameters:
delete_members: IfTrue, all members (e.g., volumes) will be deleted along with the consistency group.force_if_snapshot_locked: IfTrue, deletion will proceed even if some snapshots are locked.