virt: detect Alibaba Cloud ECS as KVM
Alibaba Cloud ECS instances expose "Alibaba Cloud ECS" in DMI product_name/bios_vendor and "Alibaba Cloud" in sys_vendor. None of these match dmi_vendor_table[], so systemd-detect-virt --vm reports "none" on these machines, even though they run on a KVM-based hypervisor. This is especially visible on ARM64 instances, where the CPUID fallback does not exist (x86 only) and /proc/device-tree is not populated. Add "Alibaba Cloud ECS" to dmi_vendor_table[], mapping to VIRTUALIZATION_KVM. The narrower prefix avoids matching the bare "Alibaba Cloud" sys_vendor value, reducing the false-positive surface for Alibaba's bare-metal (X-Dragon) instances compared to the original broader prefix. bios_vendor also carries the same string on ECS VMs though, so the protection is not complete — fully resolving the VM-vs-bare-metal ambiguity would need the SMBIOS BIOS-Characteristics bit check that the Amazon EC2 entry uses. The existing "back to DMI" fallback path in detect_vm() reports "kvm" on both x86 and ARM64.
This commit is contained in:
@@ -180,6 +180,7 @@ static Virtualization detect_vm_dmi_vendor(void) {
|
||||
{ "KVM", VIRTUALIZATION_KVM },
|
||||
{ "OpenStack", VIRTUALIZATION_KVM }, /* Detect OpenStack instance as KVM in non x86 architecture */
|
||||
{ "KubeVirt", VIRTUALIZATION_KVM }, /* Detect KubeVirt instance as KVM in non x86 architecture */
|
||||
{ "Alibaba Cloud ECS", VIRTUALIZATION_KVM }, /* narrower than bare "Alibaba Cloud" sys_vendor */
|
||||
{ "Amazon EC2", VIRTUALIZATION_AMAZON },
|
||||
{ "QEMU", VIRTUALIZATION_QEMU },
|
||||
{ "VMware", VIRTUALIZATION_VMWARE }, /* https://kb.vmware.com/s/article/1009458 */
|
||||
|
||||
Reference in New Issue
Block a user