Modifie le cloud privé virtuel (VPC), l'adresse IP privée, les groupes de sécurité ou le vSwitch d'une instance Elastic Compute Service (ECS) située dans un VPC.
Description de l'opération
L'instance ECS que vous souhaitez gérer doit être dans l'état Stopped (Stopped).
-
Lorsque vous appelez cette opération pour modifier l'adresse IP privée ou le vSwitch d'une instance ECS, prenez note des éléments suivants :
-
Si l'instance est une nouvelle instance, vous devez redémarrer l'instance avant d'appeler cette opération.
-
Une fois l'adresse IP privée ou le vSwitch de l'instance modifié, vous devez redémarrer l'instance avant de pouvoir rappeler cette opération.
-
-
Lorsque vous appelez cette opération pour modifier le VPC d'une instance ECS, prenez note des éléments suivants :
-
Instance ECS :
-
L'instance ne peut pas être dans l'état Locked, To Be Released, Expired, To Be Recycled, Expired and Being Recycled, ou Overdue and Being Recycled. Pour plus d'informations, consultez Présentation des instances.
-
L'instance ne peut pas être associée à des instances Server Load Balancer (SLB).
-
L'instance ne peut pas être utilisée dans d'autres services Alibaba Cloud. Par exemple, l'instance ne peut pas être en cours de migration ou de modification de son VPC, et les bases de données déployées sur l'instance ne peuvent pas être gérées par Data Transmission Service (DTS).
-
-
Réseau :
-
Le mode cut-through ou le mode multi-adresse IP élastique (EIP) vers interface réseau élastique (ENI) ne peut pas être activé pour l'instance ECS.
-
L'instance ECS ne peut pas être associée à une adresse IP virtuelle haute disponibilité (HAVIP).
-
Le vSwitch de l'instance ECS ne peut pas être associé à une table de routage personnalisée.
-
Global Accelerator (GA) ne peut pas être activé pour l'instance ECS.
-
Des ENI secondaires ne peuvent pas être attachées à l'instance ECS.
-
L'instance ECS ne peut pas se voir attribuer d'adresse IPv6.
-
L'ENI principale de l'instance ECS ne peut pas être associée à plusieurs adresses IP.
-
Le vSwitch doit appartenir au nouveau VPC.
-
Les vSwitch d'origine et nouveau doivent résider dans la même zone.
-
Si vous attribuez une adresse IP privée à l'ENI principale de l'instance ECS, l'adresse IP privée doit être une adresse IP inactive dans le bloc CIDR du nouveau vSwitch. Si vous n'attribuez pas d'adresse IP privée à l'ENI principale de l'instance ECS, une adresse IP privée est attribuée aléatoirement à l'ENI. Assurez-vous qu'un nombre suffisant d'adresses IP est disponible dans le bloc CIDR du nouveau vSwitch.
-
Si vous utilisez un VPC partagé par un autre compte Alibaba Cloud avec votre compte et que vous souhaitez modifier les groupes de sécurité de l'instance ECS, spécifiez les groupes de sécurité que vous avez créés dans le VPC, au lieu du groupe de sécurité créé par le propriétaire du VPC, comme nouveaux groupes de sécurité.
-
-
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
ecs:ModifyInstanceVpcAttribute |
update |
*Instance
*VSwitch
|
|
Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| InstanceId |
string |
Oui |
L'identifiant de l'instance ECS. Remarque
Lorsque vous appelez cette opération, l'instance ECS doit être dans l'état Stopped ( |
i-bp1iudwa5b1tqag1**** |
| VSwitchId |
string |
Oui |
L'identifiant du nouveau vSwitch.
|
vsw-bp1s5fnvk4gn3tw12**** |
| PrivateIpAddress |
string |
Non |
La nouvelle adresse IP privée de l'instance ECS. Remarque
La valeur de Par défaut, si ce paramètre est vide, une adresse IP privée est attribuée aléatoirement à partir du bloc CIDR du vSwitch spécifié. |
172.17.**.** |
| VpcId |
string |
Non |
L'identifiant du nouveau VPC. |
vpc-bp1vwnn14rqpyiczj**** |
| SecurityGroupId |
array |
Non |
Les identifiants des nouveaux groupes de sécurité auxquels l'instance ECS appartient après la modification du VPC. Ce paramètre est requis uniquement si
|
sg-o6w9l8bc8dgmkw87**** |
|
string |
Non |
L'identifiant du nouveau groupe de sécurité N. |
sg-o6w9l8bc8dgmkw87**** |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemples
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | InvalidTarget.TrafficMirrorSession | Instance is target of traffic mirror session. | |
| 400 | InvalidSource.TrafficMirrorSession | Instance is source of traffic mirror session. | |
| 400 | InvalidPrivateIpAddress.Malformed | Specified private IP address is malformed. | The specified private IP address is invalid. |
| 400 | InvalidPrivateIpAddress.Duplicated | Specified private IP address is duplicated. | |
| 400 | IncorrectVSwitchStatus | The current status of virtual switch does not support this operation. | The specified vSwitch is in the Pending state and cannot be deleted. |
| 400 | IncorrectInstanceStatus | The current status of instance does not support this operation. | The instance is in a state that does not support the current operation. |
| 400 | OperationDenied | Specified operation is denied as your instance is not in VPC. | The specified instance does not reside in a VPC. |
| 400 | InvalidVSwitchId.Mismatch | Specified instance and virtual switch are not in the same zone. | The specified instance and vSwitch are not in the same zone. |
| 400 | InvalidPrivateIpAddress.Mismatch | Specified private IP address is not in the CIDR block of virtual switch. | The specified private IP address is not in the CIDR block of the specified vSwitch. |
| 400 | InvalidPrivateIp.Changing | Previous action is not finished yet. | The private IP address is being modified. |
| 400 | PrimaryEniHasSubIp | Primary network interface of the specified instance has more than one private ip. | The primary ENI has multiple secondary private IP addresses. |
| 400 | VSwitchIdNotMatch | The subnet of private ip is different to the instance, please unbind ha vip. | The CIDR block of the vSwitch does not contain the specified IP address. |
| 400 | InvalidOperation.EniCountExceeded | The number of ENIs in an enterprise security group has reached the maximum limit. | |
| 400 | InvalidParameter.SecurityGroupId | Security group ids are invalid. | Invalid security group ID |
| 400 | InvalidVSwitch.IllegalStatus | The operation is not allowed in the current VSwitch state. Expecting state includes "Created", but current state is "%s". | The current VSwitch status does not support this operation. |
| 401 | InvalidOperation.SecurityGroupNotAuthorized | The specified security group is not authorized to operate. | You do not have permission to operate the current security group. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied | The Specified operation is denied as your instance is locked for security reasons. | |
| 403 | InvalidIp.Ipv6Assigned | The specified instance has been assigned IPv6 address. | |
| 403 | SecurityGroupInstanceLimitExceed | %s | The number of instances in the security group has reached the maximum limit. |
| 403 | InvalidInstance.HasTransitionRecord | The operation is denied because the specified instance has a migration plan. | |
| 403 | InvalidInstanceStatus.NotNormal | The Specified operation is denied due to instance status. | |
| 403 | InvalidVpcId.SharedVpc | The Specified operation is denied as your targe vpc is SharedVpc. | |
| 403 | InvalidOperation.NotAllowed | The operation is denied because the specified VPC has advanced features enabled. | |
| 403 | InvalidParameter.ToSecurityGroupId | %s | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | You cannot modify security groups managed by cloud services. |
| 403 | InvalidOperation.VswAndEcsAvailabilityZoneMismatch | Specified instance and virtual switch are not in the same zone. | The instance and the destination VSwitch do not belong to the same zone. |
| 403 | InvalidOperation.CloudBoxEcsNotSupport | Cloud box ecs instance does not support modifying VPC. | Cloud box instances do not support modifying VPC |
| 403 | AclLimitExceed | %s | The number of ACL rules for an ENI or instance exceeds the upper limit. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
| 404 | InvalidVSwitchId.NotFound | Specified virtual switch does not exist. | The specified vSwitch ID does not exist. |
| 404 | NoSuchResource | The specified resource is not found. | The specified resource does not exist. |
| 404 | InvalidParameter.InvalidInstanceId | The specified InstanceId does not exist. | |
| 404 | InvalidParameter.VSwitchId | The specified virtual vswitch does not exist. | The specified vSwitch does not exist. |
| 404 | InvalidRegion.ValueNotSupported | The specified Region does not exist. | |
| 404 | InvalidInstance.AttachedEni | The Specified operation is denied due to elastic network interface. | The VPC cannot be changed while the instance has secondary ENIs bound. |
| 404 | InvalidIp.MultiPrimaryIp | The Specified operation is denied due to multi private ip. | This operation is not allowed while the primary ENI has multiple private IP addresses. |
| 404 | InvalidIp.Ipv6 | The Specified operation is denied due to ipv6. | |
| 404 | InvalidVSwitch.NotBelongToVpc | %s | The specified VSwitchId does not belong to the specified VPC. Check whether the parameter value is correct. |
| 404 | InvalidParameter.EniNo | %s | |
| 404 | InvalidSecurityGroupId.NotFound | %s | The specified security group ID does not exist. |
| 404 | InvalidParameter.SecurityGroupIdRepeated | %s | |
| 404 | InvalidSecurityGroupType.NotSupportClassic | The specified SecurityGroupIds have classic group type. | The specified security group is in the classic network. Check whether the specified SecurityGroupIds.N parameter is valid. |
| 404 | InvalidSecurityGroupVpc.NotBelongToOneVpc | The specified SecurityGroupIds are belong to different vpc. | The specified security groups belong to different VPCs. Check whether the specified SecurityGroupIds.N parameter is valid. You can call the DescribeSecurityGroups operation to query the VPCs to which the security groups belong. |
| 404 | EnterpriseGroupLimited.MutliGroupType | The specified instance can not join multi SecurityGroup types. | |
| 404 | InvalidParameter.AlreadyInTargetVpc | The specified instance is already in the destination VPC. | |
| 404 | InvalidParameter.SecurityGroupId | The specified SecurityGroupId.N is invalid or does not exist. | |
| 404 | JoinedGroupLimitExceed | The specified instance has exceed quota of SecurityGroup. | |
| 404 | InvalidParameter.MustBeEmpty | The specified parameter SecurityGroupId.N and VpcId need be empty. | The SecurityGroupId.N and VpcId parameters must be left empty. |
| 404 | InvalidParameter.NotEnoughIpInVSwitch | The specified virtual switch has not enough available ip. | |
| 404 | InvalidDependence.MutliDirectlyEip | The Specified operation is denied due to multi directly Eips. | |
| 404 | InvalidDependence.HaVip | The Specified operation is denied due to HaVip. | |
| 404 | InvalidDependence.NextHopOfCustomRouter | The Specified operation is denied due to next hop of Custom Router. | This operation is not allowed when the instance is the next hop of custom routes. |
| 404 | InvalidDependence.BeenUsedAsAppServer | The Specified operation is denied due to AppServer. | |
| 404 | InvalidDependence.GrantAccess | The Specified operation is denied due to grant access. | The ECS instance may use other products (such as DBS, DTS, DMS, and Workbench), have records of authorization for other products, and have reverse access rules. |
| 404 | InvalidDependence.BindGA | The Specified operation is denied due to GA. | |
| 404 | InvalidDependence.SLB | The Specified operation is denied as your instance with alb or clb. | The operation is denied because the instance is associated with an ALB instance or a CLB instance. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.