Create a custom command in RM. Then create a rule to run that custom command when a virtual switch turns on.