Connection info retrieved on each call to get_volume_connector

Bug #1406484 reported by Avishay Traeger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Avishay Traeger

Bug Description

On a system with no Fibre Channel (FC) HBAs, each call to get_volume_connector() in virt/libvirt/driver.py will result in retrieving the FC HBA info. This is because the code looks like this:

self._fc_wwnns = None
self._fc_wwpns = None
...
if not self._fc_wwnns:
    self._fc_wwnns = libvirt_utils.get_fc_wwnns()
...
if not self._fc_wwpns:
    self._fc_wwpns = libvirt_utils.get_fc_wwpns()

In a system with no HBAs, the two utils functions return empty lists. Therefore we will go into these ifs on every call. The if statements should be re-written as "if self.foo is not None".

I have seen busy systems where these two calls add 800ms to each attach call!

Similarly, if there is no iSCSI initiator name defined, the get_iscsi_initiator() function is called each time.

summary: - Fibre channel info retrieved on each call to get_volume_connector
+ Connection info retrieved on each call to get_volume_connector
Changed in nova:
assignee: nobody → Avishay Traeger (avishay-il)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/144508

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/144508
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=342e3e1ee9d9ded5a1d225bacef82cbe6cfc9937
Submitter: Jenkins
Branch: master

commit 342e3e1ee9d9ded5a1d225bacef82cbe6cfc9937
Author: Avishay Traeger <email address hidden>
Date: Tue Dec 30 20:43:23 2014 +0100

    Cache empty results in libvirt get_volume_connector

    The libvirt driver's get_volume_connector is called on each
    connection. The iSCSI initiator name and FC HBA information is
    obtained and saved in instance variables on the first call, and
    these values are used in subsequent calls. However, if no
    information is returned from any of these calls, this is not
    saved, and the driver will try to get the information again in
    every subsequent call. For a driver running on a system with no
    iSCSI initiator configured, this means trying and failing to
    read a file each time. For a system with no FC HBA, this
    results in two calls to systool for each connect.

    This patch distinguishes between the case of the first call
    and subsequent calls where the connection information was not
    found. This speeds up connection times for systems that don't
    have both iSCSI and FC configured. Note a behavioral change
    that if iSCSI is not configured, or if the FC HBA is not present,
    at the first connection, the service will have to be restarted
    for the connection information to be used. I believe this is
    a very uncommon scenario.

    Closes-Bug: #1406484
    Change-Id: I233e4559baa0818353897e04c84501858a59febb

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-3 → 2015.1.0
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.