Created attachment 1314986 [details] log.virt-resize_expand_swap.rhel5.11 Description of problem: virt-resize failed to expand swap partition for RHEL5.11 guest image with "parsing UUID failed". Please refer to the attachment for detailed log. Version-Release number of selected component (if applicable): libguestfs-1.36.3-6.el7_4.2.x86_64 How reproducible: 100% Steps: 1. Prepare a RHEL5.11 guest image: RHEL-Server-5.11-64-hvm.raw 2. Check the swap partition: # virt-filesystems -a RHEL-Server-5.11-64-hvm.raw -lh --extra Name Type VFS Label Size Parent /dev/sda1 filesystem ext3 /boot 102M - /dev/VolGroup00/LogVol00 filesystem ext3 - 5.9G - /dev/VolGroup00/LogVol01 filesystem swap - 2.0G - 3. Create a image for test: # qemu-img create libguestfs_virt-resize_test.img 22474836480 4. Expand the swap partition: # virt-resize --expand /dev/sda2 --LV-expand /dev/VolGroup00/LogVol01 RHEL-Server-5.11-64-hvm.raw libguestfs_virt-resize_test.img[ 0.0] Examining RHEL-Server-5.11-64-hvm.raw ********** Summary of changes: /dev/sda1: This partition will be left alone. /dev/sda2: This partition will be resized from 7.9G to 8.8G. The LVM PV on /dev/sda2 will be expanded using the 'pvresize' method. /dev/VolGroup00/LogVol01: This logical volume will be expanded to maximum size. The swap on /dev/VolGroup00/LogVol01 will be expanded using the 'mkswap' method. ********** [ 3.4] Setting up initial partition table on libguestfs_virt-resize_test.img [ 3.6] Copying /dev/sda1 [ 4.0] Copying /dev/sda2 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 [ 87.1] Expanding /dev/sda2 using the 'pvresize' method [ 87.1] Expanding /dev/VolGroup00/LogVol01 using the 'mkswap' method virt-resize: error: libguestfs error: mkswap: /dev/VolGroup00/LogVol01: mkswap: error: parsing UUID failed If reporting bugs, run virt-resize with debugging enabled and include the complete output: virt-resize -v -x [...] Actual results: Failed to expand the swap partition. Expected results: The swap partition should be expanded successfully. Additional info: This command passed on RHEL4.8/RHEL6.9/RHEL7.3.
Patch posted: https://www.redhat.com/archives/libguestfs/2017-August/msg00106.html
Fixed upstream with https://github.com/libguestfs/libguestfs/commit/6befd1464d9939b9c15373b19296e796bea3d8d5 which is in libguestfs >= 1.37.22.
Verified with the package: libguestfs-1.36.6-2.el7.x86_64 Steps: 1. Prepare a RHEL5.11 guest image: RHEL-Server-5.11-64-hvm.raw 2. Check the swap partition: # virt-filesystems -a RHEL-Server-5.11-64-hvm.raw -lh --extra Name Type VFS Label Size Parent /dev/sda1 filesystem ext3 /boot 102M - /dev/VolGroup00/LogVol00 filesystem ext3 - 5.9G - /dev/VolGroup00/LogVol01 filesystem swap - 2.0G - 3. Create a image for test: # qemu-img create libguestfs_virt-resize_test.img 22474836480 4. Expand the swap partition: # virt-resize --expand /dev/sda2 --LV-expand /dev/VolGroup00/LogVol01 RHEL-Server-5.11-64-hvm.raw libguestfs_virt-resize_test.img -------------------------------------------------------- [ 0.0] Examining RHEL-Server-5.11-64-hvm.raw ********** Summary of changes: /dev/sda1: This partition will be left alone. /dev/sda2: This partition will be resized from 7.9G to 20.8G. The LVM PV on /dev/sda2 will be expanded using the 'pvresize' method. /dev/VolGroup00/LogVol01: This logical volume will be expanded to maximum size. The swap on /dev/VolGroup00/LogVol01 will be expanded using the 'mkswap' method. ********** [ 4.7] Setting up initial partition table on libguestfs_virt-resize_test.img [ 5.1] Copying /dev/sda1 [ 5.4] Copying /dev/sda2 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00 [ 49.4] Expanding /dev/sda2 using the 'pvresize' method [ 49.4] Expanding /dev/VolGroup00/LogVol01 using the 'mkswap' method virt-resize: warning: UUID in swap partition /dev/VolGroup00/LogVol01 changed from ‘’ to ‘9f11776b-d783-4c3f-a717-726c27552cfd’ Resize operation completed with no errors. Before deleting the old disk, carefully check that the resized disk boots and works correctly. -------------------------------------------------------- The swap partition can be expanded successfully with the new libguestfs version. So verified this bug.
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://access.redhat.com/errata/RHBA-2018:0677