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

virt-install picks deprecated CPU model when set --vcpu cores=1

    • virt-manager-5.0.0-1.el10
    • No
    • Moderate
    • rhel-sst-virtualization
    • ssg_virtualization
    • 17
    • 3
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Pass
    • None
    • All
    • None

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

      libvirt-10.8.0-2.el10.aarch64
      qemu-kvm-9.1.0-3.el10.aarch64
      virt-install-4.1.0-7.el10.noarch

      How reproducible is this bug?

      100%

      Steps to reproduce

      Run virt-install command:

      #virt-install --name test2 --memory 2048 --disk /var/lib/libvirt/images/vm2.img --import  --vcpu cores=1 --debug --osinfo detect=on,require=off
      
      [Wed, 30 Oct 2024 21:57:52 virt-install 153186] DEBUG (installer:613) Generated initial_xml: None required
      [Wed, 30 Oct 2024 21:57:52 virt-install 153186] DEBUG (installer:615) Generated final_xml: 
      <domain type="kvm">
        <name>test2</name>
        <uuid>c94ad456-a841-4e6e-b5d7-2d0b5e8b54e3</uuid>
        <memory>2097152</memory>
        <currentMemory>2097152</currentMemory>
        <vcpu>1</vcpu>
        <os firmware="efi">
          <type arch="aarch64" machine="virt">hvm</type>
          <boot dev="hd"/>
        </os>
        <features>
          <acpi/>
        </features>
        <cpu>
          <topology sockets="1" dies="1" cores="1" threads="1"/>
        </cpu>
        <clock offset="utc"/>
        <devices>
          <emulator>/usr/libexec/qemu-kvm</emulator>
          <disk type="file" device="disk">
            <driver name="qemu" type="qcow2"/>
            <source file="/var/lib/libvirt/images/vm2.img"/>
            <target dev="vda" bus="virtio"/>
          </disk>
          <controller type="usb" model="qemu-xhci" ports="15"/>
          <controller type="pci" model="pcie-root"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <interface type="network">
            <source network="default"/>
            <mac address="52:54:00:2f:5e:94"/>
            <model type="virtio"/>
          </interface>
          <console type="pty"/>
          <channel type="unix">
            <source mode="bind"/>
            <target type="virtio" name="org.qemu.guest_agent.0"/>
          </channel>
          <tpm>
            <backend type="emulator"/>
          </tpm>
        </devices>
      </domain>
      
      [Wed, 30 Oct 2024 21:57:53 virt-install 153186] DEBUG (cli:256)   File "/usr/bin/virt-install", line 8, in <module>
          virtinstall.runcli()
        File "/usr/share/virt-manager/virtinst/virtinstall.py", line 1234, in runcli
          sys.exit(main())
        File "/usr/share/virt-manager/virtinst/virtinstall.py", line 1227, in main
          start_install(guest, installer, options)
        File "/usr/share/virt-manager/virtinst/virtinstall.py", line 975, in start_install
          fail(e, do_exit=False)
        File "/usr/share/virt-manager/virtinst/cli.py", line 256, in fail
          log.debug("".join(traceback.format_stack()))
      
      [Wed, 30 Oct 2024 21:57:53 virt-install 153186] ERROR (cli:257) internal error: QEMU unexpectedly closed the monitor (vm='test2'): 2024-10-31T01:57:53.104913Z qemu-kvm: warning: CPU model cortex-a57-arm-cpu is deprecated -- use 'host' / 'max'
      2024-10-31T01:57:53.107241Z qemu-kvm: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument
      [Wed, 30 Oct 2024 21:57:53 virt-install 153186] DEBUG (cli:259) 
      Traceback (most recent call last):
        File "/usr/share/virt-manager/virtinst/virtinstall.py", line 955, in start_install
          domain = installer.start_install(
                   ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/share/virt-manager/virtinst/install/installer.py", line 722, in start_install
          domain = self._create_guest(
                   ^^^^^^^^^^^^^^^^^^^
        File "/usr/share/virt-manager/virtinst/install/installer.py", line 663, in _create_guest
          domain = self.conn.createXML(initial_xml or final_xml, 0)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.12/site-packages/libvirt.py", line 4545, in createXML
          raise libvirtError('virDomainCreateXML() failed')
      libvirt.libvirtError: internal error: QEMU unexpectedly closed the monitor (vm='test2'): 2024-10-31T01:57:53.104913Z qemu-kvm: warning: CPU model cortex-a57-arm-cpu is deprecated -- use 'host' / 'max'
      2024-10-31T01:57:53.107241Z qemu-kvm: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument
      [Wed, 30 Oct 2024 21:57:53 virt-install 153186] DEBUG (cli:272) Domain installation does not appear to have been successful.
      
      
      

      Expected results

      virt-install should set correct CPU model.

      Actual results

              rhn-engineering-colerobinson Cole Robinson
              xiaodwan@redhat.com Xiaodai Wang
              virt-maint virt-maint
              Hongzhou Liu Hongzhou Liu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: