def create_ip_pool(self, subnet, vsm_ip=None):
        """Create a subnet on VSM.

        :param subnet: subnet dict
        :param vsm_ip: string representing the IP address of the VSM
        """
        if subnet['cidr']:
            try:
                ip = netaddr.IPNetwork(subnet['cidr'])
                netmask = str(ip.netmask)
                network_address = str(ip.network)
            except (__HOLE__, netaddr.AddrFormatError):
                msg = _("Invalid input for CIDR")
                raise n_exc.InvalidInput(error_message=msg)
        else:
            netmask = network_address = ""

        if subnet['allocation_pools']:
            address_range_start = subnet['allocation_pools'][0]['start']
            address_range_end = subnet['allocation_pools'][0]['end']
        else:
            address_range_start = None
            address_range_end = None

        body = {'addressRangeStart': address_range_start,
                'addressRangeEnd': address_range_end,
                'ipAddressSubnet': netmask,
                'description': subnet['name'],
                'gateway': subnet['gateway_ip'],
                'dhcp': subnet['enable_dhcp'],
                'dnsServersList': subnet['dns_nameservers'],
                'networkAddress': network_address,
                'netSegmentName': subnet['network_id'],
                'id': subnet['id'],
                'tenantId': subnet['tenant_id']}
        return self._post(self.ip_pool_path % subnet['id'],
                          body=body, vsm_ip=vsm_ip)
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/n1kv/n1kv_client.py/Client.create_ip_pool