You can subscribe to notifications for vSwitch change events.
Notifications for vSwitch change events
A vSwitch change event is generated when a vSwitch change process is complete. vSwitch change events are generated in the following scenarios:
The virtual private cloud (VPC) in which an Elastic Compute Service (ECS) instance resides is replaced.
The vSwitch to which an ECS instance is connected is replaced.
An ECS instance is migrated from the classic network to a VPC as scheduled.
The instance type of an ECS instance is changed across zones.
An ECS instance is transferred from one account to another account.
The following sample code provides an example of a notification for a vSwitch change event:
{
"id":"2256A988-0B26-4E2B-820A-8B********A5",
"product":"ECS",
"resourceId":"acs:ecs:cn-hangzhou:169070********30:eni/eni-8vb1qo********cdeg2n",
"level":"INFO",
"name":"Instance:VSwitchChanged",
"userId":"169070********30",
"eventTime":"20230409T121826.922+0800",
"regionId":"cn-hangzhou",
"content":{
"instanceId":"i-8vb1qo********cdeg2n",
"vswitchId":"vsw-bp1s5fnvk4gn3tw12****",
"privateIpAddress":"172.17.XX.XX",
"vpcId":"vpc-bp1vwnn14rqpyiczj****",
"secondaryPrivateIps":["172.17.XX.XX"]
}
}
The following table describes the fields that are contained in the content
parameter.
Field | Description | Example |
instanceId | The ID of the ECS instance. | i-bp1ecr********5go2go |
vswitchId | The ID of the vSwitch to which the ECS instance is connected. | vsw-bp1s5fnvk4gn3tw12**** |
privateIpAddress | The primary private IP address of the ECS instance. | 172.17.XX.XX |
vpcId | The ID of the VPC in which the ECS instance resides. | vpc-bp1vwnn14rqpyiczj**** |
secondaryPrivateIps | The secondary IP addresses of the primary network interface on the ECS instance. | ["172.17.XX.XX"] |