Forum Discussion

kelemvor_50002's avatar
kelemvor_50002
Icon for Nimbostratus rankNimbostratus
Jul 12, 2013

Can I change the default pool for a virt via Powershell?

Pretty self explanatory. I have virts and pools and just want to change one virt to point to a different pool via Powershell. What's the easiest way to do that?

 

2 Replies

  • The pool is an attribute on the Virtual server. To set the default pool, just use the LocalLB.VirtualServer.set_default_pool_name() method.

     

    https://devcentral.f5.com/wiki/iCon..._name.ashx

     

    There's a perl sample in the CodeShare that uses that method.

     

    https://devcentral.f5.com/wiki/iCon...tPool.ashx

     

    For the PowerShell snapin, to set the virtual "virtual_name" default pool to "pool_name", do something like this:

     

    PS> Initialize-F5.iControl -hostname bigip_addr -username user -password pass

     

    PS> $ic = Get-F5.iControl

     

    PS> $ic.LocalLBVirtualServer.set_default_pool_name( @("virtual_name"), @("pool_name"))

     

    Hope this helps...

     

    -Joe