Crea un vSwitch predeterminado.
Descripción de la operación
Cuando llama a esta operación para crear un vSwitch predeterminado, tenga en cuenta los siguientes puntos:
-
El sistema reserva la primera y las últimas tres direcciones IP de cada bloque CIDR del vSwitch predeterminado. Por ejemplo, las direcciones IP reservadas por el sistema para 192.168.1.0/24 son 192.168.1.0, 192.168.1.253, 192.168.1.254 y 192.168.1.255.
-
El número de instancias de servicios en la nube en un vSwitch predeterminado no puede exceder el número restante de instancias de servicios en la nube disponibles en la VPC (15,000 menos el número actual de instancias de servicios en la nube).
-
Los vSwitches predeterminados no admiten multidifusión ni difusión.
-
Después de crear un vSwitch predeterminado, no puede modificar su bloque CIDR.
-
La operación CreateDefaultVSwitch es asíncrona. Después de enviar una solicitud, el sistema devuelve un ID de instancia, pero el vSwitch predeterminado aún no se ha creado. Una tarea en segundo plano sigue en progreso. Puede llamar a DescribeVSwitchAttributes para consultar el estado de creación del vSwitch predeterminado:
Si el vSwitch predeterminado está en estado Pending, significa que se está configurando.
Si el vSwitch predeterminado está en estado Available, significa que está disponible.
-
Si ya existe un vSwitch predeterminado en una zona de la región especificada, la llamada a esta operación fallará.
-
Antes de crear un vSwitch predeterminado, debe crear primero una VPC predeterminada. Puede llamar a la operación CreateDefaultVpc para crear una VPC predeterminada.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
vpc:CreateDefaultVSwitch |
create |
*VSwitch
|
Ninguna | Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| ZoneId |
string |
Sí |
El ID de la zona del vSwitch predeterminado que desea crear. Puede llamar a la operación DescribeZones para consultar los ID de zona. |
cn-hangzhou-b |
| RegionId |
string |
Sí |
El ID de la región del vSwitch predeterminado que desea crear. Puede llamar a la operación DescribeRegions para consultar los ID de región. |
cn-hangzhou |
| Ipv6CidrBlock |
integer |
No |
Los últimos 8 bits del bloque CIDR IPv6 del vSwitch. Valores válidos: 0 a 255. |
12 |
| ClientToken |
string |
No |
El token de cliente que se utiliza para garantizar la idempotencia de la solicitud. Puede utilizar el cliente para generar el token, pero debe asegurarse de que el token sea único entre diferentes solicitudes. El token solo puede contener caracteres ASCII. Nota
Si no especifica este parámetro, el sistema utiliza automáticamente el RequestId de la solicitud de API como ClientToken. El RequestId puede ser diferente para cada solicitud de API. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
El ID del vSwitch predeterminado que se creó. |
||
| VSwitchId |
string |
El ID del vSwitch predeterminado que se creó. |
vsw-bp1a4b5qhmxftjimq**** |
| RequestId |
string |
El ID de la solicitud. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Ejemplos
Respuesta exitosa
JSON Formato
{
"VSwitchId": "vsw-bp1a4b5qhmxftjimq****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | Invalid description. | |
| 400 | InvalidVSwitchName.Malformed | Specified virtual switch name is not valid. | The format of the specified vSwitch name is invalid. Specify the name in the valid format. |
| 400 | InvalidVSwitchDiscription.Malformed | Specified virtual switch description is not valid. | |
| 400 | Abs.Vpc.InvalidDescription.Malformed | Specified virtual switch name is not valid. | |
| 400 | ResourceNotAvailable | Resource you requested is not available in this region or zone. | |
| 400 | InvalidParameter | Specified CIDR block is not valid in VPC. | |
| 400 | InvalidCidrBlock.Overlapped | Specified CIDR block overlapped with other subnets. | |
| 400 | QuotaExceeded.VSwitch | Virtual switch quota exceeded. | The number of vSwitches has reached the upper limit. Reduce the number of vSwitches and try again later. |
| 400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | |
| 400 | IncorrectVSwitchStatus | Some virtual switch is modifying within the same VPC. | Multiple vSwitches are in the Modifying state in the same VPC. Try again later. |
| 400 | InvalidCirdrBlock.MaskLength | Specified CIDR block is not valid . | Invalid CIDR block. |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | CreateVSwitch.IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | You cannot create a vSwitch when the CEN instance is in the current state. |
| 400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | |
| 400 | MissingParameter | Miss mandatory parameter. | |
| 400 | TaskConflict | The operation is too frequent, TaskConflict. | The system is unavailable. Try again later. |
| 400 | VPC.SWITCH.RULE.QUOTA.NOT.EXISTS | vSwitch quota rule not exists. | |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | The specified VPC does not exist. |
| 400 | RouteConflict.AlreadyExist | Route conflict exists in routing table. | Route conflicts exist in the route table. |
| 400 | OperationFailed.CidrAcross | Classic link instance cidr must not across. | |
| 400 | Duplicated.ClientToken | %s | |
| 400 | OperationFailed.Ipv6CidrBlockExisted | %s | |
| 400 | IllegalParam.Ipv6CidrBlock | %s | |
| 400 | OperationFailed.VpcIpv6Disabled | %s | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | The status of the CEN instance is invalid. |
| 400 | OperationFailed.DefaultVpcNotExist | %s | |
| 400 | UnsupportedFeature.CloudBoxIpv6 | The IPv6 feature is not supported by cloud box. | You cannot create an IPv6 address for a CloudBox instance. |
| 400 | OperationDenied.VpcPeerExist | The operation is not allowed because the VPC peer exists. | The operation failed because VPC peering connections exist. |
| 400 | OperationDenied.CenAttached | The operation is not allowed because the VPC is attached to CEN. | The operation is not allowed because the VPC is attached to a CEN instance. |
| 400 | OperationDenied.NatgwExist | The operation is not allowed because the NAT gateway exists in VPC. | The operation is not allowed because NAT gateways exist in the VPC. |
| 400 | OperationDenied.OtherSubnetCreating | other subnet is creating | |
| 400 | OperationFailed.DefaultVSwitchExist | A default vSwitch already exists in the zone. | The error message returned because the default vSwitch already exists in the current zone. |
| 400 | InvalidStatus.RouteEntry | RouteEntry status error. | |
| 400 | InvalidZoneId.NotFound | Specified zone does not exist. | |
| 400 | OperationDenied.ZoneIsDisabled | The specified zone is disabled. You cannot create a vSwitch in a disabled zone. | The specified zone is disabled. You cannot create a vSwitch in a disabled zone. |
| 404 | Invalid.NotExist | witch mask rule not exists. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
Consulte Códigos de error para ver la lista completa.
Notas de la versión
Consulte Notas de la versión para ver la lista completa.