Skip to main content
andrés ignacio torres

Getting OVH Public Cloud multi-region connectivity to work

I've been working on a very cool passion project recently that involves setting up cloud infrastructure on OVH Public Cloud for data sovereignty. As part of the infrastructure design, I needed to set up one resource in a given region and another resource in a different region, and allow them to communicate with each other over private IPs.

This is a common use case for cloud networking and I've had to do this many times before on other cloud providers (Azure, AWS, GCP...), but my intuition and previous experience did not help me much when I tried to replicate this on OVH Public Cloud.

i suspect dns is at fault. it’s always dns.

— andrés ignacio torres (@andresitorresm.com) July 4, 2025 at 12:05 AM

Naively, after skimming OVH's documentation, my first attempt looked something like this (on Terraform):

# One private network
resource "ovh_cloud_project_network_private" "network" {
  service_name = "abc123"
  name         = "multiregion-network"
  regions      = ["GRA1", "BHS1"]
}

# Two subnets in the same private network, one
# in each region
resource "ovh_cloud_project_network_private_subnet" "subnet1" {
  service_name = "abc123"
  network_id   = ovh_cloud_project_network_private.network.id
  region       = "GRA1"
  start        = "10.0.1.1"
  end          = "10.0.1.255"
  network      = "10.0.1.0/24"
  dhcp         = true
  no_gateway   = false
}

resource "ovh_cloud_project_network_private_subnet" "subnet2" {
  service_name = "abc123"
  network_id   = ovh_cloud_project_network_private.network.id
  region       = "BHS1"
  start        = "10.0.2.1"
  end          = "10.0.2.255"
  network      = "10.0.2.0/24"
  dhcp         = true
  no_gateway   = false
}

This seemed to me like it would work, and I didn't get any errors when applying the Terraform configuration. However, the resources deployed in each region's subnet could not communicate with each other over their private IPs. This was confusing and I didn't find any multi-region examples in OVH's documentation or Github.

Among other things, I tried separating the private network into two different resources, one for each region (similar to how AWS would require two VPCs) but that didn't work either (and it didn't make sense, since OVH's documentation allowed you to create a single private network across multiple regions).

After a lot of digging and reading through OVH's documentation, I found one key line that explained the issue (emphasis mine):

Multi-region private networks: To achieve resource interconnectivity between regions, the same vRack/VLAN/subnet should be used to create a private network in each region. Please note that different DHCP IP ranges must be used in different regions.

Aha! The implication here is that I needed to use "the same subnet" in each region, and this translates to using the same network CIDR in each region's subnet resource, while keeping the start and end IPs different in each region to avoid conflicts.

My updated Terraform configuration looks like this:

# One private network
resource "ovh_cloud_project_network_private" "network" {
  service_name = "abc123"
  name         = "multiregion-network"
  regions      = ["GRA1", "BHS1"]
}

# Two subnets in the same private network that share
# the same network CIDR, but have different DHCP ranges
resource "ovh_cloud_project_network_private_subnet" "subnet1" {
  service_name = "abc123"
  network_id   = ovh_cloud_project_network_private.network.id
  region       = "GRA1"
  start        = "10.0.1.1"
  end          = "10.0.1.155"
  network      = "10.0.1.0/24"
  dhcp         = true
  no_gateway   = false
}

resource "ovh_cloud_project_network_private_subnet" "subnet2" {
  service_name = "abc123"
  network_id   = ovh_cloud_project_network_private.network.id
  region       = "BHS1"
  start        = "10.0.1.156"
  end          = "10.0.1.255"
  network      = "10.0.1.0/24"
  dhcp         = true
  no_gateway   = false
}

This change was enough to get the resources in each region to communicate with each other over their private IPs!