Configure Ethernet Interfaces on SR-IOV interface Using the CLIΒΆ

You can create new ethernet interfaces on an SR-IOV interface and attach them to platform networks using the CLI.

Procedure

  1. Lock the host.

    ~(keystone_admin)$ system host-lock controller-0
    

    To list all interfaces, use the system host-if-list command and include the -a flag.

    For example:

    ~(keystone_admin)$ system host-if-list controller-0
    +-----------+----------+-----------+----------+------+---------------+-------------+--------------------------------+------------+
    | uuid      | name     | class     | type     | vlan | ports         | uses i/f    | used by i/f                    | attributes |
    |           |          |           |          | id   |               |             |                                |            |
    +-----------+----------+-----------+----------+------+---------------+-------------+--------------------------------+------------+
    | 0c4b1cc...| sriov00  | pci-sriov | vf       | None | []            | [u'sriov0'] | []                             | MTU=1500   |
    | 3a191c4...| oam0     | platform  | vlan     | 200  | []            | [u'sriov0'] | []                             | MTU=1500   |
    | b295ee9...| sriov01  | pci-sriov | vf       | None | []            | [u'sriov0'] | []                             | MTU=1500   |
    | c178445...| mgmt0    | platform  | vlan     | 157  | []            | [u'sriov0'] | []                             | MTU=1500   |
    | d71ed2f...| sriov0   | pci-sriov | ethernet | None | [u'enp3s0f0'] | []          | [u'cluster0', u'sriov00',      | MTU=1500   |
    |           |          |           |          |      |               |             | u'sriov01', u'mgmt0', u'oam0'] |            |
    |           |          |           |          |      |               |             |                                |            |
    | e7bd04f...| cluster0 | platform  | vlan     | 158  | []            | [u'sriov0'] | []                             | MTU=1500   |
    +-----------+----------+-----------+----------+------+---------------+-------------+--------------------------------+------------+
    
  2. Create an Ethernet interface.

    Use the host-if-add command with the following options:

    ~(keystone_admin)$ system host-if-add <hostname> -c platform <interfacename> ethernet <ethname>
    

    Where:

    interfacename

    is the name or UUID for the interface (Required).

    hostname

    is the name or UUID of the host.

    ethname

    is the name of the SR-IOV interface.

    For example:

    ~(keystone_admin)$ system host-if-add controller-0 -c platform pxeboot0 ethernet sriov0
    +-----------------+--------------------------------------+
    | Property        | Value                                |
    +-----------------+--------------------------------------+
    | ifname          | pxeboot0                             |
    | iftype          | ethernet                             |
    | ports           | []                                   |
    | imac            | 00:1e:67:e6:c0:92                    |
    | imtu            | 1500                                 |
    | ifclass         | platform                             |
    | ptp_role        | none                                 |
    | aemode          | None                                 |
    | schedpolicy     | None                                 |
    | txhashpolicy    | None                                 |
    | uuid            | 1a511695-3514-49fb-8f1d-4f9d88e26949 |
    | ihost_uuid      | bfaa02c2-61e8-4da8-beac-d5f3a93decef |
    | vlan_id         | None                                 |
    | uses            | [u'sriov0']                          |
    | used_by         | []                                   |
    | created_at      | 2021-02-18T11:17:21.482023+00:00     |
    | updated_at      | None                                 |
    | sriov_numvfs    | 0                                    |
    | sriov_vf_driver | None                                 |
    | max_tx_rate     | None                                 |
    | ipv4_mode       | None                                 |
    | ipv6_mode       | None                                 |
    | accelerated     | []                                   |
    +-----------------+--------------------------------------+
    
    ~(keystone_admin)$ system host-if-list controller-0
    +----------+----------+-----------+----------+------+---------------+-------------+---------------------------------+------------+
    | uuid     | name     | class     | type     | vlan | ports         | uses i/f    | used by i/f                     | attributes |
    |          |          |           |          | id   |               |             |                                 |            |
    +----------+----------+-----------+----------+------+---------------+-------------+---------------------------------+------------+
    | 0c4b1cc  | sriov00  | pci-sriov | vf       | None | []            | [u'sriov0'] | []                              | MTU=1500   |
    | 1a51169  | pxeboot0 | platform  | ethernet | None | []            | [u'sriov0'] | []                              | MTU=1500   |
    | 3a191c4  | oam0     | platform  | vlan     | 200  | []            | [u'sriov0'] | []                              | MTU=1500   |
    | b295ee9  | sriov01  | pci-sriov | vf       | None | []            | [u'sriov0'] | []                              | MTU=1500   |
    | c178445  | mgmt0    | platform  | vlan     | 157  | []            | [u'sriov0'] | []                              | MTU=1500   |
    | d71ed2f  | sriov0   | pci-sriov | ethernet | None | [u'enp3s0f0'] | []          | [u'cluster0', u'pxeboot0',      | MTU=1500   |
    |          |          |           |          |      |               |             | u'sriov00', u'sriov01', u'oam0' |            |
    |          |          |           |          |      |               |             | , u'mgmt0']                     |            |
    |          |          |           |          |      |               |             |                                 |            |
    | e7bd04f  | cluster0 | platform  | vlan     | 158  | []            | [u'sriov0'] | []                              | MTU=1500   |
    +----------+----------+-----------+----------+------+---------------+-------------+---------------------------------+------------+
    
  3. Attach the ethernet interface to a platform network.

    ~(keystone_admin)$ system interface-network-assign <hostname> <interface> <name> <network>
    

    For example:

    ~(keystone_admin)$ system interface-network-assign controller-0 pxeboot0 pxeboot
    
  4. Unlock the host.

    ~(keystone_admin)$ system host-unlock controller-0