Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-109129

virt-customize won't do selinux relabel correctly across filesystem boundaries [rhel-10.1]

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-10.1
    • rhel-9.6
    • guestfs-tools
    • None
    • guestfs-tools-1.54.0-3.el10
    • No
    • Low
    • rhel-virt-tools
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      firstboot.sh is not running on VM migrated from VMware, guest is missing configuration (i.e. qga).

      What is the impact of this issue to you?

      virt-v2v completes, but the qemu-ga is not installed as the firstboot.sh script doesn't run.

      Aug 08 12:40:24 localhost.localdomain systemd[790]: guestfs-firstboot.service: Failed at step EXEC spawning /usr/lib/virt-sysprep/firstboot.sh: Permission denied
      

      Because of the label (or lack of it):

      # ls -lZ /usr/lib/virt-sysprep/firstboot.sh 
      -rwxr-xr-x. 1 root root system_u:object_r:unlabeled_t:s0 1099 Aug  8 11:59 /usr/lib/virt-sysprep/firstboot.sh
      

      Which appears to happen only if we have a separate /usr filesystem:

      # lsblk | grep usr
        └─rhel-usr  253:2    0   10G  0 lvm  /usr
      

      Maybe this is not doing its job with the separate /usr - which is found and mounted at /sysroot/usr/)?

      commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/sys -m -C -T 0 -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/
      

      Please provide the package NVR for which the bug is seen:

      info: virt-v2v: virt-v2v 2.7.1rhel=9,release=8.el9_6 (x86_64)
      info: libvirt version: 10.10.0
       

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. In VMware, install RHEL8 from ISO and set /usr to a separate LV/filesystem
      2. Move the VM to OCP using MTV

      Expected results

      Firstboot executes

      Actual results

      Firstboot fails

              virt-maint virt-maint
              rhn-support-gveitmic Germano Veit Michel
              virt-maint virt-maint
              Xiang Hua Chen Xiang Hua Chen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: