Forum Discussion
dr_tamfr_dhp_19
Nov 12, 2015Nimbostratus
Possible to specify FQDN for new node address via iControl and Powershell?
Product : Virtual BigIP LTM ProductVersion : 11.6.0 PackageVersion : Build 5.13.429 - Thu Jul 23 16:58:10 PDT 2015 PackageEdition : Engineering Hotfix HF5 Hi, Working on an automated solution...
ShaneCal_162988
Oct 27, 2016Altocumulus
Based on the answer posted by R Marc, I've created a function in PowerShell that creates pools with new FQDN nodes.
Function Create-Pools
{
<
.SYNOPSIS
Creates a new pool with a new FQDN node
>
[CmdletBinding(HelpURI="https://devcentral.f5.com/questions/possible-to-specify-fqdn-for-new-node-address-via-icontrol-and-powershell")]
param([Parameter(Mandatory=$true)][string]$poolName,
[Parameter(Mandatory=$true)][string]$NodeFqdn,
[Parameter(Mandatory=$true)][string]$port,
[Parameter(Mandatory=$true)][System.Net.WebClient]$webclient,
[Parameter(Mandatory=$true)][string]$F5Host)
$webclient.headers.Add("Content-Type: application/json")
$json='{
"members": [
{
"fqdn": {
"autopopulate": "enabled",
"tmName": "'+$NodeFqdn+'"
},
"name": "'+$NodeFqdn+':'+$port+'",
"priorityGroup": 0
}
],
"name": "'+$poolName+'"
}'
$webclient.UploadString("https://$F5Host/mgmt/tm/ltm/pool","POST",$json)
}
Here's some sample usage:
Construct the webclient object
$webclient = New-Object System.Net.WebClient
$creds = New-Object System.Net.NetworkCredential($username,$password)
$webclient.Credentials = $creds
Create-Pools -poolName "MyPoolName" -NodeFqdn "webserver.test.com" -port 80 -webclient $webclient -F5Host "MyF5Server"
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects