clalancette / oz

Automated installation for guest images
GNU Lesser General Public License v2.1
310 stars 129 forks source link

copyfile_sparse fails with OSError: [Errno 28] No space left on device #99

Closed spil-ruslan closed 11 years ago

spil-ruslan commented 11 years ago

It seem https://github.com/clalancette/oz/blob/master/oz/ozutil.py#L112 breaks caching. Changing it back restore functionality:

        if buf == '\0'*buflen:
            os.lseek(dest_fd, buflen, os.SEEK_CUR)

Change was introduced in this commit: https://github.com/clalancette/oz/commit/2f4dbdb8319a1f33fbb005fe6d885755dbf2134b#oz/ozutil.py

Exception:
INFO:oz.Guest.RHEL6Guest:Caching JEOS
Dest /bigdisk/oz/jeos/RHEL-63x86_64.dsk
Src /bigdisk/imagebuilder/builddir/cloud-basebox-testing.raw
INFO:oz.Guest.RHEL6Guest:Cleaning up guest named cloud-basebox-testing
INFO:oz.Guest.RHEL6Guest:Cleaning up after install
Traceback (most recent call last):
  File "/usr/bin/oz-install", line 165, in <module>
    libvirt_xml = guest.install(timeout, force_download)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 747, in install
    return self._do_install(timeout, force, 0, self.cmdline)
  File "/usr/lib/python2.6/site-packages/oz/Guest.py", line 1607, in _do_install
    oz.ozutil.copyfile_sparse(self.diskimage, self.jeos_filename)
  File "/usr/lib/python2.6/site-packages/oz/ozutil.py", line 119, in copyfile_sparse
    os.write(dest_fd, buf)
OSError: [Errno 28] No space left on device
clalancette commented 11 years ago

Yeah, really good point. I've now removed the "raw" annotation and pushed the result. Thanks for the bug report.