5. Configuration

5.1. Virtual Server Configuration file

There’s one central virtual server configuration file which is /etc/infrasim/infrasim.yml (source code). All adjustable parameters are defined in this file. This is the only file to modify if you want to customize or make adjustment on the virtual server node. While not all supported options are explicitly listed in this file for purpose of simplicity. However there’s one example configuration file - /etc/infrasim.full.yml.example (source code) - listed all supported parameters and definitions. By referring content in example file, you can modify real file infrasim.yml and then restart infrasim-main service and then new properties will take effect.

Here’s full list of the example configuration file; every single key-value pair is supported to be add/modify in your real-in-use infrasim.yml:

# This example virtual server configuration file intends to throughout
# list parameters and properties that infrasim-compute virtual server
# supports to adjust. In most cases it is fine to use default value
# for particuar configuration by skipping putting it into infrasim.yml
# configuration file. For anything item you're interested, it is recommended
# to look up infomation here first. For example, if you'd like to customize
# properties of your drive - either serial number or vender - in below there're
# corresponding item to show how to achieve that.

# Unique identifier
name: node-0

# Node type is mandatory
# Node type of your infrasim compute, this will determine the
# bmc emulation data and bios binary to use.
# Supported compute node names:
#  quanta_d51
#  quanta_t41
#  dell_c6320
#  dell_r630
#  dell_r730
#  dell_r730xd
#  s2600kp - Rinjin KP
#  s2600tp - Rinjin TP
#  s2600wtt - Node of Hydra, Python
type: quanta_d51

compute:
    # n - Network (PXE); c - CD-ROM;
    # d - Drive (bootindex in drive sections controls order of booting HDD)
    boot_order: ncd
    kvm_enabled: true
    numa_control: true
    cpu:
        model: host
        features: +vmx
        quantities: 8
    memory:
        size: 4096
    # Currently the PCI bridge is only designed for megasas storage controller
    # When you create multiple megasas controller, the controllers will be assigned
    # a different pci bus number
    pci_bridge_topology:
        -
            device: i82801b11-bridge
            addr: 0x1e.0x0
            multifunction: on
                -
                    device: pci-bridge
                    chassis_nr: 0x1
                    msi: false
                    addr: 0x1
    storage_backend:
        -
            controller:
                type: ahci
                max_drive_per_controller: 6
                drives:
                -
                    model: SATADOM
                    serial: HUSMM142
                    bootindex: 1
                    # To boot esxi, please set ignore_msrs to Y
                    # sudo -i
                    # echo 1 > /sys/module/kvm/parameters/ignore_msrs
                    # cat /sys/module/kvm/parameters/ignore_msrs
                    file: chassis/node1/esxi6u2-1.qcow2
                -
                    vendor: Hitachi
                    model: HUSMM0SSD
                    serial: 0SV3XMUA
                    # To set rotation to 1 (SSD), need some customization
                    # on qemu
                    # rotation: 1
                    # Use RAM-disk to accelerate IO
                    file: /dev/ram0
                -
                    vendor: Samsung
                    model: SM162521
                    serial: S0351X2B
                    # Create your disk image first
                    # e.g. qemu-img create -f qcow2 sda.img 2G
                    file: chassis/node1/sda.img
                -
                    vendor: Samsung
                    model: SM162521
                    serial: S0351X3B
                    file: chassis/node1/sdb.img
                -
                    vendor: Samsung
                    model: SM162521
                    serial: S0451X2B
                    file: chassis/node1/sdc.img
        -
            controller:
                type: megasas-gen2
                use_jbod: true
                use_msi: true
                max_cmds: 1024
                max-sge: 128
                max_drive_per_controller: 1
                drives:
                    -
                        vendor: HITACHI
                        product: HUSMM168XXXXX
                        serial: SN0500010351XXX
                        rotation: 1
                        slot_number: 0
                        wwn: 0x50000ccaxxxxxxxx
                        file: <path/to/your disk file>

    networks:
        -
            network_mode: bridge
            # Bridge need to be prepared beforehand with brctl
            network_name: br0
            device: vmxnet3
            mac: 00:60:16:9e:a8:e9
        -
            network_mode: nat
            device: e1000
    ipmi:
        interface: bt
        chardev:
            backend: socket
            host: 127.0.0.1
            reconnect: 10
        ioport: 0xca8
        irq: 10
    smbios: chassis/node1/quanta_d51_smbios.bin
    monitor:
        mode: control
        chardev:
            backend: socket
            server: on
            wait: off
            path: <path/to/your/sock file>
    # set vnc display <X>
    vnc_display: 1
bmc:
    interface: br0
    username: admin
    password: admin
    address: <ip address>
    channel: 1
    lancontrol: <path/to/lan control script>
    chassiscontrol: <path/to/chassis control script>
    startcmd: <cmd to be excuted>
    startnow: true
    poweroff_wait: 5
    kill_wait: 5
    historyfru: 20
    config_file: <path/to/your config file>
    emu_file: chassis/node1/quanta_d51.emu
    ipmi_over_lan_port: 623

# SSH to this port to visit ipmi-console
ipmi_console_ssh: 9300

# Renamed from telnet_listen_port to ipmi_console_port, extracted from bmc
# ipmi-console talk with vBMC via this port
ipmi_console_port: 9000

# Used by ipmi_sim and qemu
bmc_connection_port: 9100

# Used by socat and qemu
serial_port: 9003

Up to infrasim-compute commit ef289c55

  • name

    This attribute defines nodes name, which is a unique identifier for infrasim-compute instances on the same platform. More specifically, it is used as workspace folder name.

    NOT Mandatory

    Default: “node-0”

    Legal Value: String

  • type

    This attribute defines supported nodes type in InfraSIM. With this attribute, infrasim-compute will set BMC emulation data for ipmi_sim and BIOS binary for qemu accordingly, you can get corresponding .emu and .bin in /usr/local/etc/infrasim/ by default.

    Mandatory

    Legal Values:

    • “quanta_d51”
    • “quanta_t41”
    • “dell_c6320”
    • “dell_r630”
    • “dell_r730”
    • “dell_r730xd”
    • “s2600kp”, for Rinjin KP
    • “s2600tp”, for Rinjin TP
    • “s2600wtt”, for Hydra, Python
  • compute

    This block defines all attributes used by qemu. They will finally be translated to one or more qemu command options. The module infrasim.model.CCompute is handling this translation. This is much like a definition for libvert, but we may want it to be lite, and compatible with some customized qemu feature in InfraSIM.

  • compute:boot_order

    This attribute defines boot order for qemu. Will be translated to -boot {boot_order}.

    Not Mandatory

    Default: “ncd”, means in a order of pxe > cdrom > default.

    Legal Value: See -boot in qemu-doc.

  • compute:kvm_enabled

    This attribute enable kvm when you announce it as True and your system supports kvm. It will be translated to --enable-kvm. You can check if your system supports kvm by check if /dev/kvm exists.

    Not Mandatory

    Default: Depends on if /dev/kvm exists.

    Boolean Table

    kvm_enabled /dev/kvm –enable-kvm
    true yes yes
    true no no
    false yes no
    false no no
    not define yes yes
    not define no no
  • compute:numa_control

    This attribute enable NUMA to improve InfraSIM performance by binding to certain physical cpu. If you have installed numactl and set this attribute to True, you will run qemu in a way like numactl --physcpubind={cpu_list} --localalloc.

    Not Mandatory

    Default: Disabled

  • compute:cpu

    This group of attributes set qemu cpu characteristics. The module infrasim.model.CCPU is handling the information.

  • compute:cpu:model

    This attribute sets qemu cpu model.

    Not Mandatory

    Default: “host”

    Legal Values: See -cpu model in qemu-doc.

  • compute:cpu:features

    This attribute adds or removes cpu flags according to your customization. It will be translated to -cpu Haswell,+vmx for example.

    Not Mandatory

    Default: “+vmx”

    Legal Values: See -cpu model in qemu-doc.

  • compute:cpu:quantities

    This attribute sets virtual cpu numbers in all. With default socket 2, CCPU calculates core per socket. Default set to 1 thread per cores. It will be translated to -smp {cpus},sockets={sockets},cores={cores},threads=1 for example.

    Not Mandatory

    Default: 2

    Legal Values: See -smp in qemu-doc.

  • compute:memory
  • compute:memory:size
  • compute:storage_backend
  • compute:storage_backend:-:controller
  • compute:storage_backend:-:controller:type
  • compute:storage_backend:-:controller:max_drive_per_controller
  • compute:storage_backend:-:controller:use_jbod
  • compute:storage_backend:-:controller:use_msi
  • compute:storage_backend:-:controller:max_cmds
  • compute:storage_backend:-:controller:max-sge
  • compute:storage_backend:-:controller:drives
  • compute:storage_backend:-:controller:drives:-:model
  • compute:storage_backend:-:controller:drives:-:serial
  • compute:storage_backend:-:controller:drives:-:bootindex
  • compute:storage_backend:-:controller:drives:-:file
  • compute:storage_backend:-:controller:drives:-:vendor
  • compute:storage_backend:-:controller:drives:-:rotation
  • compute:networks
  • compute:networks:-:network_mode
  • compute:networks:-:network_name
  • compute:networks:-:device
  • compute:networks:-:mac
  • compute:ipmi
  • compute:ipmi:interface
  • compute:ipmi:chardev
  • compute:ipmi:chardev:backend
  • compute:ipmi:chardev:host
  • compute:ipmi:chardev:reconnect
  • compute:ipmi:ioport
  • compute:ipmi:Irq
  • compute:smbios
  • compute:monitor
  • compute:monitor:mode
  • compute:monitor:chardev
  • compute:monitor:chardev:backend
  • compute:monitor:chardev:server
  • compute:monitor:chardev:wait
  • compute:monitor:chardev:path
  • compute:vnc_display
  • bmc
  • bmc:interface
  • bmc:username
  • bmc:password
  • bmc:address
  • bmc:channel
  • bmc:lancontrol
  • bmc:chassiscontrol
  • bmc:startcmd
  • bmc:startnow
  • bmc:poweroff_wait
  • bmc:historyfru
  • bmc:config_file
  • bmc:emu_file
  • bmc:ipmi_over_lan_port
  • ipmi_console_ssh
  • ipmi_console_port
  • bmc_connection_port
  • serial_port

5.2. Networking

  1. Virtual server NAT or host-only mode, this is default mode implemented in infrasim-compute
    • vCompute is accessible ONLY inside Ubuntu host
    • Software running in vCompute can access outside network if connecting Ubuntu host NIC with virtual bridge
    • Configuration YAML file can specify which NIC IPMI over LAN traffic flows through
    _images/networking_nat.PNG
  2. Bridge mode - single
    • Work as virtual switch
    • Connect BMC NIC and NICs in virtual compute together
    • Configuration YAML file controls how many NICs that virtual compute has and specify bridge they connect to
    _images/networking_bridge_single.PNG

    Note

    It requires setting up bridge and connect to NIC of underlying host in advance.

    Here’s steps for this example:

    # brctl addr br0
    # brctl addif br0 eth1
    # brctl setfd br0 0
    # brctl sethello < bridge name > 1
    # brctl stp br0 no
    # ifup br0
    
  3. Bridge mode - multiple

    _images/networking_bridge_multiple.PNG