Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to get dhcp ipaddress from Vm installed from anaconda-iso build #716

Open
chunfuwen opened this issue Nov 15, 2024 · 4 comments
Open

Comments

@chunfuwen
Copy link

chunfuwen commented Nov 15, 2024

  1. Build out one anaconda-iso with below config.toml and container file
root@xx images]# cat config.toml


            [customizations.kernel]
            append = "mitigations=auto,nosmt"

                [customizations]
                fips = true

            [customizations.installer.modules]
            enable = [
              "org.fedoraproject.Anaconda.Modules.Localization"
            ]
            disable = [
              "org.fedoraproject.Anaconda.Modules.Timezone"
            ]

            [customizations.installer.kickstart]
            contents = """user --name alice --password bob --groups wheel
rootpw --lock --iscrypted locked
sshkey --username alice "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQChlMVS7mhJplQs8UxU2Z1B645q2mr9SiuNDgDBU+eK235T0qVL2jlT7O5DP2AN0eCApsLNB3kKB63VIADLw0tXO0wx7TQnx53nfn7BT/JHgsm8x4DRtYzL3XNHrSUPmkOEyXTNzrBsxZ3cobFSvM9j+kcqBbxB5EwK0+5C5yzX2Xuk/NYe0v5nPd2xb7dOIwyTkrTFsqDkdns6NXNb/vBRdqqclS83txiMPQphVeGuX3SYwuMlwUwlNnkuqNgYQL1LC1LjW9yPx9X3ez44jn4IF9DNhOLKp193jmZY8j87MjpzAPXxR3uzRU71Eo2hVNGBwI+vrwFGS1KjrCnCXHYZbLI2TaMbczMw2OURynf8zmx+V4XDxluev6+snVfvQ8rQAkH0Ob0dyErcN0Rze7QnnF3FXwu35EiOPrznWhpAs+kmU4m2Q0ZxeFC5gNNiykt9Vg1qGVhAdUEaoSJUXAPPvTU4lDuqDRKkJhb2G+d9CMBCgZXbOcSv6d76RLSYgms= [email protected]"
text --non-interactive
zerombr
clearpart --all --initlabel --disklabel=gpt
autopart --noswap --type=lvm
network --bootproto=dhcp --device=eno1 --activate --onboot=on
 reboot"""

[root@dell-per430-17 images]# cat Containerfile_tmp


FROM registry.stage.redhat.io/rhel9/rhel-bootc:9.5

COPY beaker-BaseOS.repo /etc/yum.repos.d/
COPY beaker-AppStream.repo /etc/yum.repos.d/
RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel-passwordless-sudo
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config.d/01-permitrootlogin.conf

RUN  dnf install -y vim && dnf clean all

  1. Command line :
Command 'sudo podman build -t localhost/bootc:eln -f /var/lib/libvirt/images/Containerfile_tmp' finished with 0 after 46.994838896s
the whole podman command: sudo podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v /var/lib/libvirt/
images/output:/output -v /var/lib/libvirt/images/config.toml:/config.toml   -v /var/lib/containers/storage:/var/lib/containers/storage  
 -v /var/lib/libvirt/images/auth.json:/run/containers/0/auth.json   quay.io/centos-bootc/bootc-image-builder:latest  --type anaconda-iso
 --tls-verify=true  --config /config.toml  --local localhost/bootc:eln  --chown 107:107 

@chunfuwen chunfuwen changed the title Fail to login in Vm installed from anaconda-iso build with user:alice and password:bob Fail to get dhcp ipaddress from Vm installed from anaconda-iso build Nov 15, 2024
@chunfuwen
Copy link
Author

Screenshot from 2024-11-15 14-41-18

@chunfuwen
Copy link
Author

VM xml

<domain type='kvm' id='2'>
  <name>install_5140503111el9_5x86_64_upstream_bib_bios_install-localhost-bootc</name>
  <uuid>5a0176ce-55ed-4921-b59d-79f6f3c3c3c4</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://redhat.com/rhel/9.5"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>3170304</memory>
  <currentMemory unit='KiB'>3170304</currentMemory>
  <vcpu placement='static'>3</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-rhel9.4.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'/>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' discard='unmap'/>
      <source file='/var/lib/libvirt/images/install_5140503111el9_5x86_64_upstream_bib_bios_install-localhost-bootc_bios.qcow2' index='2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <alias name='pci.3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <alias name='pci.4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <alias name='pci.5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <alias name='pci.6'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x16'/>
      <alias name='pci.7'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='pci' index='8' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='8' port='0x17'/>
      <alias name='pci.8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/>
    </controller>
    <controller type='pci' index='9' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='9' port='0x18'/>
      <alias name='pci.9'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='10' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='10' port='0x19'/>
      <alias name='pci.10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
    </controller>
    <controller type='pci' index='11' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='11' port='0x1a'/>
      <alias name='pci.11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
    </controller>
    <controller type='pci' index='12' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='12' port='0x1b'/>
      <alias name='pci.12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/>
    </controller>
    <controller type='pci' index='13' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='13' port='0x1c'/>
      <alias name='pci.13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/>
    </controller>
    <controller type='pci' index='14' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='14' port='0x1d'/>
      <alias name='pci.14'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:fa:f9:d4'/>
      <source network='default' portid='bd041e53-bee1-4d3a-93a5-ef4df38aa5e6' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/run/libvirt/qemu/channel/2-install_5140503111el/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <audio id='1' type='none'/>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <watchdog model='itco' action='reset'>
      <alias name='watchdog0'/>
    </watchdog>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </rng>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c147,c537</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c147,c537</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>


@chunfuwen chunfuwen reopened this Nov 15, 2024
@chunfuwen
Copy link
Author

The command to use to install vm

command line: /usr/bin/virt-install --name install_5140503111el9_5x86_64_upstream_bib_bios_install-localhost-bootc --disk path=/var/lib/libvirt/images/install_5140503111el9_5x86_64_upstream_bib_bios_install-localhost-bootc_bios.qcow2,bus=virtio,format=qcow2,size=12 --vcpus 3 --memory 3096 --osinfo detect=on,require=off --graphics vnc --video virtio --serial pty --wait 10 --cdrom /var/lib/libvirt/images/install_5140503111el9_5x86_64_upstream_bib_bios_install-localhost-bootc.iso --debug --machine q35 --noreboot

@chunfuwen
Copy link
Author

bib output log:
Uploading bib_dhcp_failgetip.log…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant