f5-sdk
2 TopicsUpdate / Modify a Traffic Group of a Virtual Address using F5-SDK
Problem this snippet solves: I have an Active-Active LTM Deployment. Virtual Servers ( and Virtual Addresses ) are split between two units. I am trying to use F5-SDK to update traffic group so that VS/VA will move between two units. How to use this snippet: Environment Python : 3.6 F5 SDK : 3.0.20 LTM : 12.1.2 HF2 Code : from f5.bigip import ManagementRoot import sys # This will update a traffic group on a virtual address on the same bigip # Vars New_BigIP_IP = "10.10.10.10" Virt_Addr = "192.168.13.151" Traffic_Group = '/Common/traffic-group-2' # Connect f5_mgmt = ManagementRoot(New_BigIP_IP, username, password) # load Virtual Address v_a_info = f5_mgmt.tm.ltm.virtual_address_s.virtual_address.load(name=Virt_Addr,partition='Common') # Verify if traffic group needs to be updated if v_a_info.trafficGroup == Traffic_Group: print ("Traffic groups are same - no need to update - \nexiting ... ") sys.exit() #Capture the Old Traffic Group Old_Traffic_Group = v_a_info.trafficGroup print("\nOld Traffic Group : {} \nNew Traffic Group:}".format(Old_Traffic_Group,Traffic_Group)) input("Press any key to Continue.. ") # Update the New Traffic Group v_a_info.modify(trafficGroup=Traffic_Group) print ("== Traffic Group has been updated ==\n") Tested this on version: 12.1899Views0likes2CommentsMigrate BigIP Configuration - using f5-sdk and python
Problem this snippet solves: I came across a situation where I need to replace Old BigIP unit with a newer one. I have decided to use python and f5-sdk to read all the different bigip components from source unit and deploy on the destination unit and then compare the config. I have put all the code on github.com as : https://github.com/mshoaibshafi/f5-networks-bigip-migrate-configuration How to use this snippet: The code is as modular as possible and you can start from the file name "Main.py" It follows the following sequence : Migrate Monitors Migrate Pools Migrate Virtuals Migrate Users Compare Configuration Code : GitHub.com Repo : https://github.com/mshoaibshafi/f5-networks-bigip-migrate-configuration Tested this on version: 12.1415Views0likes0Comments