Pick guest CPU architecture based on host arch.

Registered by Kashyap Chamarthy on 2019-06-06

Currently, in many places, Nova's libvirt driver makes decisions on how
to configure guest XML based on *host* CPU architecture
("caps.host.cpu.arch"). That is not optimal in all cases. So all of
the said code needs to be reworked to make those decisions based on
*guest* CPU architecture (i.e. "guest.arch", which should be set based
on the image metadata property, `hw_architecture`). A related piece of
work is to distinguish between hosts that can do AArch64 (or PPC64, etc)
via KVM (which is hardware-accelerated) vs. those that can only do it
via plain emulation ("TCG") — this is to ensure that guests are not
arbitrarily scheduled on hosts that are incapable of hardware
acceleration, thus losing out on performance-related benefits.

This rework will make sure that we will: pick the correct QEMU binary
for a guest with different CPU architecture than the host; choose the
correct QEMU machine type for an x86_64 guest running on an AArch64
host; and so forth.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Kashyap Chamarthy
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

for selecting host with hardware virturlaiation e.g. kvm
you should be able to use
the vm_mode image metadata property unless that is broken.

https://github.com/openstack/glance/blob/master/etc/metadefs/compute-hypervisor.json#L30-L41

we cant test that in the gate because we dont have nested virt.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.