Comment 2 for bug 1460801

Revision history for this message
Nate Potter (ntpttr) wrote :

Hi John,

I was just starting to look at this, and my initial idea for removing the limit was to remove self.max_volumes_per_accounts and the _get_account_create_availability method, since it looks like its purpose is to make sure the account doesn't go over the 2K limit. Then I wasn't sure if the primary and backup accounts would be necessary as the 2K limit would no longer be imposed on the primary account, so in the '_get_sfaccounts_for_tenant' method I changed it to return one account rather than the list of matching accounts. Because of this, whenever this code for finding the sf_account shows up:

sf_accounts = self._get_sfaccounts_for_tenant(volume['project_id'])
if not sf_accounts:
    sf_account = self._create_sfaccount(volume['project_id'])
else:
    sf_account = self._get_account_create_availability(sf_accounts)

I removed the else block, and just assigned 'sf_account = self._get_sfaccount_for_tenant(volume['project_id'])' rather than creating the 'sf_accounts' variable at the top, so that it gets the account if it exists and creates it if it doesn't, making it so that there's only ever one sf_account and the 2K limit is not imposed on it.

So that was pretty long winded, but it was pretty much my thought process at first glance of the problem. This is my first time looking at the SolidFire driver, so please tell me if some of those changes wouldn't work or wouldn't fit in to the architecture!