'Creates a Cinder cgsnapshot object.
The Cinder cgsnapshot object is created by making use of an
ephemeral ONTAP CG in order to provide write-order consistency for a
set of flexvol snapshots. First, a list of the flexvols backing the
given Cinder CG must be gathered. An ONTAP cg-snapshot of these
flexvols will create a snapshot copy of all the Cinder volumes in the
CG group. For each Cinder volume in the CG, it is then necessary to
clone its backing LUN from the ONTAP cg-snapshot. The naming convention
used for the clones is what indicates the clone\'s role as a Cinder
snapshot and its inclusion in a Cinder CG. The ONTAP CG-snapshot of
the flexvols is no longer required after having cloned the LUNs
backing the Cinder volumes in the Cinder CG.
:returns: An implicit update for cgsnapshot and snapshots models that
is interpreted by the manager to set their models to
available.'

def create_cgsnapshot(self, cgsnapshot, snapshots):

    flexvols = set()
    for snapshot in snapshots:
        flexvols.add(volume_utils.extract_host(snapshot['volume']['host'], level='pool'))
    self.zapi_client.create_cg_snapshot(flexvols, cgsnapshot['id'])
    for snapshot in snapshots:
        self._clone_lun(snapshot['volume']['name'], snapshot['name'], source_snapshot=cgsnapshot['id'])
    for flexvol in flexvols:
        try:
            self.zapi_client.wait_for_busy_snapshot(flexvol, cgsnapshot['id'])
            self.zapi_client.delete_snapshot(flexvol, cgsnapshot['id'])
        except exception.SnapshotIsBusy:
            self.zapi_client.mark_snapshot_for_deletion(flexvol, cgsnapshot['id'])
    return (None, None)
