heal_and_optimize flow retrieves a list of vifs
using a method in util module. For SR-IOV agent,
_find_vifs methid is invoked, it is common to CNA
and VNIC objects. The vswitch_id is retrieved and
validated, since vswitch_id is not present in VNIC
object, getattr call fails. Since this method is
common to both CNA and VNIC, a default return value
of None should be included in the list of parameters.
networking_powervm/plugins/ibm/agent/powervm/util.py
_find_vifs method :
Instead of getattr(vif, 'vswitch_id')
getattr(vif, 'vswitch_id', None) should be used.
Change-Id: Ifcbf0a9b9d5eb9a326c93cac675b19a2fefca75c
Closes-Bug: #1691584
The current implementation of list_vifs will return a VIF even if the
VIF is not intended for an SEA. This change filters VIFs that aren't
in use by SEAs on either the RMC management switch or an Open vSwitch
and removes them from the list_vifs return.
Change-Id: I0611a2a647034f239b532cebe709566c005363f7
Closes-Bug: #1683381
(cherry picked from commit c32da1a58b)
This change set represents a major refactor of the neutron SEA and
SR-IOV agents.
- Proper abstract properties/methods allow much code to be consolidated
into the BasePVMNeutronAgent from the individual subclasses.
- Conversely, CNA-specific code, such as helpers for the
sea_agent-specific heal_and_optimize loop, is moved to the sea_agent
module.
- PVMRpcCallbacks methods are folded into the agent base class itself.
The agent is now the thing that's registered for those callbacks.
- The network_delete callback is gone (it wasn't being used).
- The port_update callback is a no-op by default. In the SR-IOV agent,
it's refreshing the physical port label:physloc mappings back to
neutron.
- The vnic_required_vfs and vnic_vf_capacity conf options are moved to
sriov_agent.
- There is no longer a short timer in the rpc_loop; everything is
event-driven. Thus, the polling_interval conf option is removed.
- The rpc_loop is common to both agents. It only runs
heal_and_optimize, on the configurable interval (default 30min).
- ProvisionRequest is moved into its own module, prov_req.py. It is now
a factory class capable of producing ProvisionRequest instances for:
- Custom VIF Events from the nova-powervm VIF driver;
- pypowervm Wrappers of VIF types (CNA, VNIC);
- The VIFEventHandler (formerly CNAEventHandler) is now driven by VIF
events produced by the nova-powervm VIF driver. This entails a
significant processing/performance/load improvement over the previous
code, which acted on all LPAR events.
- Utility methods (utils.py) are renamed and genericized to handle all
VIF types (CNA, VNIC) rather than just CNAs.
- Obsolete utility methods and their unit tests are removed.
- Unit tests overhauled and extended.
Closes-Bug: #1632400
Change-Id: Ie8a13da0b0cdc29d350ed91d96ff2384430c2676
The related_href was used to parse out the bridge_mappings table.
Unfortunately, *how* you queried for the data identified what the URI
would be. An earlier change to remove some host_uuid's ended up
malforming the URI and breaking the bridge_mapping logic.
This change fixes how we look at the URIs to see if a SEA is on a given
VIOS. This should be more reliable moving forward.
Change-Id: I98f76a44db0f61d3e8ed4d3204c1e086bfe00fab
Closes-Bug: #1612047
This change set reduces the number of host_uuids being passed around in
networking-powervm. It also switches many of the calls from the very
verbose adapter.read() format to the wrapper get method.
Change-Id: If6f56d14f4161ea238d490ea44ecd74e4f468e8f
Closes-Bug: #1607338
The VIOS type element can be running true Client Network Adapters (VEAs
without additional trunk adapters) on it. The heal and optimize code
should take these adapters into account.
This change set updates some of the utility methods to account for VIOS
types. It also updates the heal and optimize code to take these VEAs
into account for the whole system (LPARs and VIOSes).
Change-Id: If21246b1d9c140a9b97201ced95f578a86b5c62d
This change allows for the utils list_lpar_uuids to take in a new
parameter that can exclude the mgmt UUID. This is an important change
because we may wish to explicitly exclude it to avoid erronerous logging
messages. This differs from pypowervm's base implementation where it
explicitly includes it (if that explicit include is not set to True, it
does not explicitly exclude it).
Reworks to use the pypowervm get_partitions method where able.
Closes-Bug #1602598
Change-Id: Ic47b4f20c04a7f98517a77cdb31d044a1f8f63e8
1) We were not importing '_' in exceptions.py, so we were using the
default symbol from builtins, which isn't the right thing for
translation. Import from this project's i18n module instead (and use
_LE, for they are exceptions). It would also seem as though it is now a
requirement to import _ from a module at <project>._i18n; so the
networking_powervm.plugins.ibm.agent.powervm.i18n module has been moved
there.
2) The VIOS.xags property is deprecated. Rebase to use
pypowervm.const.XAG instead.
Change-Id: Ief47001b5525dda88c9c72c16b92505c3f974950
The list_cnas() method is logging via the pypowervm log_helper
each time a VM is not found. This can generate a lot of
unnecessary logging. This change removes the logger for
this method only as it's just listing the CNAs for the VM.
Change-Id: Id2f5c114838da293ec2ed3ae38a65c72633f57f6
Since the translated messages will be in a message catalog
name networking-powervm, all the translation functions must
point to that domain. This change introduces the i18n.py module
to setup translation.
Change-Id: If16d45677071088a95600371daf2066ae21b92b7
If the REST API has a significant number of conflicting requests come
in, there are times when it can cause a conflict. These get
encapsulated into errors. The retry operator allows us to catch a set
of known errors and retry them automatically (ex. etag conflicts).
The retry 'domain' indicates how much of an operation would be retried.
Usually you want to keep this as small as possible. Retry as few
commands as needed to the API.
The networking-powervm code has a rather large retry domain in the
list_cnas code, and didn't have any retry in the list_lpar_uuids. This
change set optimizes the retry domains to be small (one API call instead
of many).
The existing test cases cover the refactoring.
Change-Id: I5b758e03dd15f84e65e3df9f88ad1d6d156ddd34