'Creates a DRBD resource.
We address it later on via the ID that gets stored
as a private property.'

def create_volume(self, volume):

    d_res_name = self.is_clean_volume_name(volume['id'], DM_VN_PREFIX)
    res = self.call_or_reconnect(self.odm.create_resource, d_res_name, self.empty_dict)
    self._check_result(res, ignore=[dm_exc.DM_EEXIST], ret=None)
    self._push_drbd_options(d_res_name)
    (__, drbd_vol) = self._resource_name_volnr_for_volume(volume, empty_ok=True)
    if (not drbd_vol):
        props = self._priv_hash_from_volume(volume)
        res = self.call_or_reconnect(self.odm.create_volume, d_res_name, self._vol_size_to_dm(volume['size']), props)
        self._check_result(res)
        drbd_vol = self._fetch_answer_data(res, dm_const.VOL_ID)
    res = self.call_or_reconnect(self.odm.auto_deploy, d_res_name, self.drbdmanage_redundancy, 0, False)
    self._check_result(res)
    okay = self._call_policy_plugin(self.plugin_resource, self.policy_resource, dict(resource=d_res_name, volnr=str(drbd_vol)))
    if (not okay):
        message = (_('DRBDmanage    timeout    waiting    for    volume    creation;    resource    "%(res)s",    volume    "%(vol)s"') % {'res': d_res_name, 'vol': volume['id']})
        raise exception.VolumeBackendAPIException(data=message)
    if self.drbdmanage_devs_on_controller:
        res = self.call_or_reconnect(self.odm.assign, socket.gethostname(), d_res_name, [(dm_const.FLAG_DISKLESS, dm_const.BOOL_TRUE)])
        self._check_result(res, ignore=[dm_exc.DM_EEXIST])
    return {}
