Closed cj-chung closed 3 years ago
We need to fix this issue when we get a chance.
We will need to change PM @chenpiaoping and SM @kevin-zhonghao at the same time.
Does the deletion of vpc also need to query whether subnet exists?
@xieus @cj-chung Since PM does not know which is gateway port and which is non-gateway port, and therefore does not know the number of non-gateway port, how about returning all the port id in subnet?
@chenpiaoping @kevin-zhonghao @xieus PM is able to know a port is either a normal port or a gw port. Subnet Manager will ask PM the number of normal ports under a subnet, if it returns zero, the deletion can go forward, otherwise a warning message will be displayed. So, just return the number of normal ports for the question subnet.
Description: When a subnet is deleted, we need to check if there exist any gateway port or non-gateway port in the subnet. All ports need to be deleted before deleting the subnet. If there exists any non-gateway port, SM needs to raise a warning message and deny the deletion event.
Issue: In the current implementation, Subnet only has gateway port id, SM is able to ask PM to delete gateway port by port-id. However, subnet doesn't have normal port (port attached to VM) information. SM cannot query PM about related ports just by subnet-id.
Propose Solution:
Create an API in PM for SM to query its related non-gateway ports by subnet-id. Input: subnet_id Response: # of non-gateway ports (non-negative integer number)