Attach a VPC to a CPU TIR Virtual Machine (VM) 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.
Before you begin
Section titled “Before you begin”- A VM on a plan from the CPU tab. A GPU VM or a private cluster VM uses a VPC IP instead. See Use a VPC IP on a GPU VM or a private cluster VM.
- An active VPC with a free IP. To make one, see Create a VPC.
- Permission to update VMs in the project. See TIR Access Control.
Until you attach a VPC of your own, a CPU VM sits on the project’s default private network.
Attach a VPC when you create the VM
Section titled “Attach a VPC when you create the VM”On the Create VM form, choose the VPC in the VPC field under Network & Security. Choose an active VPC with a free IP for each VM you launch. See Create a VM for the rest of the form.
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 GPU VM or a private cluster VM
Section titled “Use a VPC IP on a GPU VM or a private cluster VM”A VM on a GPU plan or 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.