Package: src:ganeti
Severity: wishlist

Dear Maintainer,

The ganeti packages are available for arm64, but they are not fully
functional, as they have some x86 and PCI assumptions. That said, there
are not many things to fix to get it working. It basically needs a
wrapper to mangle the qemu arguments and to abuse the kvm_extra option
to create the flash devices.

You will find attached a wrapper for qemu-system-aarch64 to mangle
option. In addition, the following options are needed for the instance:

    cpu_type: default (host)
    kvm_extra: -drive 
file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on 
-drive file=/shared/path/nvram/machine-name_VARS.fd,if=pflash,format=raw,unit=1

It would be nice if at some point those changes can be done directly
into ganeti.

Thanks,
Aurelien
#!/bin/bash

##
## Wrapper to call qemu-system-aarch64 from Ganeti, removing all x86/PCI
## assumptions.
##

# With qemu-system-aarch64 the machine should be defined even for simple
# commands like querying the list of devices.
args=("-machine")
args+=("virt")

# We want to always enable KVM. Contrary to what the Ganeti's documentation
# says, enabling kvm_flag is not enough.
args+=("-enable-kvm")

while [ "$1" ]; do
    case "$1" in
        -machine|-M)
            # Ignore the machine argument (it is already defined above),
            # except when querying the list of machines
            if [ "$2" = "?" ] ; then
                args+=("-M")
                args+=("?")
            fi
            shift
            ;;
        *)
            # Replace PCI devices by their bus agnostic variant, and drop
            # all the PCI related options
            args+=("$(echo $1 | sed -e 
's/virtio-\(\w\+\)-pci/virtio-\1-device/' -e 's/,bus=[^,]\+,addr=[^,]\+//')")
            ;;
    esac
    shift
done

exec /usr/bin/qemu-system-aarch64 "${args[@]}"

Reply via email to