Creating a ipam via vnc_api resulted in addresses being allocated from the end of subnet range (addr_from_start attr is null)

Bug #1466751 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Opinion
Medium
Sachin Bansal

Bug Description

R2.20 Build 53 Ubuntu 14.04 Juno

Below ipam was created with vnc_api as below. It is seen that addr_from_start is set to null which causes all the ips - default-gw, dns, host ips etc. to be allocated from the end of the IP address range.

We should have the addr_from_start set to true by default.

ipam_obj = NetworkIpam('ipam%s' % (vn_index), proj_obj, IpamType("dhcp"))
ipam_fq_name = ipam_obj.get_fq_name()
ipam_real_obj = vh.network_ipam_create(ipam_obj)

api_vn_obj = VirtualNetwork(name=vn_name, parent_obj=proj_obj)
vn_id = vh.virtual_network_create(api_vn_obj)
ipam = vh.network_ipam_read(fq_name=ipam_fq_name)
ipam_sn_lst = []
network, prefix = str(subnets[subnet_index]).split('/')
ipam_sn = IpamSubnetType(subnet=SubnetType(network, int(prefix)))
ipam_sn_lst.append(ipam_sn)
api_vn_obj.add_network_ipam(ipam, VnSubnetsType(ipam_sn_lst))
vh.virtual_network_update(api_vn_obj)

-------
{
    "network-ipam": {
        "display_name": "ipam1",
        "fq_name": [
            "default-domain",
            "p3",
            "ipam1"
        ],
        "href": "http://127.0.0.1:8095/network-ipam/564875ea-1942-47e1-b7aa-f80b95c8aab0",
        "id_perms": {
            "created": "2015-06-19T06:23:38.976287",
            "creator": null,
            "description": null,
            "enable": true,
            "last_modified": "2015-06-19T06:23:38.976287",
            "permissions": {
                "group": "KeystoneAdmin",
                "group_access": 7,
                "other_access": 7,
                "owner": "admin",
                "owner_access": 7
            },
            "user_visible": true,
            "uuid": {
                "uuid_lslong": 13234663183622908592,
                "uuid_mslong": 6217348933891540961
            }
        },
        "name": "ipam1",
        "network_ipam_mgmt": {
            "cidr_block": null,
            "dhcp_option_list": null,
            "host_routes": null,
            "ipam_dns_method": null,
            "ipam_dns_server": null,
            "ipam_method": "dhcp"
        },
        "parent_href": "http://127.0.0.1:8095/project/abae5981-2dfc-4f0d-8cdc-64c380f80165",
        "parent_type": "project",
        "parent_uuid": "abae5981-2dfc-4f0d-8cdc-64c380f80165",
        "uuid": "564875ea-1942-47e1-b7aa-f80b95c8aab0",
        "virtual_network_back_refs": [
            {
                "attr": {
                    "host_routes": null,
                    "ipam_subnets": [
                        {
                            "addr_from_start": null,
                            "allocation_pools": [],
                            "default_gateway": "100.1.1.14",
                            "dhcp_option_list": null,
                            "dns_nameservers": [],
                            "dns_server_address": "100.1.1.13",
                            "enable_dhcp": true,
                            "host_routes": null,
                            "subnet": {
                                "ip_prefix": "100.1.1.0",
                                "ip_prefix_len": 28
                            },
                            "subnet_name": null,
                            "subnet_uuid": "d2517c6f-dfe4-4052-b30f-c19a5bf71f84"
                        }
                    ]
                },
                "href": "http://127.0.0.1:8095/virtual-network/b88fa61e-d74f-403a-a0c2-a200abad5f93",
                "to": [
                    "default-domain",
                    "p3",
                    "scalevn1"
                ],
                "uuid": "b88fa61e-d74f-403a-a0c2-a200abad5f93"
            }
        ]
    }
}

Tags: config
Sachin Bansal (sbansal)
Changed in juniperopenstack:
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.