Skip to content

Commit 076c630

Browse files
authored
Merge pull request #35 from stackhpc/upstream/yoga-2023-03-13
Synchronise yoga with upstream
2 parents 66ca4ab + 4529b5b commit 076c630

File tree

4 files changed

+36
-27
lines changed

4 files changed

+36
-27
lines changed

doc/source/ovn/migration.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ adjustments, prepare the environment for the procedure.
2121

2222
Subsequent steps start the migration via Ansible.
2323

24-
Plan for a 24-hour wait after the setup-mtu-t1 step to allow VMs to catch up
25-
with the new MTU size. The default neutron ML2/OVS configuration has a
26-
dhcp_lease_duration of 86400 seconds (24h).
24+
Plan for a 24-hour wait after the reduce-dhcp-t1 step to allow VMs to catch up
25+
with the new MTU size from the DHCP server. The default neutron ML2/OVS
26+
configuration has a dhcp_lease_duration of 86400 seconds (24h).
2727

2828
Also, if there are instances using static IP assignment, the administrator
2929
should be ready to update the MTU of those instances to the new value of 8
@@ -182,11 +182,11 @@ Perform the following steps in the undercloud
182182
with the migration playbooks.
183183

184184

185-
6. Run ``ovn_migration.sh setup-mtu-t1``
185+
6. Run ``ovn_migration.sh reduce-dhcp-t1``
186186

187187
.. code-block:: console
188188
189-
$ ovn_migration.sh setup-mtu-t1
189+
$ ovn_migration.sh reduce-dhcp-t1
190190
191191
192192
This lowers the T1 parameter

neutron/tests/functional/agent/ovn/metadata/test_metadata_agent.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _create_metadata_port(self, txn, lswitch_name):
143143
external_ids={
144144
ovn_const.OVN_CIDRS_EXT_ID_KEY: '192.168.122.123/24'}))
145145

146-
def _create_logical_switch_port(self, type_=None):
146+
def _create_logical_switch_port(self, type_=None, addresses=None):
147147
lswitch_name = 'ovn-' + uuidutils.generate_uuid()
148148
lswitchport_name = 'ovn-port-' + uuidutils.generate_uuid()
149149
# It may take some time to ovn-northd to translate from OVN NB DB to
@@ -153,6 +153,8 @@ def _create_logical_switch_port(self, type_=None):
153153
self.handler.watch_event(pb_event)
154154

155155
lswitch_port_columns = {}
156+
if addresses:
157+
lswitch_port_columns['addresses'] = addresses
156158
if type_:
157159
lswitch_port_columns['type'] = type_
158160

@@ -167,30 +169,33 @@ def _create_logical_switch_port(self, type_=None):
167169

168170
return lswitchport_name, lswitch_name
169171

170-
@mock.patch.object(agent.PortBindingChassisCreatedEvent, 'run')
171-
def test_agent_resync_on_non_existing_bridge(self, mock_pbinding):
172+
def test_agent_resync_on_non_existing_bridge(self):
173+
BR_NEW = 'br-new'
174+
self._mock_get_ovn_br.return_value = BR_NEW
175+
self.agent.ovs_idl.list_br.return_value.execute.return_value = [BR_NEW]
172176
# The agent has initialized with br-int and above list_br doesn't
173177
# return it, hence the agent should trigger reconfiguration and store
174178
# new br-new value to its attribute.
175179
self.assertEqual(self.OVN_BRIDGE, self.agent.ovn_bridge)
176180

177-
lswitchport_name, _ = self._create_logical_switch_port()
181+
# NOTE: The IP address is specifically picked such that it fits the
182+
# metadata port external_ids: { neutron:cidrs }. This is because agent
183+
# will only trigger if the logical port is part of a neutron subnet
184+
lswitchport_name, _ = self._create_logical_switch_port(
185+
addresses='AA:AA:AA:AA:AA:AB 192.168.122.125'
186+
)
178187

179188
# Trigger PortBindingChassisCreatedEvent
180189
self.sb_api.lsp_bind(lswitchport_name, self.chassis_name).execute(
181190
check_error=True, log_errors=True)
182-
exc = Exception('PortBindingChassisCreatedEvent was not called')
183191

184-
def check_mock_pbinding():
185-
if mock_pbinding.call_count < 1:
186-
return False
187-
args = mock_pbinding.call_args[0]
188-
self.assertEqual('update', args[0])
189-
self.assertEqual(lswitchport_name, args[1].logical_port)
190-
self.assertEqual(self.chassis_name, args[1].chassis[0].name)
191-
return True
192-
193-
n_utils.wait_until_true(check_mock_pbinding, timeout=10, exception=exc)
192+
exc = Exception("Agent bridge hasn't changed from %s to %s "
193+
"in 10 seconds after Port_Binding event" %
194+
(self.agent.ovn_bridge, BR_NEW))
195+
n_utils.wait_until_true(
196+
lambda: BR_NEW == self.agent.ovn_bridge,
197+
timeout=10,
198+
exception=exc)
194199

195200
def _test_agent_events(self, delete, type_=None):
196201
m_pb_created = mock.patch.object(

tools/ovn_migration/infrared/tripleo-ovn-migration/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@
166166
set -o pipefail &&
167167
{{ ovn_migration_working_dir }}/start-ovn-migration.sh generate-inventory 2>&1 > {{ ovn_migration_working_dir}}/generate-inventory.log
168168

169-
- name: Set MTU T1
169+
- name: Set DHCP T1 timer
170170
shell:
171171
set -o pipefail &&
172-
{{ ovn_migration_working_dir }}/start-ovn-migration.sh setup-mtu-t1 2>&1 > {{ ovn_migration_working_dir}}/setup-mtu-t1.log
172+
{{ ovn_migration_working_dir }}/start-ovn-migration.sh reduce-dhcp-t1 2>&1 > {{ ovn_migration_working_dir}}/reduce-dhcp-t1.log
173173

174174
- name: Reduce mtu of the pre migration networks
175175
shell:

tools/ovn_migration/tripleo_environment/ovn_migration.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ EOF
238238
cat hosts_for_migration
239239
echo "***************************************"
240240
echo "Generated the inventory file - hosts_for_migration"
241-
echo "Please review the file before running the next command - setup-mtu-t1"
241+
echo "Please review the file before running the next command - reduce-dhcp-t1"
242242
}
243243

244244
# Check if source inventory exists
@@ -283,7 +283,7 @@ oc_check_network_mtu() {
283283
return $?
284284
}
285285

286-
setup_mtu_t1() {
286+
reduce_dhcp_t1() {
287287
# Run the ansible playbook to reduce the DHCP T1 parameter in
288288
# dhcp_agent.ini in all the overcloud nodes where dhcp agent is running.
289289
ansible-playbook -vv $OPT_WORKDIR/playbooks/reduce-dhcp-renewal-time.yml \
@@ -349,7 +349,7 @@ complete details. This script needs to be run in 5 steps.
349349
350350
Generates the inventory file
351351
352-
Step 2 -> ovn_migration.sh setup-mtu-t1
352+
Step 2 -> ovn_migration.sh reduce-dhcp-t1 (deprecated name setup-mtu-t1)
353353
354354
Sets the DHCP renewal T1 to 30 seconds. After this step you will
355355
need to wait at least 24h for the change to be propagated to all
@@ -386,9 +386,13 @@ case $command in
386386
ret_val=$?
387387
;;
388388

389-
setup-mtu-t1)
389+
reduce-dhcp-t1 | setup-mtu-t1)
390+
if [[ $command = 'setup-mtu-t1' ]]; then
391+
echo -e "Warning: setup-mtu-t1 argument was renamed."\
392+
"Use reduce-dhcp-t1 argument instead."
393+
fi
390394
check_for_necessary_files
391-
setup_mtu_t1
395+
reduce_dhcp_t1
392396
ret_val=$?;;
393397

394398
reduce-mtu)

0 commit comments

Comments
 (0)