def create_volume(self, dataset_id, size): """ Create a new volume. When called by :py:class:`~flocker.node._deploy.IDeployer`, the supplied size will be rounded up to the nearest :py:meth:`allocation_unit`. :param str dataset_id: The Flocker dataset ID of the dataset on this volume :param int size: The size of the new volume in bytes :return: The created volume :rtype: :py:class:`~flocker.node.agents.blockdevice.BlockDeviceVolume` """ logger.debug('Creating volume %s of size %s', dataset_id, size) # This is to avoid needing a separate data store for mapping # dataset-ids to block-device-ids and back again. volume = _blockdevicevolume_from_dataset_id(dataset_id, size) self.driver.create_volume( self.pool_name, self._vol_f2n(volume.blockdevice_id), size) return volume
def create_volume(self, dataset_id, size): """ Create a volume of specified size on the EMC XtremeIO Array. The size shall be rounded off to 1BM, as EMC XtremeIO creates volumes of these sizes. See ``IBlockDeviceAPI.create_volume`` for parameter and return type documentation. """ if not self._check_for_volume_folder(): self._create_volume_folder() # Round up to 1MB boundaries size_mb = self._convert_size(size, 'MB') volume = _blockdevicevolume_from_dataset_id( size=size, dataset_id=dataset_id, ) data = { 'vol-name': str(volume.blockdevice_id), 'vol-size': str(size_mb) + 'm', 'parent-folder-id': XtremIOMgmt.BASE_PATH + str(self._cluster_id) } self.mgmt.request('volumes', 'POST', data) self.volume_list[str(volume.blockdevice_id)] = volume return volume
def create_volume(self, dataset_id, size): """ Create a volume of specified size on the EMC XtremeIO Array. The size shall be rounded off to 1BM, as EMC XtremeIO creates volumes of these sizes. See ``IBlockDeviceAPI.create_volume`` for parameter and return type documentation. """ if not self._check_for_volume_folder(): self._create_volume_folder() # Round up to 1MB boundaries size_mb = self._convert_size(size, 'MB') volume = _blockdevicevolume_from_dataset_id( size=size, dataset_id=dataset_id, ) data = {'vol-name': str(volume.blockdevice_id), 'vol-size': str(size_mb) + 'm', 'parent-folder-id': XtremIOMgmt.BASE_PATH + str(self._cluster_id)} self.mgmt.request('volumes', 'POST', data) self.volume_list[str(volume.blockdevice_id)] = volume return volume