RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1139543 - Improve the error info when converting guest with no space left
Summary: Improve the error info when converting guest with no space left
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-09 07:39 UTC by tingting zheng
Modified: 2015-03-05 13:44 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.27.41-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Log file of converting guest with no space left (425.63 KB, text/plain)
2014-09-09 07:39 UTC, tingting zheng
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description tingting zheng 2014-09-09 07:39:25 UTC
Created attachment 935562 [details]
Log file of converting guest with no space left

Description
Improve the error info when converting guest with no space left

Version:
libguestfs-1.27.39-1.1.el7.x86_64
virt-v2v-1.27.39-1.1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest with no space left.
# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root  6.5G  6.5G     0 100% /
tmpfs                         939M   76K  939M   1% /dev/shm
/dev/sda1                     485M   35M  426M   8% /boot

2.Use virt-v2v to convert the guest.Error shows as:virt-v2v: error: libguestfs error: command: cp: writing 
`/tmp/initramfs.W9jxv6/lib/kbd/unimaps/cp437.uni': No space left on device
E: Failed to install /lib/kbd/unimaps/cp437.uni
/usr/share/dracut/dracut-functions: line 49: echo: write error: No space 
left on device

# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export --network rhevm demo
[   0.0] Opening the source -i libvirt demo
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   5.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export
[   6.0] Inspecting the overlay
[  18.0] Converting Red Hat Enterprise Linux Server release 6.5 (Santiago) to run on KVM
virt-v2v: error: libguestfs error: command: cp: writing 
`/tmp/initramfs.W9jxv6/lib/kbd/unimaps/cp437.uni': No space left on device
E: Failed to install /lib/kbd/unimaps/cp437.uni
/usr/share/dracut/dracut-functions: line 49: echo: write error: No space 
left on device

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


Actual results:
The error info is not clear and a bit confusing for whether no space left in guest or host.

Expected results:
No space left in guest or something like this.

Additional info:

Comment 1 Richard W.M. Jones 2014-09-09 09:48:46 UTC
Upstream fix:

https://github.com/libguestfs/libguestfs/commit/be1c6965006dec258b915c9561ac66c8cb36dfe6

This will appear in libguestfs >= 1.27.40.

Comment 3 zhoujunqin 2014-09-10 08:33:44 UTC
I can also reproduce this bug issue with new package version:
virt-v2v-1.27.41-1.1.el7.x86_64
libguestfs-1.27.41-1.1.el7.x86_64

1.Prepare a guest with no space left.
# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root  6.5G  6.5G     0 100% /
tmpfs                         939M   76K  939M   1% /dev/shm
/dev/sda1                     485M   35M  426M   8% /boot

2.Use virt-v2v to convert the guest.
# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export --network rhevm demo
[   0.0] Opening the source -i libvirt demo
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   2.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export
[   3.0] Inspecting the overlay
[  11.0] Checking for sufficient free disk space in the guest
[  11.0] Converting Red Hat Enterprise Linux Server release 6.5 (Santiago) to run on KVM
virt-v2v: error: libguestfs error: command: cp: writing 
`/tmp/initramfs.ClQe2q/lib/kbd/unimaps/cp437.uni': No space left on device
E: Failed to install /lib/kbd/unimaps/cp437.uni

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Since the error has not been improved, assigned back, and please check whether the patch in Comment 1 has been included by libguestfs package, thanks.

Comment 4 Richard W.M. Jones 2014-09-10 09:50:00 UTC
(In reply to zhoujunqin from comment #3)
> I can also reproduce this bug issue with new package version:
> virt-v2v-1.27.41-1.1.el7.x86_64
> libguestfs-1.27.41-1.1.el7.x86_64
> 
> 1.Prepare a guest with no space left.
> # df -h
> Filesystem                    Size  Used Avail Use% Mounted on
> /dev/mapper/VolGroup-lv_root  6.5G  6.5G     0 100% /
> tmpfs                         939M   76K  939M   1% /dev/shm
> /dev/sda1                     485M   35M  426M   8% /boot

df isn't a very accurate way to display the actual free space in
a filesystem.  It shows free space available to non-root users,
and the -h option obscures things further.

Use:

$ stat -f /

instead.  I'm betting there is free space on this filesystem, but
df is just not showing it to you.

Comment 5 zhoujunqin 2014-09-10 11:21:22 UTC
I tried as you suggestion on guest.
By root user:
# stat -f /
  File: "/"
    ID: dd12bb426bbe0a3a Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 1687234    Free: 5401       Available: 0
Inodes: Total: 429088     Free: 333905

By normal user:
$  stat -f /
  File: "/"
    ID: dd12bb426bbe0a3a Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 1687234    Free: 5352       Available: 0
Inodes: Total: 429088     Free: 333878

do you think it's ok to prove the guest with no space left.

Comment 6 Richard W.M. Jones 2014-09-10 15:14:32 UTC
(In reply to zhoujunqin from comment #5)
> I tried as you suggestion on guest.
> By root user:
> # stat -f /
>   File: "/"
>     ID: dd12bb426bbe0a3a Namelen: 255     Type: ext2/ext3
> Block size: 4096       Fundamental block size: 4096
> Blocks: Total: 1687234    Free: 5401       Available: 0

You're not quite triggering the error message.

The disk itself has 5401 free blocks.  Because the block size
is 4096 bytes, that means you have 22122496 bytes free.

The "Available: 0" in this case means that non-root users are
unable to use this space, because Linux filesystems reserve a
percentage of their space for the root user.  (Use 'tune2fs -l'
to find out what percentage).  Non-root users are irrelevant
because all conversion operations are done ignoring this
reserved space.

virt-v2v checks to see if you have at least 20000000 bytes
free on the root partition, which in this case you do
(20000000 < 22122496).  So the error is not printed.  But
the margin is so small that if you created even a 3 MB file on
the root filesystem then you should get the error.

Comment 7 zhoujunqin 2014-09-11 05:59:31 UTC
Thanks for your help, Richard W.M. Jones.
I tried again with package:
virt-v2v-1.27.41-1.1.el7.x86_64
libguestfs-1.27.41-1.1.el7.x86_64

1. Prepare a guest with no space( Login guest and check)
# stat -f /
  File: "/"
    ID: dd12bb426bbe0a3a Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 1687234    Free: 4096       Available: 0
Inodes: Total: 429088     Free: 333880

2. Use virt-v2v to convert the guest.
# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export --network rhevm demo
[   0.0] Opening the source -i libvirt demo
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   2.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export
[   2.0] Inspecting the overlay
[  11.0] Checking for sufficient free disk space in the guest
virt-v2v: error: not enough free space for conversion on filesystem '/'.  
16887808 bytes free < 20000000 bytes needed

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Can get the friendly error message, so move from ASSIGNED to VERIFIED.

Comment 9 errata-xmlrpc 2015-03-05 13:44:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html


Note You need to log in before you can comment on or make changes to this bug.