Forum Discussion
PowerShell: Duplicate Virtual Server with destination changed
Afternoon,
I'm a PowerShell person looking to do some work on our F5. Specifically, we are being forced to change our public IP's due to a change by our hosting provider. What I want to do is duplicate all of our existing Virtual Servers 100% (same iRules, http classes, EVERYTHING), save change their names and destinations. Preferably with PowerShell as I don't work with much else. I'm familiar with the POSHLTM module but am not certain if this captures all the data necessary to duplicate virtuals. Any guidance would be appreciated! I did see this question asked before, but the thread I saw was from 2012 and I imagine there may be new information since then.
Regards, SJ
- Satoshi_Toyosa1Ret. Employee
If you just want to change the destination IP address of a virtual, you can use curl from DOS prompt. The example below modifies the destination IP address of the virtual "vs" to 10.0.0.1:80.
curl -sku admin: https://192.168.0.1/mgmt/tm/ltm/virtual/vs -X PATCH -H "Content-type: application/json" -d "{\"destination\":\"10.0.0.1:80\"}"
where 192.168.0.1 is the BIG-IP's management port IP adddress. This is equivalent to
.tmsh modify ltm virtual vs destination 10.0.0.1:80
If you want to do the same for multiple virutals, you can use
(dos command). e.g.,for
.for %vs in (vs1 vs2 vs3) do curl .....
See Download page for the windows version curl.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com