vMConUtils.py 文件源码

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

项目:VManagePlatform 作者: welliamcao 项目源码 文件源码
def clone(self, pool,pool_name,name, clone, format=None):
        '''???'''
        storage_type = self.getStorageMode(pool_name)
        if storage_type == 'dir':
            clone += '.img'
        vol = self.getStorageVolume(pool,name)
        if vol:
            if not format:
                format = self.getStorageVolumeType(name)
            xml = """
                <volume>
                    <name>%s</name>
                    <capacity>0</capacity>
                    <allocation>0</allocation>
                    <target>
                        <format type='%s'/>
                    </target>
                </volume>""" % (clone, format)
            try:
                return self.createXMLFrom(xml, vol, 0)
            except libvirt.libvirtError,e:
                return '?????????????{result}'.format(result=e.get_error_message())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号