Post-v2.8.0
--------------------
- - Nothing yet.
+ - OVN:
+ * The "requested-chassis" option for a logical switch port now accepts a
+ chassis "hostname" in addition to a chassis "name".
v2.8.0 - xx xxx xxxx
---------------------
if (ctx->ovnsb_idl_txn) {
const char *vif_chassis = smap_get(&binding_rec->options,
"requested-chassis");
- bool can_bind = !vif_chassis || !vif_chassis[0] ||
- !strcmp(vif_chassis, chassis_rec->name);
+ bool can_bind = !vif_chassis || !vif_chassis[0]
+ || !strcmp(vif_chassis, chassis_rec->name)
+ || !strcmp(vif_chassis, chassis_rec->hostname);
if (can_bind && our_chassis) {
if (binding_rec->chassis != chassis_rec) {
</p>
<column name="options" key="requested-chassis">
- If set, identifies a specific chassis (by name) that is allowed to
- bind this port. Using this option will prevent thrashing between
- two chassis trying to bind the same port during a live migration.
- It can also prevent similar thrashing due to a mis-configuration,
- if a port is accidentally created on more than one chassis.
+ If set, identifies a specific chassis (by name or hostname) that
+ is allowed to bind this port. Using this option will prevent
+ thrashing between two chassis trying to bind the same port during
+ a live migration. It can also prevent similar thrashing due to a
+ mis-configuration, if a port is accidentally created on more than
+ one chassis.
</column>
<column name="options" key="qos_max_rate">
</p>
<column name="options" key="requested-chassis">
- If set, identifies a specific chassis (by name) that is allowed to
- bind this port. Using this option will prevent thrashing between
- two chassis trying to bind the same port during a live migration.
- It can also prevent similar thrashing due to a mis-configuration,
- if a port is accidentally created on more than one chassis.
+ If set, identifies a specific chassis (by name or hostname) that
+ is allowed to bind this port. Using this option will prevent
+ thrashing between two chassis trying to bind the same port during
+ a live migration. It can also prevent similar thrashing due to a
+ mis-configuration, if a port is accidentally created on more than
+ one chassis.
</column>
<column name="options" key="qos_max_rate">
OVN_CLEANUP([hv1],[hv2])
AT_CLEANUP
+
+AT_SETUP([ovn -- options:requested-chassis with hostname])
+
+ovn_start
+
+ovn-nbctl ls-add ls0
+ovn-nbctl lsp-add ls0 lsp0
+
+net_add n1
+sim_add hv1
+as hv1
+ovs-vsctl add-br br-phys
+ovn_attach n1 br-phys 192.168.0.11
+ovs-vsctl -- add-port br-int hv1-vif0
+
+hv1_hostname=$(ovn-sbctl --bare --columns hostname find Chassis name=hv1)
+echo "hv1_hostname=${hv1_hostname}"
+ovn-nbctl --wait=hv --timeout=3 lsp-set-options lsp0 requested-chassis=${hv1_hostname}
+as hv1 ovs-vsctl set interface hv1-vif0 external-ids:iface-id=lsp0
+
+hv1_uuid=$(ovn-sbctl --bare --columns _uuid find Chassis name=hv1)
+echo "hv1_uuid=${hv1_uuid}"
+OVS_WAIT_UNTIL([test 1 = $(grep -c "Claiming lport lsp0" hv1/ovn-controller.log)])
+AT_CHECK([test x$(ovn-sbctl --bare --columns chassis find port_binding logical_port=lsp0) = x"$hv1_uuid"], [0], [])
+
+ovn-nbctl --wait=hv --timeout=3 lsp-set-options lsp0 requested-chassis=non-existant-chassis
+OVS_WAIT_UNTIL([test 1 = $(grep -c "Releasing lport lsp0 from this chassis" hv1/ovn-controller.log)])
+ovn-nbctl --wait=hv --timeout=3 sync
+AT_CHECK([test x$(ovn-sbctl --bare --columns chassis find port_binding logical_port=lsp0) = x], [0], [])
+
+OVN_CLEANUP([hv1])
+
+AT_CLEANUP