Forum Discussion

mhite_60883's avatar
Icon for Cirrocumulus rankCirrocumulus
Mar 21, 2011

LocalLB::Class::set_address_class_member_data_value Problems

Hello F5 friends,



I'm building out some automagic cloud automation. I've got a data group address list called "dev_staging_allocation" defined on an LTM that is supposed to hold a list of all unallocated virtual server IP addresses that are available for provisioning. This data group/class looks like:
   name = "dev_staging_allocation"
   members[] = 
         address = ""
         netmask = ""
         address = ""
         netmask = ""
         address = ""
         netmask = ""
         address = ""
         netmask = ""
         address = ""
         netmask = ""
Each of the entries are assigned values: either "allocated", "unallocated", or "pending." I'm attempting to use pycontrol to look for an unallocated address and mark it as "pending." I've been able to grab the first available "unallocated" address fine. It's when I go to update the member data value list that it all falls apart with a mysterious error:
>>> lb_provision.get_unallocated_address(c, unallocated_identifier)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 409, in get_unallocated_address
    c.set_address_class_member_data_value(unallocated_identifier_class, [unallocated_identifier_class_member_data_value])
  File "/Library/Python/2.6/site-packages/suds/", line 539, in __call__
    return client.invoke(args, kwargs)
  File "/Library/Python/2.6/site-packages/suds/", line 598, in invoke
    result = self.send(msg)
  File "/Library/Python/2.6/site-packages/suds/", line 633, in send
    result = self.failed(binding, e)
  File "/Library/Python/2.6/site-packages/suds/", line 684, in failed
    r, p = binding.get_fault(reply)
  File "/Library/Python/2.6/site-packages/suds/bindings/", line 238, in get_fault
    raise WebFault(p, faultroot)
WebFault: Server raised fault: 'Error de-serializing array.  Too many values in array.  Array specified 1, found 127.'
Here's a code snippet:
def build_class_object(ltm, user, pw):
    b = pc.BIGIP(hostname=ltm, username=user, password=pw, 
                 wsdls=['LocalLB.Class'], fromurl=True)
    c = b.LocalLB.Class
    return c
def get_unallocated_address(c, unallocated_identifier):
    address_class_list = c.get_address_class_list()
     make sure unallocated data group exists
    if address_class_list.count(unallocated_identifier) == 1:
        unallocated_identifier_class = c.get_address_class([unallocated_identifier])
        unallocated_identifier_class_member_data_value = c.get_address_class_member_data_value([unallocated_identifier_class])
         find 1st available address
        class_length = len(unallocated_identifier_class_member_data_value[0])
        if class_length > 0:
            for i in range(0, class_length):
                if unallocated_identifier_class_member_data_value[0] == "unallocated":                    
                     mark it as pending allocation
                    unallocated_identifier_class_member_data_value[0] = "pending" 
                    c.set_address_class_member_data_value(unallocated_identifier_class, [unallocated_identifier_class_member_data_value])
                    ip_addr = str(unallocated_identifier_class[0][1][0])
                    netmask = str(unallocated_identifier_class[0][1][1])
                print "Error: no unallocated address available"
            print "Error: data group is empty"
        print "Error: unallocated IP data group %s does not exist" % unallocated_identifier
    return ip_addr, netmask
Any ideas of what I'm doing wrong? It's too bad you can't update the values of individual data group items. Right now -- at least from what I can tell -- you have to replaster the entire value list if you want to update it.

1 Reply

  • Hey

    I am having the same issue with a different API call.

    WSDL = ['GlobalLB.WideIP']
    WIDE_IP_NAME = ''
    b = pycontrol.pycontrol.BIGIP(hostname=HOST1, username=USER, password=PASS, fromurl=True, wsdls=WSDL)
            wide_ips = [WIDE_IP_NAME],
            aliases = [['', '', '']]


    File "build/bdist.linux-x86_64/egg/suds/", line 539, in __call__

    File "build/bdist.linux-x86_64/egg/suds/", line 598, in invoke

    File "build/bdist.linux-x86_64/egg/suds/", line 633, in send

    File "build/bdist.linux-x86_64/egg/suds/", line 684, in failed

    File "build/bdist.linux-x86_64/egg/suds/bindings/", line 238, in get_fault

    suds.WebFault: Server raised fault: 'Error de-serializing array. Too many values in array. Array specified 1, found 3.'

    Had a quick google, seems like there's an issue with the suds not marshalling array of array correctly. However, I am not able to get the solution described there to work in pycontrol.

    Does anyone else having the issue or work around to the problem?