Ray Cluster on Azure - how to use a custom vnet/subnet?

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Hello! I’m trying to set a Ray Cluster on Azure, and due to security requirements, I’d like to start all the VMs within a custom subnet that already exists.

I’ve found a really hacky way to do that. At the moment, I can go into ray/autoscaler/_private/_azure/node_provider.py and add a template_params["subnet"] = "my_subnet" in _create_node() right before the template is passed in.

Obviously, this is not an ideal solution. Curious if there’s a better way? Happy to make a PR if needed.

Maybe @gramhagen knows the best way to do this?

you could just create a vnet with private ips only then do a vnet peering to the pre-existing vnet. alternatively providing that information in the deployment configuration yaml and passing it to the necessary arm templates is an option. happy to review or provide any useful info if you want to go the second route and push a pr.