A Virtual Private Cloud (VPC) 2.0 network enables a secure and isolated private networking interface on your instance for communication with other instances on the same network. You can attach multiple VPC 2.0 networks to enable communication between an instance and other nodes attached to the same network.
Follow this guide to attach VPC 2.0 networks on a Vultr Cloud GPU instance using the Vultr Customer Portal, API, CLI, or Terraform.
Send a GET
request to the List Instances endpoint and note the target instance's ID in your output.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET
request to the List Instance VPC 2.0 Networks endpoint to list all VPC 2.0 networks in your Vultr account and note the target VPC 2.0 network's ID.
$ curl "https://api.vultr.com/v2/instances/{instance-id}/vpc2" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST
request to the Attach VPC 2.0 to Instance endpoint to attach the VPC 2.0 network to the instance.
$ curl "https://api.vultr.com/v2/instances/{instance-id}/vpc2/attach" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"vpc_id": "<vpc-id>"
}'
List all instances available in your Vultr account and note the target instance's ID.
$ vultr-cli instance list
List all VPC 2.0 networks in your Vultr account and note the target VPC 2.0 network's ID.
$ vultr-cli vpc2 list
Attach the VPC 2.0 network to the instance.
$ vultr-cli vpc2 nodes attach <vpc2-id> \
--nodes="<instance-id>"
Open your Terraform configuration for the existing Cloud GPU instance.
Create (or reference) a VPC 2.0 network and attach it to the instance.
# Create a new VPC 2.0 network
resource "vultr_vpc2" "private_net" {
region = "del"
description = "Private network for GPU workloads"
}
# Attach the VPC 2.0 network to the GPU instance
resource "vultr_instance" "gpu" {
# ...existing fields (region, plan, os_id, label, etc.)
vpc2_ids = [vultr_vpc2.private_net.id]
}
Apply the configuration and observe the following output:
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
No comments yet.