Forum Discussion

jgroen_43244's avatar
jgroen_43244
Icon for Nimbostratus rankNimbostratus
Sep 27, 2013
Solved

How to create a new node and it add it to a pool as disabled.

I am trying to create a new node and add it to a pool as disabled. Currently, I cannot find anything in the API that will allow me to do that.   I can create and add it as enabled using LocalLB::P...
  • travis_94010's avatar
    Oct 01, 2013

    It sounds like you're running into an issue with your node names. I'm guessing your error is that the address specified already matches an existing node?

    When a node is created with

    LocalLB::Pool::add_member_v2()
    

    The name of the created node (if it doesn't already exist) is the same as the IP address you gave it.

    So when you create the node with

    LocalLB::NodeAddressV2::create()
    

    Just pass the IP address as the name as well. That way, you can create it, disable it with

    LocalLB::NodeAddressV2::set_session_enabled_state
    

    as stated by the others, and then add it to the pool you want. You won't run into the issue I'm guessing you have. The last call will match the specified AddressPorts to the existing nodes.