Deleting a Net

You can delete an empty Net that you no longer need. With Cockpit, you can choose to delete the Net only, or to delete it and all its associated resources at the same time.

Deleting a Net Using Cockpit v2

Deleting a Net Only

Before you begin: Delete or unlink all resources associated with the Net:

  1. Unlink public IPs from resources in the Net. For more information, see Unlinking a Public IP from a VM or a Network Interface.

  2. Delete virtual machines (VMs) in the Net. For more information, see Terminating VMs.

    This action automatically deletes BSU volumes with the DeleteOnVmDeletion attribute set to true that are attached to the virtual machines.

    To prevent data loss, you can:
    - Create backups of the volumes using snapshots. For more information, see Creating a Snapshot of a Volume.
    - Set the DeleteOnVmDeletion attribute to false for each volume to prevent its deletion. For more information, see Modifying a VM Attribute.

  3. Delete:

    1. Net peerings. For more information, see Deleting a Net Peering.

    2. Custom route tables. For more information, see Deleting a Route Table.

    3. Internet services, virtual gateways, and NAT services. For more information, see Deleting an Internet Service, Deleting a Virtual Gateway, and Deleting a NAT Service.

    4. Load balancers and Net access points. For more information, see Deleting a Load Balancer and Deleting a Net Access Point.

    5. Security groups. For more information, see Deleting a Security Group.

    6. Network interface cards (NICs) created in the Subnets. For more information, see Deleting a NIC.

    7. Subnets in the Net. For more information, see Deleting a Subnet.

  1. In the Nets dashboard, check the box of the Net you want to delete.
    The Net is selected.

    You can delete multiple Nets by selecting several at a time.

  2. Click IconTerminate Delete.
    A confirmation dialog box appears.

  3. Click Delete.
    The DHCP options set associated with the Net is disassociated and the Net is deleted.

Deleting a Net and its Associated Resources

  1. In the Nets dashboard, check the box of the Net you want to tear down.
    The Net is selected.

  2. Click IconTeardown Tear Down.
    A confirmation dialog box appears.

  3. In the confirmation dialog box, type "DELETE" in the text field and click Tear Down.
    The DHCP options set associated with the Net is disassociated.
    The following resources are deleted with the Net:

    • Virtual machines (VMs)

      This action automatically deletes BSU volumes with the DeleteOnVmDeletion attribute set to true that are attached to the virtual machines.

      To prevent data loss, you can:
      - Create backups of the volumes using snapshots. For more information, see Creating a Snapshot of a Volume.
      - Set the DeleteOnVmDeletion attribute to false for each volume to prevent its deletion. For more information, see Modifying a VM Attribute.

    • Internet services, virtual gateways, and NAT services

    • Custom route tables and their routes

    • Network interface cards (NICs)

    • Load balancers

    • Security groups

    • Subnets

    • Net peerings

    • Net access points

    • VPN connections

    • Public IPs

      A summary of the deleted resources and their IDs appears.

Deleting a Net Using OSC CLI

Before you begin: Delete or detach all resources associated with the Net:

  1. Disassociate public IPs from resources in the Net. For more information, see Unlinking a Public IP from a VM or a Network Interface.

  2. Terminate VMs in the Net. For more information, see Terminating VMs.

    This action automatically deletes BSU volumes with the DeleteOnVmDeletion attribute set to true that are attached to the virtual machines.

    To prevent data loss, you can:
    - Create backups of the volumes using snapshots. For more information, see Creating a Snapshot of a Volume.
    - Set the DeleteOnVmDeletion attribute to false for each volume to prevent its deletion. For more information, see Modifying a VM Attribute.

  3. Delete:

    1. Net peerings. For more information, see Deleting a Net Peering.

    2. Custom route tables. For more information, see Deleting a Route Table.

    3. Internet services, virtual gateways, and NAT services. For more information, see Deleting an Internet Service, Deleting a Virtual Gateway, and Deleting a NAT Service.

    4. Load balancers and Net access points. For more information, see Deleting a Load Balancer and Deleting a Net Access Point.

    5. Security groups. For more information, see Deleting a Security Group.

    6. Network interface cards (NICs) created in the Subnets. For more information, see Deleting a NIC.

    7. Subnets in the Net. For more information, see Deleting a Subnet.

The DeleteNet command deletes a specified Net.
Before deleting the Net, you need to delete or detach all the resources associated with the Net:

  • Virtual machines (VMs)

  • Net peerings

  • Custom route tables

  • Public IPs allocated to resources in the Net

  • Network Interface Cards (NICs) created in the Subnets

  • Virtual gateways, Internet services and NAT services

  • Load balancers

  • Security groups

  • Subnets

Request sample
$ osc-cli api DeleteNet --profile "default" \
    --NetId "vpc-12345678"

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • NetId: The ID of the Net you want to delete.

The DeleteNet command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Deleting a VPC Using AWS CLI

Before you begin:

To delete a VPC, use the delete-vpc command following this syntax:

Request sample
$ aws ec2 delete-vpc \
    --profile YOUR_PROFILE \
    --vpc-id vpc-12345678 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

The specified VPC is deleted.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.