'Creates a volume from a snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    if snapshot.get('cgsnapshot_id'):
        snap_by_anc = self._get_snapset_ancestors(snapshot.cgsnapshot)
        snapshot_id = snap_by_anc[snapshot['volume_id']]
    else:
        snapshot_id = snapshot['id']
    self.client.create_snapshot(snapshot_id, volume['id'])
    if (volume.get('consistencygroup_id') and (self.client is XtremIOClient4)):
        self.client.add_vol_to_cg(volume['id'], snapshot['consistencygroup_id'])
