Home >Operation and Maintenance >Linux Operation and Maintenance >How to modify the VPC properties of an ECS instance
This article introduces how to modify the VPC attributes of an ECS instance, and focuses on the specific steps. The content of this article is compact, and I hope you can gain something from it.
ModifyInstanceVpcAttribute
Description
Only supports modifying the VPC attributes of ECS instances in the Stopped state.
The newly created ECS instance must go through a round of starting and stopping before it can call this interface.
The ECS instance that has successfully modified the VPC attributes must go through a round of starting and stopping before calling this interface.
When specifying VSwitchId to modify VPC attributes, the specified VSwitchId must belong to the current private network.
When specifying VSwitchId without specifying PrivateIpAddress, the system automatically assigns a private IP to the ECS instance.
The current switch and the new switch (VSwitchId) of the specified instance must belong to the availability zone in the same region.
The current switch and the new switch (VSwitchId) of the specified instance must belong to the same VPC.
When specifying VSwitchId and PrivateIpAddress at the same time, the private IP must belong to the network segment of the specified switch. PrivateIpAddress depends on VSwitchId, PrivateIpAddress cannot be specified separately.
For more VPC related interfaces, please see the API reference of private network (VPC).
Request parameters
##Return parameters
are all public return parameters. See Public ParametersExample
Request Example
https://ecs.aliyuncs.com/?Action=ModifyInstanceVpcAttribute &InstanceId=35F20777-0DFF-C152-41FA-BCE0EA0B2FD7 &VSwitchId=[vswitchid] &<公共请求参数>
Return Example
XML format
<ModifyInstanceAttributeResponse> <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId> </ModifyInstanceAttributeResponse> JSON 格式{ "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E" }
Error code
The following is Error code unique to this interface. For more error codes, please visit the API Error Center.The above is the detailed content of How to modify the VPC properties of an ECS instance. For more information, please follow other related articles on the PHP Chinese website!