Beispiel #1
0
    def _get_amp_net_subflow(self, sf_name):
        flows = []
        flows.append(network_tasks.PlugVIPAmpphora(
            name=sf_name + '-' + constants.PLUG_VIP_AMPHORA,
            requires=(constants.LOADBALANCER, constants.AMPHORA,
                      constants.SUBNET),
            provides=constants.AMP_DATA))

        flows.append(network_tasks.ApplyQosAmphora(
            name=sf_name + '-' + constants.APPLY_QOS_AMP,
            requires=(constants.LOADBALANCER, constants.AMP_DATA,
                      constants.UPDATE_DICT)))
        flows.append(database_tasks.UpdateAmphoraVIPData(
            name=sf_name + '-' + constants.UPDATE_AMPHORA_VIP_DATA,
            requires=constants.AMP_DATA))
        flows.append(database_tasks.ReloadAmphora(
            name=sf_name + '-' + constants.RELOAD_AMP_AFTER_PLUG_VIP,
            requires=constants.AMPHORA,
            provides=constants.AMPHORA))
        flows.append(database_tasks.ReloadLoadBalancer(
            name=sf_name + '-' + constants.RELOAD_LB_AFTER_PLUG_VIP,
            requires=constants.LOADBALANCER_ID,
            provides=constants.LOADBALANCER))
        flows.append(network_tasks.GetAmphoraNetworkConfigs(
            name=sf_name + '-' + constants.GET_AMP_NETWORK_CONFIG,
            requires=(constants.LOADBALANCER, constants.AMPHORA),
            provides=constants.AMPHORA_NETWORK_CONFIG))
        flows.append(amphora_driver_tasks.AmphoraPostVIPPlug(
            name=sf_name + '-' + constants.AMP_POST_VIP_PLUG,
            rebind={constants.AMPHORAE_NETWORK_CONFIG:
                    constants.AMPHORA_NETWORK_CONFIG},
            requires=(constants.LOADBALANCER,
                      constants.AMPHORAE_NETWORK_CONFIG)))
        return flows
Beispiel #2
0
    def get_new_LB_networking_subflow(self):
        """Create a sub-flow to setup networking.

        :returns: The flow to setup networking for a new amphora
        """
        LOG.info("Inside network subflow")
        new_LB_net_subflow = linear_flow.Flow(
            constants.LOADBALANCER_NETWORKING_SUBFLOW)
        new_LB_net_subflow.add(
            network_tasks.AllocateVIP(requires=constants.LOADBALANCER,
                                      provides=constants.VIP))
        new_LB_net_subflow.add(
            database_tasks.UpdateVIPAfterAllocation(
                requires=(constants.LOADBALANCER_ID, constants.VIP),
                provides=constants.LOADBALANCER))
        new_LB_net_subflow.add(
            network_tasks.PlugVIP(requires=constants.LOADBALANCER,
                                  provides=constants.AMPS_DATA))
        LOG.info("After plugging the VIP")
        new_LB_net_subflow.add(
            network_tasks.ApplyQos(requires=(constants.LOADBALANCER,
                                             constants.AMPS_DATA,
                                             constants.UPDATE_DICT)))
        new_LB_net_subflow.add(
            database_tasks.UpdateAmphoraVIPData(requires=constants.AMPS_DATA))
        new_LB_net_subflow.add(
            database_tasks.ReloadLoadBalancer(
                name=constants.RELOAD_LB_AFTER_PLUG_VIP,
                requires=constants.LOADBALANCER_ID,
                provides=constants.LOADBALANCER))
        new_LB_net_subflow.add(
            network_tasks.GetAmphoraeNetworkConfigs(
                requires=constants.LOADBALANCER,
                provides=constants.AMPHORAE_NETWORK_CONFIG))
        new_LB_net_subflow.add(
            database_tasks.GetAmphoraeFromLoadbalancer(
                requires=constants.LOADBALANCER, provides=constants.AMPHORA))
        #new_LB_net_subflow.add(amphora_driver_tasks.AmphoraePostVIPPlug(
        #    requires=(constants.LOADBALANCER,
        #              constants.AMPHORAE_NETWORK_CONFIG)))

        # Get VThunder details from database
        #new_LB_net_subflow.add(a10_database_tasks.GetVThunderByLoadBalancer(
        #    requires=constants.LOADBALANCER,
        #    provides=a10constants.VTHUNDER))
        new_LB_net_subflow.add(
            vthunder_tasks.AmphoraePostVIPPlug(
                requires=(constants.LOADBALANCER, a10constants.VTHUNDER)))
        new_LB_net_subflow.add(
            vthunder_tasks.VThunderComputeConnectivityWait(
                requires=(a10constants.VTHUNDER, constants.AMPHORA)))
        new_LB_net_subflow.add(
            vthunder_tasks.EnableInterface(requires=a10constants.VTHUNDER))

        LOG.info("AT the end of subflow")

        return new_LB_net_subflow