CPU_MODELS field for an KVM host on ARM (aarch64) is not filled in
Description On an ARM host the following information is shown:
# onehost show 0
MONITORING INFORMATION
ARCH="aarch64"
CGROUPS_VERSION="2"
CPUSPEED="0"
HOSTNAME="amp02"
HYPERVISOR="kvm"
IM_MAD="kvm"
KVM_CPU_FEATURES=""
KVM_CPU_MODEL="Neoverse-N1"
KVM_CPU_MODELS="" # <--- missing field
KVM_MACHINES=""
RESERVED_CPU=""
RESERVED_MEM=""
TOTALCPU="16000"
TOTALMEMORY="31333328"
VERSION="6.99.85"
VM_MAD="kvm"
To Reproduce Install OpenNebula on ARM architecture. And display the host info.
Expected behavior On the host the following CPU architectures are supported by qemu, that should be propagated to the host descriptor:
# qemu-system-aarch64 -cpu help
Available CPUs:
a64fx
arm1026
arm1136
arm1136-r2
arm1176
arm11mpcore
arm926
arm946
cortex-a15
...
Details
- Affected Component: Monitoring
- Hypervisor: KVM
- Version: 6.99.85
Additional context
# virsh cpu-models aarch64
all CPU models are accepted
~/remotes$ ./im/kvm-probes.d/host/system/machines_models.rb
KVM_MACHINES=""
KVM_CPU_MODELS=""
KVM_CPU_MODEL="Neoverse-N1"
~/remotes$ ./im/qemu-probes.d/host/system/machines_models.rb
KVM_MACHINES=""
KVM_CPU_MODELS=""
KVM_CPU_MODEL="Neoverse-N1"
# virsh -r -c qemu:///system cpu-models arm64
error: failed to get CPU model names
error: invalid argument: cannot find architecture arm64
# virsh -r -c qemu:///system cpu-models aarch64
all CPU models are accepted
I also observed that without filling in the CPU_MODEL/MODEL in the VM template (e.g. "host-passthrough", or any above listed supported CPU model), the VM cannot instantiate with the below error:
less /var/log/one/3.log
error: internal error: QEMU unexpectedly closed the monitor (vm='one-3'):
qemu-kvm-one: KVM is not supported for this guest CPU type
qemu-kvm-one: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument
Could not create domain from /var/lib/one//datastores/0/3/deployment.0
Not sure if this is the same reason, though, but I think it is very likely. We would need to verify where does a default CPU_MODEL type comes from, if not specified. If it is decided based on the KVM_CPU_MODELS, then it is the same problem.
Progress Status
- [ ] Code committed
- [ ] Testing - QA
- [ ] Documentation (Release notes - resolved issues, compatibility, known issues)
This can be used as a fallback mechanism if we are in aarch64
qemu-system-aarch64 -cpu help