def create_from_raw(self, base, size=None): self._assert_image_not_larger(base, size) utils.execute('qemu-img', 'create', '-f', 'qcow2', '-o', 'cluster_size=2M,backing_file=%s' % base, self.path()) if size: disk.extend(self.image_path, size)
def create_from_raw(self, base, size=None): self._assert_image_not_larger(base, size) utils.execute('cp', base, self.image_path) if size: disk.extend(self.image_path, size)
def fetch_image(context, target, image_id, user_id, project_id, size=None): """Grab image and optionally attempt to resize it""" images.fetch(context, image_id, target, user_id, project_id) if size: disk.extend(target, size)