【openstack】Quantum关于Port的操作(LinuxBridge)

本文详细介绍了Quantum在LinuxBridge环境下对Port的操作,包括创建时的IP分配逻辑,删除流程,以及更新流程。创建Port时,会验证fixed_ips的合法性,若未指定subnet_id则根据ip_address在network的subnets中查找。删除和更新Port涉及不同的操作流程。请注意,更新Port需要与底层agent交互。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Quantum关于Port的操作(LinuxBridge)

1      创建port

1.1    流程


(2012/12/13修正): 为port分配IP时,当没有指定fixed_ip,是从network中选一个有空闲IPsubnet分配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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值