A virtual private cloud (VPC) is a private network in the cloud. You can manage your VPC based on your requirements. For example, you can specify CIDR blocks, and configure route tables and gateways for your VPC. You can also add secondary CIDR blocks to a VPC. This topic describes how to create and manage a VPC.
Operations
Create a VPC
Before you create a VPC, you must first plan networks. For more information, see Plan networks.
View a VPC
Modify the basic information about a VPC
You can modify the name and description of a VPC.
Add a secondary CIDR block
Limits
- When you create a VPC, the IPv4 CIDR block that you specified is the primary CIDR block. After the VPC is created, you cannot modify the primary IPv4 CIDR block of the VPC. However, you can add a secondary IPv4 CIDR block to the VPC. After you add a secondary IPv4 CIDR block to the VPC, both the primary and secondary IPv4 CIDR blocks are in effect. You can add at most one IPv4 CIDR block to a VPC and at most three IPv6 CIDR blocks to a VPC that has IPv6 enabled.
- You can create a vSwitch with the primary or secondary IPv4 CIDR block of a VPC. However,
the CIDR block of a vSwitch must belong to only one CIDR block of the VPC. If you
create a vSwitch with the primary IPv4 CIDR block or a secondary CIDR block, the system
automatically adds a route to a route table of the VPC. The destination CIDR block
of the route is the CIDR block of the vSwitch. The CIDR block of a vSwitch cannot
be the same as or larger than the destination CIDR block of a route in a route table
of the VPC to which the vSwitch belongs.
For example, 172.16.0.0/12 is added to a VPC as a secondary IPv4 CIDR block and a Cloud Enterprise Network (CEN) route exists in the VPC route table. Overlapping routing is enabled for CEN and the destination CIDR block of the CEN route is 172.16.0.0/24. In this case, you cannot create a vSwitch with 172.16.0.0/24 or a larger CIDR block. However, you can create a vSwitch with 172.16.0.0/25 or a smaller CIDR block.
Prerequisites
Before you add a secondary IPv4 CIDR block to a VPC, make sure that a VPC is created. If you want to add a secondary IPv6 CIDR block to a VPC, you must enable IPv6 for the VPC. If you want to create a vSwitch with a secondary IPv6 CIDR block, you must enable IPv6 for the vSwitch.
Delete a secondary CIDR block
You can delete a secondary CIDR block. However, you cannot delete the primary IPv4 CIDR block of a VPC.
Before you delete a secondary CIDR block, make sure that the vSwitches created within the secondary CIDR block are deleted. For more information, see Delete a vSwitch.
Delete a VPC
You can delete a VPC that you no longer need. After you delete a VPC, the vRouters and route tables associated with the VPC are also deleted. Before you delete a VPC, make sure that the following requirements are met:
- No vSwitches exist in the VPC. Otherwise, delete the vSwitches first. For more information, see Delete a vSwitch.
- No IPv6 gateways exist in the VPC. Otherwise, delete the IPv6 gateways first. For more information, see Delete an IPv6 gateway.
- No security groups, custom route tables, network ACLs, or DHCP options sets exist in the VPC and the VPC is not attached to a CEN instance. Otherwise, delete the resources and detach the VPC from the CEN instance.
- Log on to the VPC console.
- In the top navigation bar, select the region where the VPC is created.
- On the VPCs page, find the VPC that you want to delete, and click Delete in the Actions column.
- In the Delete VPC dialog box, click OK.
References
- CreateVpc: creates a VPC.
- DescribeVpcs: queries VPCs.
- ModifyVpcAttribute: modifies the name and description of a specified VPC.
- AssociateVpcCidrBlock: adds a secondary CIDR block to a VPC.
- UnassociateVpcCidrBlock: deletes a secondary CIDR block from a VPC.
- DeleteVpc: deletes a VPC.