Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Setting up VPC Network Peering

Hi,

I am trying to create a MatchingEngineIndexEndpoint using the code below:

my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint.create( display_name=DISPLAY_NAME, description=DISPLAY_NAME, public_endpoint_enabled=False, network=VPC_NETWORK_FULL, )

but I keep getting this error:

Error NETWORK_NOT_PEERED

I understand that I need to set up VPC Network Peering on my Google Cloud account. But I am not sure what is the difference between "Your VPC Network" and "VPC Network Name" when creating a peering connection:

omneky_0-1704734310099.png

In both menus, I only see one single item too choose from (which is the "default" connection). Therefore, I can choose this "default" connection only for one of the menus.

 

Can you please let me know how to properly create peering network connection?

 

Thanks

2 2 1,877
2 REPLIES 2

Hi @omneky ,

The "Your VPC Network" and "VPC Network Name" fields refer to the networks that you are peering.

To properly create a VPC Network Peering:

1. On your Google Cloud Console, make sure that you have selected the correct GCP project. Then click  "+ CREATE CONNECTION" button.
2. Choose the VPC network you want to peer with another network from the drop-down menu in the "Your VPC Network" field. Similarly, select a different VPC network from the drop-down menu in the "VPC Network Name" field, which you wish to peer with the first one. Ensure that you have created more than one VPC network in your project, as having only one might result in seeing only one item in the drop-down menu for either field. If needed, create an additional VPC network.
3. Set up a name for it. Then, if you want to edit the configuration according to your requirements, do so. Then, click on the "Create" button to initiate the peering connection.
4. After the peering connection creation, you will typically need to accept the peering request on the other VPC. Navigate to the VPC Network Peering page in the other VPC's project and accept the peering request.

After both sides accept the peering connection, you can use it for your MatchingEngineIndexEndpoint. Just make sure the VPCs have the right firewall rules and settings to let them talk to each other.

Let me know if this helps. Always refer to this documentation for more details. 

@Marvin_Luceroplease reread the question. He IS following the documentation, but the documentation does not explain what to do when you have created two clusters using the "default" VPC and subnet for both clusters. It is apparently not allowed to create a link between two "default" VPCs (or are they actually one VPC? No-one knows, especially not the documentation)