created a monitoring service that runs every 60 seconds
checks if the rdma names are correct
if not, enables and restarts the 'azure_persistent_rdma_naming' service
for the sake of completeness, have included testing process below :
test method 1 : mess up names and check that monitor catches the change + restarts azure_persistent_rdma_rename
made sure both azure_persistent_rdma_rename service and the azure_persistent_rdma_rename_monitor service were running (I modified the azure_persistent_rdma_rename_monitor service so that every 3 minutes it restarts the rename service)
stopped and disabled azure_persistent_rdma_rename service and checked that it was inactive
ran my mess_up_rdma_names service (created for testing purposes) to change the rdma names
confirmed that the rdma names are 'mlx5_#' (contain no "an" and no "ib")
waited for 3 minutes to give the monitor time to run
confirmed that azure_persistent_rdma_rename had restarted and the rdma names are now correct (contain "an" and "ib")
changed the monitor to wait every 1 minute instead of 3 (set to 3 to allow time to mess up rdma names for testing purposes)
test method 2 : when the VM reboots the monitor should run azure_persistent_rdma_rename
ensured that azure_persistent_rdma_rename service and azure_persistent_rdma_rename_monitor service were both running
stopped and disabled azure_persistent_rdma_rename service
ran mess_up_rdma_names service (service created for testing purposes to mess up rdma names)
confirmed that the rdma names are 'mlx5_#' (contain no "an" and no "ib")
'sudo reboot' and rebooted the VM
confirmed that azure_persistent_rdma_rename service ran again
confirmed that the rdma names are now correct
test method 3 : turn accelerated networking on/off to recreate the effect of adding and removing a VF device
Confirm that azure_persistent_rdma_rename and azure_persistent_rdma_rename_monitor are both running
Disable and stop azure_persistent_rdma_rename and confirm
Mess up the rdma names (by running mess_up_rdma_names test service) and confirm that they are now incorrect
Disable accelerated networking
Confirm that azure_persistent_rdma_rename_monitor is still running and within 60 seconds (the time limit we've set) enables + starts azure_persistent_rdma_rename
Confirm that the rdma names are now correct
Repeat the above steps, but this time enabled accelerated networking, and saw that the monitor caught the name changes and fixed them
created a monitoring service that runs every 60 seconds checks if the rdma names are correct if not, enables and restarts the 'azure_persistent_rdma_naming' service
for the sake of completeness, have included testing process below :
test method 1 : mess up names and check that monitor catches the change + restarts azure_persistent_rdma_rename
test method 2 : when the VM reboots the monitor should run azure_persistent_rdma_rename
test method 3 : turn accelerated networking on/off to recreate the effect of adding and removing a VF device