venkata anil [Wed, 24 Jun 2015 07:33:09 +0000 (07:33 +0000)]
dhcp fails if extra_dhcp_opts for stateless subnet enabled
vm on a network having IPv4 and IPv6 dhcpv6 stateless subnets,
fails to get IPv4 address, when vm uses a port with extra_dhcp_opts.
neutron creates entries in dhcp host file for each subnet of a port.
Each of these entries will have same mac address as first field,
and may have client_id, fqdn, ipv4/ipv6 address for dhcp/dhcpv6 stateful,
or tag as other fields.
For dhcpv6 stateless subnet with extra_dhcp_opts,
host file will have only mac address and tag.
If the last entry in host file for the port with extra_dhcp_opts,
is for dhcpv6 stateless subnet, then dnsmasq tries to use this entry,
(as dnsmasq reads the hosts file from EOF) to resolve
dhcp request even for IPv4, treats as 'no address found'
and fails to send DHCPOFFER.
So we sort the fixed_ips, so that ipv6 subnets for the port are added
first in host file, to avoid this issue.
Pavel Bondar [Thu, 18 Jun 2015 12:24:44 +0000 (15:24 +0300)]
Move _delete_port
Pluggable ipam implementation will do additional actions on port
deletion (deallocate ip using ipam driver).
Existing _delete_port code will be resused.
Moving _delete_port to ipam_backend_mixin to make this code
accessible and extendable by both backends (pluggable and non
pluggable).
This commit is a preparation step before pluggable ipam implementation
can be used.
Pavel Bondar [Thu, 18 Jun 2015 11:52:24 +0000 (14:52 +0300)]
Decompose create_port and save_subnet
This commit is a preparation step for enabling pluggable ipam.
Some actions in create_port and save_subnet are specific for
non pluggable ipam implementation.
- create_port
Moved allocation ips for port and storing results into separate method
_allocate_ips_for_port_and_store.
Moved to ipam_non_pluggable_backend, since pluggable implementation will
be different due to rollback on failure logic included.
- save_subnet
Moved saving allocation pools into new method _save_allocation_pools.
Moved to ipam_non_pluggable_backend, since pluggable ipam implementation
does not need to save IPAvailabilityRange (availability ranges are
maintained by ipam driver for pluggable case)
Henry Gessau [Sun, 21 Jun 2015 05:30:05 +0000 (01:30 -0400)]
Allow setting Agents description to None
Fix the validator for the 'description' attribute of Agents, allowing
it to be set to None.
Fix an API test that had two problems:
1. It was not restoring the description to the agent it had updated
2. It was retoring the description to '' instead of None.
Gal Sagie [Mon, 25 May 2015 12:20:05 +0000 (15:20 +0300)]
Decompose DVR CSNAT L3 Agent from Compute Node L3 Agent
Currently the same dvr router class is used both by the L3 Agent
in the compute nodes that is responsible for the virtual routers
namespace and the fip namespace and also used by the centralized
SNAT L3 Agent in the network node.
This is the first step to decompose the two into different
classes.
The above means that we have one class of DVR router which is used
for two jobs (the virtual router namespace wiring and the fips wiring
in the compute node in one hand and the centralized snat wiring in the other)
The end goal of this patch is to separate the two into different classes
which will also help maintaining it and also help projects that want
to use one but not the other (for example only use the centralized
SNAT behaviour with there own DVR implementation)
Oleg Bondarev [Thu, 11 Jun 2015 10:38:55 +0000 (13:38 +0300)]
Fix l3 agent to not create already deleted router
In case router is deleted during l3 agent resync,
the "deleted" event is processed with higher priority, then
resync event for the router may be processed which will recreate
already deleted router.
This happens due to timestamp not being properly updated for deleted
router in router processor.
The fix adds timestamp update for deleted router.
Functional test will be updated in a follow-up patch
Logging was improved to make debugging a bit easier.
Jakub Libosvar [Fri, 19 Jun 2015 13:52:35 +0000 (15:52 +0200)]
Disable keepalived process in keepalived func test
Previously, keepalived process itself was disabled that lead to
respawning of keepalived by KeepalivedManager. This patch disables
KeepalivedManager in cleanup thus no respawn happens.
Pavel Bondar [Wed, 17 Jun 2015 12:48:09 +0000 (15:48 +0300)]
Add request factory for pluggable IPAM
Pluggable IPAM implementation requires separation between requesting
address/subnet and it's actual allocation, which can happen on
third-party IPAM servers. Request factory stands for simplifying
building right request from input.
Added AddressRequestFactory and SubnetRequestFactory.
AddressRequestFactory creates instance of AnyAddressRequest or
SpecificAddressRequest depending on presence of ip address in input.
SubnetRequestFactory creates instance of AnySubnetRequest or
SpecificSubnetRequest depending on input.
get_subnet_request_factory and get_address_request_factory can be
redefined on driver level to use custom request factories.
In Nova flavors it is ok to specify a decimal RXTX factor.
For this reason when applying QoS to a port Neutron should not
convert this factor to an integer value, but simply ensure
it's a valid float number and positive.
Pavel Bondar [Thu, 18 Jun 2015 11:17:58 +0000 (14:17 +0300)]
Move _add_auto_addrs_on_network_ports
Moved to ipam_non_pluggable_backend.py since implementation
is specific for non pluggable ipam backend.
Pluggable implementation will additionally include rollback on failure actions.
This commit is a preparation step for using pluggable ipam.
More changes in this methods are expected to be done by following
patches.
Ironic expects neutron to have an "ipxe" tag for the option 175 which is
sent by iPXE/gPXE when booting a node. The problem is that up to now this
tag was not created by Neutron, causing the nodes deployed with Ironic
+ iPXE to fail to boot. This patch is creating this tag when launching
the dnsmasq process.
Pavel Bondar [Wed, 17 Jun 2015 15:47:11 +0000 (18:47 +0300)]
Remove _check_ip_in_allocation_pool
_check_ip_in_allocation_pool is not used anywhere in neutron.
Cleaning up unused code from db_base_plugin_v2.py.
Caller was removed over a year ago in change
Ib31550fa9000fc75768a327cb6cc1c419e06568f
Error when _read_hosts_file_leases tries to parse stateless IPv6 entry
in hosts file
TRACE neutron.agent.dhcp.agent ip = host[2].strip('[]')
TRACE neutron.agent.dhcp.agent IndexError: list index out of range
Neutron creates entries in dhcp host file for each subnet of a port.
Each of these entries will have same mac address as first field,
and may have client_id, fqdn, ipv4/ipv6 address for dhcp/dhcpv6 stateful,
or tag as other fields.
For dhcpv6 stateless subnet with extra_dhcp_opts,
host file will have only mac address and tag. So _read_hosts_file_leases
shouldn't check for ip address for this entry in host file.
shihanzhang [Fri, 30 Jan 2015 01:50:52 +0000 (09:50 +0800)]
Fix 'router_gateway' port status can't be updated
when it creates a ovs bridge without parameter 'bridge-id',
it's default 'bridge-id' is None, so ovs agent should also
deal with these ovs bridges, for example if ancillary bridge
br-ex does not be handled, the 'router_gateway' port status
can't be updated.
Doug Hellmann [Tue, 16 Jun 2015 19:49:15 +0000 (19:49 +0000)]
Update version for Liberty
Update the version for Liberty, switching from date-based versioning
to pre-versioning using SemVer. See
http://lists.openstack.org/pipermail/openstack-dev/2015-May/065211.html
and
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067082.html
for details.
Cyril Roelandt [Wed, 17 Jun 2015 14:25:56 +0000 (14:25 +0000)]
Python 3: do not use cmp(), nor sorted(..., cmp=...)
* The "cmp" function has been removed, so we must not use it any more;
* The "cmp" keyword argument of the "sorted" function has been removed, so
replace it with "key=functool.cmp_to_key".
Some database engines require exact match of sizes of foreign keys
and referenced fields. Foreign key ipsec_site_conn_id of table
cisco_csr_identifier_map is varchar(64) but it references field
id varchar(36) of table ipsec_site_connections. This gives error
while running migration scripts in such databases.
This fix only applies to new installations. Existing databases will
be corrected by migration scripts introduced in
https://review.openstack.org/190569 - they will take care of resizing
the field and adjusting the model.
Aaron Rosen [Wed, 17 Jun 2015 00:23:09 +0000 (17:23 -0700)]
ovsdb: session.rpc never initialized
Previously, if idl.Transaction.commit_block() returned a status of
TRY_AGAIN we would check self.api.idl._session.rpc.status which would
result in an attribute error as rpc is None.
This patch fixes this attribute error by removing this unneeded check. In
addtion, the force_reconnect() is also removed as ovs.jsonrpc handles
reconnecting automatically for us.
Rawlin Peters [Mon, 15 Jun 2015 16:57:02 +0000 (10:57 -0600)]
Remove duplicated debug logging around locking
Currently, iptables_manager.py does extra unnecessary logging about lock
acquisition and release. It uses lockutils.lock() which passes
do_log=True by default, which causes lockutils.lock() to do debug
logging about lock acquisition/release. IptablesManager itself also writes
debug log info about lock acquisition and release.
This change will eliminate unnecessary duplicate logging in order to
reduce log noise about locking. This change is also related to
https://github.com/harlowja/fasteners/commit/f88f2fea7fe250b7d26cdcbc84633ccbbc68eeee
which reduces the logging level in the underlying lock implementation
used by oslo.concurrency. That change along with this one will remove
the duplicate debug logging about locking in iptables_manager.py and also in
ipset_manager.py.
Aman Kumar [Tue, 16 Jun 2015 12:32:44 +0000 (05:32 -0700)]
Refactor scan_ports() and update_ancillary_ports() in OVS Neutron Agent
Used a helper method which contains the common code from scan_ports()
and update_ancillary_ports(). And also renamed the name of
update_ancillary_ports() method to scan_ancillary_ports() to have parity
between normal ports and ancillary ports.
Havana was deprecated with the kilo release, and icehouse will be
deprecated with the liberty release, so havana_inital migration should be
removed and replaced with juno_initial.
Ihar Hrachyshka [Tue, 16 Jun 2015 07:21:42 +0000 (09:21 +0200)]
docs: added job to well known tox envlist
This is to make 'tox -l' return the job name in its output (needed to
allow run-docs.sh script in project-config to determine whether the job
is present, to rely on it when generating docs in gate).
Pavel Bondar [Wed, 10 Jun 2015 13:18:40 +0000 (16:18 +0300)]
Refactor update_port in db_base_plugin_v2
This commit is a preparation step for using pluggable IPAM.
- moved validations into _validate_port_for_update;
- updating ip addresses for port is backend specific, so
moved into _update_port_with_ips in ipam_non_pluggable_backend;
- writing port changes to db is common for both backends, so
moved into _update_db_port in ipam_backend_mixin;
- updated to use namedtuple to track add/original/remove ips;
- added _make_fixed_ip_dict to exclude keys other than
ip_address and subnet_id;
Pavel Bondar [Wed, 10 Jun 2015 11:56:58 +0000 (14:56 +0300)]
Refactor _update_ips_for_port
This commit is a preparation step for using pluggable IPAM.
_update_ips_for_port was refactored and split into two methods:
- _get_changed_ips_for_port
This method contains calculations common for pluggable and
non-pluggable IPAM implementation, was moved to ipam_backend_mixin.
- _update_ips_for_port
This method is specific for non-pluggable IPAM implementation, so it
was moved to ipam_non_pluggable_backend_common.
Other changes:
- _update_ips_for_port now returns namedtuple with added, removed, original
ips (previously added and original ips were returned).
List of removed ips is required by pluggable IPAM implementaion
to apply rollback-on-failure logic;
- removed unused port_id argument from _update_ips_for_port argument list;