Quantum关于Port的操作(LinuxBridge)
1 创建port
1.1 流程
(2012/12/13修正): 为port分配IP时,当没有指定fixed_ip,是从network中选一个有空闲IP的subnet分配IP ,而不是从所有subnet分配。
# 校验fixed_ips的合法性
def _test_fixed_ips_for_port(self, context, network_id, fixed_ips):
"""Test fixed IPs for port.
Check that configured subnets are valid prior to allocating any
IPs. Include the subnet_id in the result if only an IP address is
configured.
:raises: InvalidInput, IpAddressInUse
"""
fixed_ip_set = []
for fixed in fixed_ips:
found = False
# 如果没有指定subnet
if 'subnet_id' not in fixed:
# 如果既没有指定subnet,也没有指定ip_address,抛错
if 'ip_address' not in fixed:
&n