환경
- Red Hat Enterprise Linux 7
- Red Hat Virtualization if RHEL 7 is used as the virtualization host
- Red Hat Virtualization (RHV) 4.3
문제
-
On a RHEL 7 host, using libguestfs utilities such as guestfish, virt-sysprep, or virt-customize to access or modify a RHEL 8 virtual disk image fails if the disk image is using an XFS or ext4 file system.
-
For example:
# /usr/bin/virt-sysprep -a RHEL8.img [' [ 0.0] Examining the guest ... virt-sysprep: warning: mount_options: mount exited with status 32: mount: wrong fs type, bad option, bad superblock on /dev/mapper/rhel-root, missing codepage or helper program, or other error', ' In some cases useful info is found in syslog - try dmesg | tail or so. (ignored)', 'virt-sysprep: warning: mount_options: mount: /boot: mount point is not a directory (ignored) [ 15.5] Performing "abrt-data" ...']
- In RHV 4.3, it is not possible to create a template of RHEL8 guest due to this behavior
해결
There are two possible workarounds:
-
If viable, you can re-create the guest file systems and disable RHEL 8 file-system features that are incompatible with RHEL 7. To do so, use the mkfs utility with one of the following options:
- For XFS file systems, use the -m reflink=0 option.
- For ext4 file systems, use the -O ^metadata_csum option.
- This is documented in this article.
- Note that on a RHEL 8 host, the affected utilities work as expected.
-
Disclaimer: this workaround is unsupported - use the upstream latest libguestfs appliance.
-
Download the latest upstream libguestfs appliance on RHEL-7 host:
[RHEL7.6-host]$ pwd /export [RHEL7.6-host]$ wget \ http://download.libguestfs.org/binaries/appliance/appliance-1.38.0.tar.xz
-
Extract the upstream appliance and enumerate its content, also, make sure that qemu has access to the files:
[RHEL7.6-host]$ tar -Jxf appliance-1.38.0.tar.xz [RHEL7.6-host]$ ls /export/appliance initrd kernel README.fixed root [RHEL7.6-host]$ chmod -R a+rwX /export/applicance
-
Set the LIBGUESTFS_PATH variable to the above appliance:
[RHEL7.6-host]$ export LIBGUESTFS_PATH=/export/appliance
-
Validate
-
Read-only mount the RHEL-8 disk image via guestfish, and read the /etc/redhat-release file:
[RHEL7.6-host]$ guestfish --ro -i \ -a rhel-guest-image-8.0-1590.x86_64.qcow2 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: ‘help’ for help on commands ‘man’ to read the manual ‘quit’ to quit the shell Operating system: Red Hat Enterprise Linux 8.0 Beta (Ootpa) /dev/sda3 mounted on / /dev/sda1 mounted on /boot ><fs> cat /etc/redhat-release Red Hat Enterprise Linux release 8.0 Beta (Ootpa)
-
Or, remove the root password via virt-edit (or reset it via virt-sysprep — refer further below):
[RHEL7.6-host]$ virt-edit \ -a rhel-guest-image-8.0-1590.x86_64.qcow2 \ /etc/passwd -e 's/^root:.*?:/root::/'
-
Or, uninstall the ‘cloud-init’ RPM:
[RHEL7.6-host]$ virt-customize --uninstall cloud-init \ -a rhel-guest-image-8.0-1590.x86_64.qcow2
-
Or just cat a file
[RHEL7.6-host]$ virt-cat -a rhel-guest-image-8.0-1590.x86_64.qcow2 /var/log/cloud-init.log > cloud-init.log
-
-
근본 원인
RHEL 7 is not fully compatible with certain features of the XFS and ext4 file systems in RHEL 8, based on RH Private BZ#1667478.
RHV BZ 1671895.
'컴이야기 > linux' 카테고리의 다른 글
Netdata 모니터링 (0) | 2020.11.18 |
---|---|
KVM VM IP 알아보기 (0) | 2020.08.06 |
RHEL 8 local dnf 설정 (0) | 2020.07.20 |
fail to open efi boot grubx64.efi (0) | 2018.09.20 |
yum 이 안되는 곳에서 PHP7 설치 (0) | 2018.02.12 |