def create_volume(self, dataset_id, size):
"""
Create a volume of specified size on the COPRHD.
The size shall be rounded off to 1GB, as COPRHD
volumes of these sizes.
See ``IBlockDeviceAPI.create_volume`` for parameter and return type
documentation.
"""
Message.new(Info="coprhd create_volume size is " + str(size)).write(_logger)
volumesdetails = self.coprhdcli.get_volume_details("flocker-{}".format(dataset_id))
if not volumesdetails:
self.coprhdcli.create_volume("flocker-{}".format(dataset_id),size)
Message.new(Debug="coprhd create_volume done").write(_logger)
return BlockDeviceVolume(
size=size, attached_to=None, dataset_id=dataset_id, blockdevice_id=u"block-{0}".format(dataset_id)
)
评论列表
文章目录