def create(self, dbg, sr, name, description, size, sharable): log.debug("%s: Volume.create: SR: %s Name: %s Description: %s Size: %s" % (dbg, sr, name, description, size)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.create(dbg, sr, name, description, size, sharable) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.create(dbg, sr, name, description, size, sharable)
def stat(self, dbg, sr, key): log.debug("%s: Volume.stat: SR: %s Key: %s" % (dbg, sr, key)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.stat(dbg, sr, key) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.stat(dbg, sr, key)
def resize(self, dbg, sr, key, new_size): log.debug("%s: Volume.resize: SR: %s Key: %s New_size: %s" % (dbg, sr, key, new_size)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.resize(dbg, sr, key, new_size) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.resize(dbg, sr, key, new_size)
def unset(self, dbg, sr, key, k): log.debug("%s: Volume.unset: SR: %s Key: %s Custom_key: %s" % (dbg, sr, key, k)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.unset(dbg, sr, key, k) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.unset(dbg, sr, key, k)
def set_description(self, dbg, sr, key, new_description): log.debug("%s: Volume.set_description: SR: %s Key: %s New_description: %s" % (dbg, sr, key, new_description)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.set_description(dbg, sr, key, new_description) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.set_description(dbg, sr, key, new_description)
def clone(self, dbg, sr, key, mode='clone'): log.debug("%s: Volume.%s: SR: %s Key: %s" % (dbg, sys._getframe().f_code.co_name, sr, key)) if utils.get_vdi_type_by_uri(dbg, sr) == 'raw': return RAWVolume.clone(dbg, sr, key, mode) elif utils.get_vdi_type_by_uri(dbg, sr) == 'qcow2': return QCOW2Volume.clone(dbg, sr, key, mode)