Deleting router appliance instances

This page describes how to delete a router appliance instance and its underlying Google Cloud resources. To illustrate the process, this page uses the scenario described in Creating router appliance instances.

For more information about Router appliance, see the Router appliance overview.

For more information about Network Connectivity Center, see the Network Connectivity Center overview.

Before you begin

Before you get started, review the following sections.

Create or select a project

To make it easier to configure Network Connectivity Center, start by identifying a valid project.

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

  4. Install and initialize the Cloud SDK.
  5. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

  7. Install and initialize the Cloud SDK.
  1. If you are using the gcloud command-line tool, set your project ID by running the following command. The gcloud instructions on this page assume that you have set your project ID.
    gcloud config set project PROJECT_ID
        
  1. Confirm that the ID was set by running the following command:
    gcloud config list --format='text(core.project)'
        

Get access

To work with Network Connectivity Center, you need the permissions described in Access control.

Deleting the BGP peers on Cloud Router

gcloud

To delete two redundant BGP peers on the Cloud Router for the router appliance instance, enter the following command:

 gcloud compute routers remove-bgp-peer NAME \
     --peer-name PEER_NAME,PEER_NAME \
     --region=REGION \
     --project=PROJECT_ID

Replace the following:

  • NAME: the name of the Cloud Router to update—for example, router-a
  • PEER_NAME: the name of the BGP peer to delete—for example, router-appliance-bgp-peer-0, router-appliance-bgp-peer-1
  • REGION: the region where the VM acting as the router appliance instance is located—for example, us-west1
  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project

API

To delete two BGP peers on the Cloud Router for a router appliance instance, use the compute.routers.patch method. In your request, pass information about the BGP peers that you want to keep. You must include all configured fields for each peer.

The following example removes all BGP peers from the Cloud Router:

PATCH
https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/region/REGION/routers/NAME
 {
  "bgpPeers": []
 }

Replace the following:

  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project
  • REGION: the region where the VM acting as the router appliance instance is located—for example, us-west1
  • NAME: the name of the Cloud Router to update—for example, router-a

Deleting Cloud Router interfaces for the router appliance instance

When deleting Cloud Router interfaces for router appliance instances, use the following guidelines:

  • Delete both interfaces at the same time.
  • Only delete Cloud Router interfaces if other Google Cloud resources aren't using them.

gcloud

To delete two redundant Cloud Router interfaces for a router appliance instance, enter the following command:

 gcloud compute routers remove-interface NAME \
     --interface-names=INTERFACE_NAME,INTERFACE_NAME \
     --region=REGION \
     --project=PROJECT_ID

Replace the following:

  • NAME: the name of the Cloud Router to update—for example, router-a
  • INTERFACE_NAME: the name of the interface—for example, router-appliance-interface-0, router-appliance-interface-1
  • REGION: the Google Cloud region where the Cloud Router is located—for example, us-west1
  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project

API

To delete two redundant interfaces on the Cloud Router for a router appliance instance, use the compute.routers.patch method. In your request, pass information about the BGP peers that you want to keep. You must include all configured fields for each peer.

The following example removes all interfaces from the Cloud Router:

"PATCH   https"://www.googleapis.com/compute/v1/projects/PROJECT_ID/region/REGION/routers/NAME{
  "region":"REGION",
  "interfaces":[]
}

Replace the following:

  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project
  • REGION: the Google Cloud region where the Cloud Router is located—for example, us-west1
  • NAME: the name of the Cloud Router to update—for example, router-a
  • NETWORK: the name of the VPC network—for example, network-a
  • INTERFACE_NAME: the name of the interface—for example, router-appliance-interface-0, router-appliance-interface-1

Deleting the Cloud Router

For steps, see Deleting routers.

Deleting the Network Connectivity Center spoke

For steps, see Deleting a spoke.

Deleting router appliance software on the VM

For steps, refer to the documentation from your router appliance vendor.

Deleting the router appliance VM

gcloud

To delete a router appliance VM instance, enter the following command:

gcloud compute instances delete INSTANCE_NAME \
    --project=PROJECT_ID \
    --zone=ZONE

Replace the following:

  • INSTANCE_NAME: the name of the router appliance instance—for example, router-app-a
  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project
  • ZONE: the zone where the VM acting as the router appliance instance is located—for example, us-west1-a

API

To delete a VM instance, use the compute.instances.delete method:

DELETE https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME

Replace the following:

  • PROJECT_ID: the ID for the project for the Cloud Router—for example, my-project
  • ZONE: the zone where the VM acting as the router appliance instance is located—for example, us-west1-a
  • INSTANCE_NAME: the name of the router appliance instance—for example, router-app-a

Deleting the firewall rule that allows BGP

If applicable, delete the firewall rule that allows BGP traffic on TCP port 179 to the network that contains router appliance instances.

For steps, see Deleting firewall rules.

What's next