Example #1
0
    def get_vrrp_subflow(self, prefix):
        sf_name = prefix + '-' + constants.GET_VRRP_SUBFLOW
        vrrp_subflow = linear_flow.Flow(sf_name)
        # TODO(omkartelee01) Need HA variables here
        vrrp_subflow.add(
            a10_database_tasks.GetVThunderByLoadBalancer(
                name=sf_name + '-' + a10constants.GET_LOADBALANCER_FROM_DB,
                requires=constants.LOADBALANCER,
                provides=a10constants.VTHUNDER))
        vrrp_subflow.add(
            a10_database_tasks.GetBackupVThunderByLoadBalancer(
                name=sf_name + '-' +
                a10constants.GET_BACKUP_LOADBALANCER_FROM_DB,
                requires=constants.LOADBALANCER,
                provides=a10constants.BACKUP_VTHUNDER))
        # VRRP Configuration
        vrrp_subflow.add(
            vthunder_tasks.ConfigureVRRPMaster(
                name=sf_name + '-' +
                a10constants.CONFIGURE_VRRP_FOR_MASTER_VTHUNDER,
                requires=(a10constants.VTHUNDER)))
        vrrp_subflow.add(
            vthunder_tasks.ConfigureVRRPBackup(
                name=sf_name + '-' +
                a10constants.CONFIGURE_VRRP_FOR_BACKUP_VTHUNDER,
                rebind={a10constants.VTHUNDER: a10constants.BACKUP_VTHUNDER}))
        vrrp_subflow.add(self._get_vrrp_status_subflow(sf_name))

        return vrrp_subflow
    def get_vrrp_subflow(self, prefix):
        sf_name = prefix + '-' + constants.GET_VRRP_SUBFLOW
        vrrp_subflow = linear_flow.Flow(sf_name)
        # TODO(omkartelee01) Need HA variables here
        vrrp_subflow.add(a10_database_tasks.GetVThunderByLoadBalancer(
            name=sf_name + '-' + a10constants.GET_LOADBALANCER_FROM_DB,
            requires=constants.LOADBALANCER,
            provides=a10constants.VTHUNDER))
        vrrp_subflow.add(a10_database_tasks.GetBackupVThunderByLoadBalancer(
            name=sf_name + '-' + a10constants.GET_BACKUP_LOADBALANCER_FROM_DB,
            requires=(constants.LOADBALANCER, a10constants.VTHUNDER),
            provides=a10constants.BACKUP_VTHUNDER))
        # Make sure devices are ready
        vrrp_subflow.add(vthunder_tasks.VThunderComputeConnectivityWait(
            name=sf_name + '-' + a10constants.WAIT_FOR_MASTER_SYNC + '-for-thunder',
            requires=(a10constants.VTHUNDER, constants.AMPHORA)))
        vrrp_subflow.add(vthunder_tasks.VThunderComputeConnectivityWait(
            name=sf_name + '-' + a10constants.WAIT_FOR_BACKUP_SYNC + '-for-thunder',
            rebind={a10constants.VTHUNDER: a10constants.BACKUP_VTHUNDER},
            requires=(constants.AMPHORA)))
        # VRRP Configuration
        vrrp_subflow.add(a10_database_tasks.AddProjectSetIdDB(
            name=sf_name + '-' + a10constants.ADD_VRRP_SET_ID_INDB,
            requires=constants.LOADBALANCER,
            provides=a10constants.SET_ID))
        vrrp_subflow.add(vthunder_tasks.ConfigureVRRPMaster(
            name=sf_name + '-' + a10constants.CONFIGURE_VRRP_FOR_MASTER_VTHUNDER,
            requires=(a10constants.VTHUNDER, a10constants.SET_ID)))
        vrrp_subflow.add(vthunder_tasks.ConfigureVRRPBackup(
            name=sf_name + '-' + a10constants.CONFIGURE_VRRP_FOR_BACKUP_VTHUNDER,
            requires=(a10constants.VTHUNDER, a10constants.SET_ID),
            rebind={a10constants.VTHUNDER: a10constants.BACKUP_VTHUNDER}))
        vrrp_subflow.add(self._get_vrrp_status_subflow(sf_name))

        return vrrp_subflow