For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

RAQS's avatar
RAQS
Icon for Cirrus rankCirrus
Aug 29, 2019

How to automate LB VIP Creation

Hi Team,

 

Greetings for the day!

 

How can i automate LB VIP creation (Full setup - like to deploy new application behind LB.). Is this can be done via any script ot by F5 itself ? Or, do i need to get a third party tool

 

Regards,

ShashankS

4 Replies

  • You can script it using iControlREST or you could use something like Ansible or Terraform as 3rd party tools.

     

    All depends on your trigger, what will happen to require a new VS to be configured on the F5 in question?

  • Hi Andy,

     

    Thanks for reply,

     

    Can you please guide me , on how i can achieve this with iControlREST

     

    Requirement is to automate the full steps of deploying application behind LB. (Like creating node , creating pool members , creating pool , creation of vip and apply required features like LB method , persistence ,binding certificate.

     

    Regards,

    ShashankS

  • Best resource to get started is here: https://clouddocs.f5.com/api/icontrol-rest/

     

    Also look at the code shares and articles here on DevCentral for a load of resource and help with iControl.

     

    Warning: The older 'iControl' uses SOUP where iControl-Rest uses REST, iControl-Rest is recommended but if you find an article on iControl it may be using SOUP instead of REST.

  • Thanks Andy for sharing an article and sorry for delay response .

     

    Can you please let me know where should i run below code :- (like normally we run on CLI of F5)

     

    curl -sku admin:admin https://<host>/mgmt/tm/ltm/virtual -H "Content-Type: application/json" -X POST

    -d '{"name": "vs", \

      "destination": "10.10.10.10:10", \

      "mask": "255.255.255.255", \

      "pool": "CentOS-all80", \

      "persist": [ {"name": "cookie"} ], \

      "profilesReference": {"items": [ {"context": "all", "name": "http"}, {"context": "all", "name": "tcp"}, {"context": "clientside", "name": "clientssl"}] }, \

      "rules": [ "ShowVersion" ], \

      "sourceAddressTranslation": {"type": "automap"} }'

     

    Regards,

    ShashankS