Configuring emulators

Running emulators in background

The emulators run as interactive processes attached to the terminal by default. You can create a systemd service to run the emulators in background. For each emulator create a systemd unit file and update full path to sushy-static or sushy-emulator binary and adjust arguments as necessary, for example:

Description=Sushy Libvirt emulator

ExecStart=/<full-path>/sushy-emulator --port 8000 --libvirt-uri "qemu:///system"

If you want to run emulators with different configuration, for example, sushy-static emulator with different mockup files, then create a new systemd unit file.

You can also use gunicorn to run sushy-emulator, for example:

ExecStart=/usr/bin/gunicorn sushy_tools.emulator.main:app

Using configuration file

Besides command-line options, sushy-emulator can be configured via a configuration file. The tool uses Flask application configuration infrastructure, emulator-specific configuration options are prefixed with SUSHY_EMULATOR_ to make sure they won’t collide with Flask’s own configuration options.

The configuration file itself can be specified through the SUSHY_EMULATOR_CONFIG environment variable.

The full list of supported options and their meanings could be found in the sample configuration file:

# sushy emulator configuration file build on top of Flask application
# configuration infrastructure:

# Listen on all local IP interfaces

# Bind to TCP port 8000

# Serve this SSL certificate to the clients

# If SSL certificate is being served, this is its RSA private key

# If authentication is desired, set this to an htpasswd file.

# The OpenStack cloud ID to use. This option enables OpenStack driver.

# The libvirt URI to use. This option enables libvirt driver.
SUSHY_EMULATOR_LIBVIRT_URI = u'qemu:///system'

# Instruct the libvirt driver to ignore any instructions to
# set the boot device. Allowing the UEFI firmware to instead
# rely on the EFI Boot Manager
# Note: This sets the legacy boot element to dev="fd"
# and relies on the floppy not existing, it likely wont work
# your VM has a floppy drive.

# The map of firmware loaders dependant on the boot mode and
# system architecture
    u'UEFI': {
        u'x86_64': u'/usr/share/OVMF/OVMF_CODE.fd',
        u'aarch64': u'/usr/share/AAVMF/AAVMF_CODE.fd'
    u'Legacy': {
        u'x86_64': None,
        u'aarch64': None

# This map contains statically configured Redfish Chassis linked
# up with the Systems and Managers enclosed into this Chassis.
# The first chassis in the list will contain all other resources.
# If this map is not present in the configuration, a single default
# Chassis is configured automatically to enclose all available Systems
# and Managers.
        u'Id': u'Chassis',
        u'Name': u'Chassis',
        u'UUID': u'48295861-2522-3561-6729-621118518810'

# This map contains statically configured Redfish IndicatorLED
# resource state ('Lit', 'Off', 'Blinking') keyed by UUIDs of
# System and Chassis resources.
# If this map is not present in the configuration, each
# System and Chassis will have their IndicatorLED `Lit` by default.
# Redfish client can change IndicatorLED state. The new state
# is volatile, i.e. it's maintained in process memory.
#    u'48295861-2522-3561-6729-621118518810': u'Blinking'

# This map contains statically configured virtual media resources.
# These devices ('Cd', 'Floppy', 'USBStick') will be exposed by the
# Manager(s) and possibly used by the System(s) if system emulation
# backend supports boot image configuration.
# If this map is not present in the configuration, the following configuration
# is used:
    u'Cd': {
        u'Name': 'Virtual CD',
        u'MediaTypes': [
    u'Floppy': {
        u'Name': u'Virtual Removable Media',
        u'MediaTypes': [

# Instruct the virtual media insertion not to verify the SSL certificate
# when retrieving the image.

# This map contains statically configured Redfish Storage resource linked
# up with the Systems resource, keyed by the UUIDs of the Systems.
    "da69abcc-dae0-4913-9a7b-d344043097c0": [
            "Id": "1",
            "Name": "Local Storage Controller",
            "StorageControllers": [
                    "MemberId": "0",
                    "Name": "Contoso Integrated RAID",
                    "SpeedGbps": 12
            "Drives": [

# This map contains statically configured Redfish Drives resource. The Drive
# objects are keyed in a composite fashion using a tuple of the form
# (System_UUID, Storage_ID) referring to the UUID of the System and Id of the
# Storage resource, respectively, to which the drive belongs.
    ("da69abcc-dae0-4913-9a7b-d344043097c0", "1"): [
            "Id": "32ADF365C6C1B7BD",
            "Name": "Drive Sample",
            "CapacityBytes": 899527000000,
            "Protocol": "SAS"

# This map contains dynamically configured Redfish Volume resource backed
# by the libvirt virtualization backend of the dynamic Redfish emulator.
# The Volume objects are keyed in a composite fashion using a tuple of the
# form (System_UUID, Storage_ID) referring to the UUID of the System and ID
# of the Storage resource, respectively, to which the Volume belongs.
# Only the volumes specified in the map or created via a POST request are
# allowed to be emulated upon by the emulator. Volumes other than these can
# neither be listed nor deleted.
# The Volumes from map missing in the libvirt backend will be created
# dynamically in the pool name specified (provided the pool exists in the
# backend). If the pool name is not specified, the volume will be created
# automatically in pool named 'default'.
    ('da69abcc-dae0-4913-9a7b-d344043097c0', '1'): [
            "libvirtPoolName": "sushyPool",
            "libvirtVolName": "testVol",
            "Id": "1",
            "Name": "Sample Volume 1",
            "VolumeType": "Mirrored",
            "CapacityBytes": 23748
            "libvirtPoolName": "sushyPool",
            "libvirtVolName": "testVol1",
            "Id": "2",
            "Name": "Sample Volume 2",
            "VolumeType": "StripedWithParity",
            "CapacityBytes": 48395

# This list contains the identities of instances that the driver will filter by.
# It is useful in a tenant environment where only some instances represent
# virtual baremetal.