summaryrefslogtreecommitdiffstats
path: root/networking-odl/doc/source/devref/hostconfig.rst
blob: 70c8607b245c2df07e41e1d889ca95cf26875722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Host Configuration
==================

Overview
--------

ODL is agentless configuration. In this scenario Host Configuration is used
to specify the physical host type and other configurations for the host
system. This information is populated by the Cloud Operator is in OVSDB in
Open_vSwitch configuration data in the external_ids field as a key value pair.
This information is then read by ODL and made available to networking-odl
through REST API. Networking-odl populates this information in agent_db in
Neutron and is then used by Neutron scheduler. This information is required
for features like Port binding and Router scheduling.

Refer to this link for detailed design for this feature.

https://docs.google.com/presentation/d/1kq0elysCDEmIWs3omTi5RoXTSBbrewn11Je2d26cI4M/edit?pref=2&pli=1#slide=id.g108988d1e3_0_6

Related ODL changes:

https://git.opendaylight.org/gerrit/#/c/36767/

https://git.opendaylight.org/gerrit/#/c/40143/

Host Configuration fields
-------------------------

- host-id

This represents host identification string. This string will be stored in
external_ids field with the key as odl_os_hostconfig_hostid.
Refer to Neutron config definition for host field for details on this field.

http://docs.openstack.org/kilo/config-reference/content/section_neutron.conf.html

- host-type

The field is for type of the node. This value corresponds to agent_type in
agent_db. Example value are “ODL L2” and “ODL L3” for Compute and Network node
respectively. Same host can be configured to have multiple configurations and
can therefore can have both L2, L3 and other configurations at the same time.
This string will be populated by ODL based on the configurations available
on the host. See example in section below.

- config

This is the configuration data for the host type. Since same node can be
configured to store multiple configurations different external_ids key value
pair are used to store these configuration. The external_ids with keys as
odl_os_hostconfig_config_odl_XXXXXXXX store different configurations.
8 characters after the suffix odl_os_hostconfig_config_odl are host type.
ODL extracts these characters and store that as the host-type fields. For
example odl_os_hostconfig_config_odl_l2, odl_os_hostconfig_config_odl_l3 keys
are used to provide L2 and L3 configurations respectively. ODL will extract
"ODL L2" and "ODL L3" as host-type field from these keys and populate
host-type field.

Config is a Json string. Some examples of config:

::

    {“supported_vnic_types”: [{
            “vnic_type”: “normal”,
            “vif_type”: “ovs”,
            “vif_details”: “{}”
        }]
        “allowed_network_types”: ["local", "gre", "vlan", "vxlan"]”,
        “bridge_mappings”: {“physnet1":"br-ex”}
   }"

   {“supported_vnic_types”: [{
            “vnic_type”: “normal”,
            “vif_type”: “vhostuser”,
            “vif_details”: “{“port_filter”: “False”, “vhostuser_socket”: “/var/run/openvswitch”}”
        }]
        “allowed_network_types”: ["local", "gre", "vlan", "vxlan"]”,
        “bridge_mappings”: {“physnet1":"br-ex”}
   }"

**Host Config URL**

Url : http://ip:odlport/restconf/operational/neutron:neutron/hostconfigs/

**Commands to setup host config in OVSDB**
::

 export OVSUUID=$(ovs-vsctl get Open_vSwitch . _uuid)
 ovs-vsctl set Open_vSwitch $OVSUUID external_ids:odl_os_hostconfig_hostid=test_host
 ovs-vsctl set Open_vSwitch $OVSUUID external_ids:odl_os_hostconfig_config_odl_l2 =
 "{“supported_vnic_types”: [{“vnic_type”: “normal”, “vif_type”: “ovs”, "vif_details": {} }], “allowed_network_types”: [“local”], “bridge_mappings”: {“physnet1":"br-ex”}}"

Example for host configuration
-------------------------------

::

  {
  "hostconfigs": {
    "hostconfig": [
      {
        "host-id": "test_host1",
        "host-type": "ODL L2",
        "config":
        "{“supported_vnic_types”: [{
            “vnic_type”: “normal”,
            “vif_type”: “ovs”,
            “vif_details”: {}
        }]
        “allowed_network_types”: ["local", "gre", "vlan", "vxlan"],
        “bridge_mappings”: {“physnet1":"br-ex”}}"
      },
      {
        "host-id": "test_host2",
        "host-type": "ODL L3",
        "config": {}
      }]
    }
  }