coprhd_blockdevice.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:flocker-driver 作者: CoprHD 项目源码 文件源码
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)
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号