Avi ALB Service Engine Group Changes for Virtual Services using script
search cancel

Avi ALB Service Engine Group Changes for Virtual Services using script

book

Article ID: 401557

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

  • In large-scale Avi deployments within Azure Cloud, particularly those with a high number of Virtual Services configured with both private and public VIPs, manually changing the associated Service Engine (SE) Group for multiple Virtual Services as part of Azure SKU migration is required, that can be a time-consuming and error-prone process.
  • This can become a significant operational challenge during maintenance windows, migrations, or architectural adjustments that require moving a large set of Virtual Services to a different SE Group. 
  • This article provides a scripted approach to efficiently manage these changes, ensuring consistency and reducing manual effort.

Environment

This article is relevant for customers operating:

  • Avi Load Balancer (ALB) in Azure Cloud.
  • Environments with a high number of Virtual Services.
  • Virtual Services configured with both private and public VIPs.
  • Scenarios requiring bulk changes to the Service Engine Group associated with these Virtual Services as part of Avi Azure SKU migration from Basic to Standard

Cause

  • The challenge primarily arises from the operational overhead of individually updating each Virtual Service through the Avi UI or API when a large number of Virtual Services need to be reassigned to a new Service Engine Group. While the Avi UI/API allows individual modifications, it lacks a native bulk update mechanism for this specific attribute across many Virtual Services, leading to manual toil in scaled environments.

Resolution

  • To facilitate efficient and automated changes of Service Engine Groups for multiple Virtual Services, a scripting approach utilizing the Avi REST API is recommended.
  • The attached python script provides a robust framework to achieve it.

    Step1: Download the attached script and copy into Controller /tmp directory
    Step2: Get ServiceEngineGroup UUID using below command
    root@10-0-0-10:/tmp# shell
    Login: admin
    Password:
    [admin:]: > show serviceenginegroup
    +----------------------+---------------------------------------------------------+---------------+
    | Name                 | UUID                                                    | Cloud         |
    +----------------------+---------------------------------------------------------+---------------+
    | Default-Group        | serviceenginegroup-456962e0-d7bc-4322-a949-d7842354e46c | Default-Cloud |
    | Existing-SEG         | serviceenginegroup-ebfd8132-9809-444b-b311-56c83771ed77 | Default-Cloud |
    | New-SEG-Standard-SKU | serviceenginegroup-8ada60bc-6474-4e99-a11d-ecee56a5f0b8 | Default-Cloud |
    +----------------------+---------------------------------------------------------+---------------+

    Step3:

    root@controller-ip:/tmp# python3 disable_change_seg_enable_azure_vs.py -cseg <current-se-group-uuid> -tseg <new-se-group-uuid> -u admin -p <password> -api <controller-version>
    
    Below are the VSs' in SE group : <current-se-group-uuid>
    
    ['Private-VIP', 'Public-VIP']
    virtualservice-4e924aec-31d6-497a-8cae-fa4ffc96abc2  disabled
    virtualservice-4e924aec-31d6-497a-8cae-fa4ffc96abc2  newsegroup applied
    virtualservice-4e924aec-31d6-497a-8cae-fa4ffc96abc2  enabled
    
    virtualservice-645dc3b9-38c9-446e-a4d1-4850fdbe914c  disabled
    virtualservice-645dc3b9-38c9-446e-a4d1-4850fdbe914c  newsegroup applied
    virtualservice-645dc3b9-38c9-446e-a4d1-4850fdbe914c  enabled
    
    Script Execution Completed


    Step4: Now VSs enabled and create new service engine in new service engine group based on the seg configuration

Attachments

disable_change_seg_enable_azure_vs.py get_app