Delete Dynamic Network Interfaces from an instance

This page describes how to delete a Dynamic Network Interface (NIC) from an existingCompute Engine instance.

For an overview of multiple network interfaces, seeMultiple network interfaces.

To view an instance's existing network interfaces, seeView network interfaces for an instance.

Delete a Dynamic NIC from an instance

This section describes how to delete a Dynamic NIC from an instance.

To preventa possibleerror when deleting a Dynamic NIC by instance update,don't delete Dynamic NICs from individual instances by updatinginstance properties.

Console

  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. Click the name of the instance for which you want to delete aDynamic NIC.

  3. On the instance details page, clickEdit.

  4. In theDynamic Network Interfaces section, locate theDynamic NIC that you want to delete.

  5. To delete the Dynamic NIC,clickDelete.

  6. To save your configuration, clickSave.

gcloud

To delete a Dynamic NIC from an existing instance, use theinstances network-interfaces delete command.

gcloud compute instances network-interfaces deleteINSTANCE_NAME \    --zone=ZONE \    --network-interface=DYNAMIC_NIC_NAME

Replace the following:

  • INSTANCE_NAME: the name of the instance to create
  • ZONE: the zone of the instance
  • DYNAMIC_NIC_NAME: the name of the Dynamic NICto delete, such asnic0.2

API

To delete a Dynamic NIC from an existing instance, use theinstances.deleteNetworkInterface method.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/deleteNetworkInterface?networkInterfaceName=DYNAMIC_NIC_NAME

Replace the following:

  • PROJECT_ID: the ID of the project that containsthe instance
  • ZONE: the zone that contains the instance
  • INSTANCE_NAME: the name of the instance to delete theDynamic NIC from
  • DYNAMIC_NIC_NAME: the name of the Dynamic NICto delete, such asnic0.2

Delete a Dynamic NIC from instances in a MIG

This section describes how to delete a Dynamic NIC from instancesin a MIG by creating a new instance template and applying the configurationto the MIG. Updating an existing instance template is not supported.

For more information about creating instance templates, seeCreate instance templates.To view an existing instance template, seeGet, list, and delete instance templates.

Console

  1. Go to theInstance templates page.

    Go to Instance templates

  2. Click the instance template that you want to copy and update.

  3. ClickCreate similar.

  4. Expand theAdvanced options section, and then expand theNetworking section.

  5. In theDynamic Network Interfaces section, locate theDynamic NIC that you want to delete.

  6. To delete the Dynamic NIC,clickDelete.

  7. To create the instance template, clickCreate.

  8. To update or recreate your instances with the new instance template, seeApply new VM configurations in a MIG.

gcloud

  1. To create a new instance template that deletes a Dynamic NIC,use thegcloud compute instance-templates create command.

    Include the--network-interface flag for each network interface from yourexisting instance template, except for the Dynamic NIC thatyou want to delete.

    Adjust the following example to specify network interfaces andother properties as needed. For more examples of how to createinstances with multiple network interfaces,seeCreate VMs with multiple network interfaces.

    gcloud compute instance-templates createINSTANCE_TEMPLATE_NAME \   --network-interface=network=NETWORK_A,subnet=SUBNET_A \   [--network-interface=network=NETWORK_B,subnet=SUBNET_B[,vlan=VLAN_ID]]

    Replace the following:

    • INSTANCE_TEMPLATE_NAME: a name for the new instance template.
    • NETWORK_A,NETWORK_B: the network where the interfaceattaches.
    • SUBNET_A,SUBNET_B: the subnet where the interface attaches.
    • VLAN_ID: a VLAN ID. Specifying a VLAN ID configuresthe network interface as a Dynamic NIC. You must place aDynamic NIC after its parent vNIC in the command.
  2. To update or recreate your instances with the new instance template, seeApply new VM configurations in a MIG.

API

  1. To create a new instance template that deletes a Dynamic NIC,use theinstanceTemplates.insert method to create a global instance template or theregionInstanceTemplates.insert method to create a regional instance template.

    In thenetworkInterfaces field, include each network interface from yourexisting instance template, except for the Dynamic NIC thatyou want to delete.

    Adjust the following example to specify network interfaces and otherproperties as needed. For more examples of how to create instances withmultiple network interfaces, seeCreate VMs with multiple network interfaces.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/instanceTemplates{   ....   "networkInterfaces": [     {       "subnetwork": "regions/REGION/subnetworks/SUBNET_A"     },     {       "subnetwork": "regions/REGION/subnetworks/SUBNET_B",       "vlan": "VLAN_ID"     },     additional network interfaces...   ],   other instance settings... }

    Replace the following:

    • PROJECT_ID: the ID of the project that contains theinstance template.
    • REGION: the region that contains the instances.
    • SUBNET_A,SUBNET_B: the subnet whereeach network interface is located.
    • VLAN_ID: a VLAN ID. Specifying a VLAN ID configuresthe network interface as a Dynamic NIC. You must place aDynamic NIC after its parent vNIC the request.
  2. To update or recreate your instances with the new instance template, seeApply new VM configurations in a MIG.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.