Attach a VPC to a TIR Virtual Machine (VM) on a CPU or GPU plan to give it a private address in a network of your own, so it can talk to your other machines in that VPC privately. The VM keeps its public address as well. A VM holds one VPC at a time, and you can switch it to another VPC or detach it later. Until you attach one, the VM sits on the project’s default private network. A VM on a private cluster uses a VPC IP instead.
Attach a VPC when you create the VM
Section titled “Attach a VPC when you create the VM”When you create the VM, choose the VPC under VPC in Network & Security: an active VPC with a free IP for each VM you launch. To make one, see Create a VPC, and for the other choices, Create a VM.
Attach or switch the VPC of a VM that exists
Section titled “Attach or switch the VPC of a VM that exists”Attaching or switching a VPC restarts the VM, so save your work and stop long jobs first.
- In Manage VMs, select the VM’s name, then go to Network & Security > Network.
- In the VPC section, pick a VPC in Select VPC, then pick one of its subnets in Select subnet.
- Select Update.
- In Attach VPC, or Switch VPC when the VM already has one, select Continue. Switch VPC detaches the current VPC and attaches the new one.
The VM restarts to pick up the VPC: a second network interface next to the public one, with its address from the VPC.
Find the private IP
Section titled “Find the private IP”When the VM is Running again, Private IP under Connection Details on its Overview tab is the VM’s address inside the VPC. Use it to reach the VM from your other machines in the same VPC, including over SSH. See Connect to a VM over SSH.
Detach the VPC
Section titled “Detach the VPC”Detaching the VPC restarts the VM, and the VM loses its address in that VPC.
- On the Network side tab, select Detach beside the VPC.
- In Detach VPC, select Detach.
The VM restarts and is back on the project’s default private network.
Use a VPC IP on a private cluster VM
Section titled “Use a VPC IP on a private cluster VM”A VM on a private cluster joins a VPC through a VPC IP. On its Network side tab, pick an address in Select VPC IP, or reserve one with Reserve New VPC IP, then select Attach. You can attach a VPC IP while the VM is Stopped as well as while it runs. To detach it, select Detach VPC beside the VPC and confirm in Detach VPC. The VM then loses its connection to that VPC.
To give the VM a public address that stays the same, see Attach a reserved IP to a VM. For help with a message, see Troubleshooting TIR Virtual Machines.
Was this page helpful?