'Creates a Cinder cgsnapshot object.
The Cinder cgsnapshot object is created by making use of an ONTAP CG
snapshot in order to provide write-order consistency for a set of
backing flexvols. First, a list of the flexvols backing the given
Cinder volumes in the CG is determined. An ONTAP CG snapshot of the
flexvols creates a write-order consistent snapshot of each backing
flexvol. For each Cinder volume in the CG, it is then necessary to
clone its volume from the ONTAP CG snapshot. The naming convention
used to create the clones indicates the clone\'s role as a Cinder
snapshot and its inclusion in a Cinder CG snapshot. The ONTAP CG
snapshots, of each backing flexvol, are deleted after the cloning
operation is completed.
:returns: An implicit update for the cgsnapshot and snapshot models
that is then used by the manager to set the models to
available.'

@utils.trace_method
def create_cgsnapshot(self, context, cgsnapshot, snapshots):

    hosts = [snapshot['volume']['host'] for snapshot in snapshots]
    flexvols = self._get_flexvol_names_from_hosts(hosts)
    self.zapi_client.create_cg_snapshot(flexvols, cgsnapshot['id'])
    for snapshot in snapshots:
        self._clone_backing_file_for_volume(snapshot['volume']['name'], snapshot['name'], snapshot['volume']['id'], source_snapshot=cgsnapshot['id'])
    for flexvol_name in flexvols:
        try:
            self.zapi_client.wait_for_busy_snapshot(flexvol_name, cgsnapshot['id'])
            self.zapi_client.delete_snapshot(flexvol_name, cgsnapshot['id'])
        except exception.SnapshotIsBusy:
            self.zapi_client.mark_snapshot_for_deletion(flexvol_name, cgsnapshot['id'])
    return (None, None)
