Delete 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 Create 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 Google Cloud project.

  4. Install the Google Cloud CLI.
  5. To initialize the gcloud CLI, run the following command:

    gcloud init
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  7. Make sure that billing is enabled for your Google Cloud project.

  8. Install the Google Cloud CLI.
  9. To initialize the gcloud CLI, run the following command:

    gcloud init
  10. If you are using the Google Cloud CLI, set your project ID by using the gcloud config set command.

    gcloud config set project PROJECT_ID

    Replace PROJECT_ID with your unique project ID.

    The gcloud CLI instructions on this page assume that you have set your project ID.

  11. To confirm that you set the project ID correctly, use the gcloud config list command.

    gcloud config list --format='text(core.project)'

Get access

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

Delete 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

Delete 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

Delete the Cloud Router

For steps, see Deleting routers.

Delete the Network Connectivity Center spoke

For steps, see Deleting a spoke.

Delete router appliance software on the VM

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

Delete 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

Delete 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 Delete firewall rules.

What's next