Multi Nic with multiple network gateway dhcp parameter distribution

Bug #1025817 reported by Nachi Ueno
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Medium
Nachi Ueno

Bug Description

Quantum-DHCP-Agent distribute multiple dhcp parameter for VM when VM use multi nic with multiple networks.

Let's say VM A is connected to both of Network10 and Network20

Network 10
  Gateway 10.1

Network20
  Gateway 20.1

Both of gateway parameter is distributes to the VM, this makes VM unstable.
The used default gateway will be changed by timing.

Revision history for this message
Nachi Ueno (nati-ueno) wrote :

http://wiki.openstack.org/QuantumV2APIIntro
says

subnets host_route attribute should be default route to gateway_ip.
So Quantum-DHCP should use host_route parameter as gateway parameter.

So this bug is depilation of https://bugs.launchpad.net/quantum/+bug/1022737

Nachi Ueno (nati-ueno)
Changed in quantum:
assignee: nobody → Nachi Ueno (nati-ueno)
Revision history for this message
dan wendlandt (danwent) wrote :

Nachi,

The easiest way to avoid this is to only specify a gateway IP on one of the subnets. If you're in a (somewhat strange) setup where each subnet needs to have a default gateway, then you should just make sure that only one of the ports that is created has a default route (you can customize the routes on a per-port basis). This may become more clear when Josh pushes his branch.

Revision history for this message
Nachi Ueno (nati-ueno) wrote :

Hi Dan

Is that possible to not specify gateway ip?

http://wiki.openstack.org/QuantumV2APIIntro says
default value of gateway_ip is .1 of cidr

And implementation always distribute subnet.gateway_ip
https://github.com/openstack/quantum/blob/master/quantum/agent/linux/dhcp.py#L238

Revision history for this message
dan wendlandt (danwent) wrote :

Hi Nachi,

That's probably a bug in the DHCP code, as it is possible for the gatway_ip field in the DB to be NULL by passing in 'None' in the API request (the default is only applied if gateway_ip is not specified in the request at all).

I've been meaning to ask Yong how we specify a "None" value via the CLI... could you work with him on that? We may need to file a bug on that.

Revision history for this message
dan wendlandt (danwent) wrote :

Actually Salvatore informed that there is not a unit test for Null gateway_ip, and that some of the other logic within db_plugin_base_v2.py may be broken as well when gateway_ip is None. Nachi, do you want to file a bug to track work to test and fix these issues?

Revision history for this message
Nachi Ueno (nati-ueno) wrote :

Hi Dan

Thank you for your response
Should I do this job in this bug ticket or should I create new bug then close this one ?

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

There are actually two aspects in this bug:
1 - at the API layer we should make sure that there's a way of creating a subnet without a gateway
2 - in the DHCP agent we should make sure that if a subnet has no gateway the router option is not sent in the dhcp offer.

If both things are not happening at the moment I would file two distinct bugs.
We're pretty sure #1 is broken now, I am looking at the dhcp code for #2.

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

A slightly more detailed analysis (meaning I've actually looked at the code, and its history) suggests we go for two bugs.

This bugs might address the dhcp issue, as:

    def _output_opts_file(self):
        """Write a dnsmasq compatible options file."""
        # TODO (mark): add support for nameservers
        options = []
        for i, subnet in enumerate(self.network.subnets):
            if subnet.ip_version == 6:
                continue
            else:
                options.append((self._TAG_PREFIX % i,
                                'option',
                                'router',
                                subnet.gateway_ip))

        name = self.get_conf_file_name('opts')
        replace_file(name, '\n'.join(['tag:%s,%s:%s,%s' % o for o in options]))
        return name

Will always assign the dhcp router option no matter what is in the gateway_ip attribute.
For the API layer, we need a solution for specifying subnets without a default gateway. Nachi, could you please file another bug report for it?

Changed in quantum:
importance: Undecided → Medium
status: New → Confirmed
milestone: none → folsom-3
Revision history for this message
Nachi Ueno (nati-ueno) wrote :
Revision history for this message
dan wendlandt (danwent) wrote :

Thanks Nachi. I would create specific bugs for each fix. This will help reviewers.

Revision history for this message
Nachi Ueno (nati-ueno) wrote :

Thanks dan

Would you set status of this bug ticket after you created two ticket :)?

Nachi Ueno (nati-ueno)
Changed in quantum:
status: Confirmed → Invalid
Revision history for this message
Nachi Ueno (nati-ueno) wrote :
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-3 → none
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.