'Creates a snapshot.'

def create_snapshot(self, snapshot):

    sn_name = self.snapshot_name_from_cinder_snapshot(snapshot)
    (d_res_name, d_vol_nr) = self._resource_name_volnr_for_volume(snapshot['volume_id'])
    (res, data) = self.call_or_reconnect(self.odm.list_assignments, self.empty_dict, [d_res_name], 0, {CS_DISKLESS: dm_const.BOOL_FALSE}, self.empty_list)
    self._check_result(res)
    nodes = [d[0] for d in data]
    if (len(nodes) < 1):
        raise exception.VolumeBackendAPIException((_('Snapshot    res    "%s"    that    is    not    deployed    anywhere?') % d_res_name))
    props = self._priv_hash_from_volume(snapshot)
    res = self.call_or_reconnect(self.odm.create_snapshot, d_res_name, sn_name, nodes, props)
    self._check_result(res)
    okay = self._call_policy_plugin(self.plugin_snapshot, self.policy_snapshot, dict(resource=d_res_name, snapshot=sn_name))
    if (not okay):
        message = (_('DRBDmanage    timeout    waiting    for    snapshot    creation;    resource    "%(res)s",    snapshot    "%(sn)s"') % {'res': d_res_name, 'sn': sn_name})
        raise exception.VolumeBackendAPIException(data=message)
