stackhpc / sib-kayobe-config

Kayobe configuration for SIB OpenStack development
Apache License 2.0
1 stars 1 forks source link

switch sends port-id in wrong format via lldp #10

Open jovial opened 5 years ago

jovial commented 5 years ago

The switch sends a port id in a format that you cannot use in CLI commands:

 "interfaces": {
    "em1": {
      "ip": "10.12.8.14",
      "mac": "84:8f:69:ff:27:78",
      "lldp_processed": {
        "switch_port_id": "1/0/6",
        "switch_system_name": "ethsw-dell-6224-1",
        "switch_chassis_id": "5c:26:0a:cf:ff:14",
        "switch_port_description": "compute-5"
      },
      "client_id": null,
      "pxe": true
    },
    "em2": {
      "ip": null,
      "mac": "84:8f:69:ff:27:79",
      "client_id": null,
      "pxe": false
    }
  }

The result is that the switch info is set incorrectly on the ironic port (by inspector):

(openstack) [stack@control-0 ~]$ openstack baremetal port list --node compute-5 --long
+--------------------------------------+-------------------+---------------------------+-------+--------------------------------------+--------------------------------------------------------------------------------------------------+----------------+------------------+------------------+---------------------------+---------------+
| UUID                                 | Address           | Created At                | Extra | Node UUID                            | Local Link Connection                                                                            | Portgroup UUID | PXE boot enabled | Physical Network | Updated At                | Internal Info |
+--------------------------------------+-------------------+---------------------------+-------+--------------------------------------+--------------------------------------------------------------------------------------------------+----------------+------------------+------------------+---------------------------+---------------+
| 574a984c-6e3c-4d07-8f26-42b6cd27802d | 84:8f:69:ff:27:78 | 2018-09-17T11:19:52+00:00 |       | abde74a2-b8fa-48b4-9094-7e3efdf17e5c | {u'switch_info': u'ethsw-dell-6224-1', u'port_id': u'1/0/6', u'switch_id': u'5c:26:0a:cf:ff:14'} | None           | True             | physnet1         | 2018-09-17T11:19:53+00:00 | {}            |
| b45bb7aa-701b-4305-9fa8-885d0fbad9d5 | 84:8f:69:ff:27:79 | 2018-09-17T11:19:52+00:00 |       | abde74a2-b8fa-48b4-9094-7e3efdf17e5c | {}                                                                                               | None           | False            | None             | None                      | {}            |
+--------------------------------------+-------------------+---------------------------+-------+--------------------------------------+--------------------------------------------------------------------------------------------------+----------------+------------------+------------------+---------------------------+---------------+

The workaround is to fix up the port id after the fact:

(kayobe) [stackhpc@seed kayobe-config$ kayobe playbook run $PWD/ansible/switch-port-fixup.yml