Akrog/cinderlib

Execution exception if don't configure persistence_config in IBM SVC

Closed this issue · 4 comments

I have executed some volume test(ceate, clone, snapthot etc).

I find if cinderlib don't use the database persistence plugins. It will cause a ssh running exception when it run the function firstly. The exception will disappear if run the same command again. Change the other methods, the same issue will show again.

If cinderlib set the database persistence plugin, the above qustion will not happen.

The below is my test eviroment and error messages.

Test enviroment:
Cinderlib version: v0.3.9
Cinder release: Pike
Storage: IBM SVC V7000
Versions: Unknown
Connection type: FC

Error messages:
vol = lvm.create_volume(size=1)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/cinderlib/cinderlib.py", line 156, in create_volume
vol.create()
File "/usr/lib/python2.7/site-packages/cinderlib/objects.py", line 446, in create
self._raise_with_resource()
File "/usr/lib/python2.7/site-packages/cinderlib/objects.py", line 222, in _raise_with_resource
six.reraise(*exc_info)
File "/usr/lib/python2.7/site-packages/cinderlib/objects.py", line 439, in create
model_update = self.backend.driver.create_volume(self._ovo)
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 2520, in create_volume
pool = utils.extract_host(volume['host'], 'pool')
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 742, in select_io_group
% {'iogrp': opts['iogrp'],
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 719, in get_vdisk_count_by_io_group
def get_vdisk_count_by_io_group(self):
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 224, in lsiogrp
def lsiogrp(self):
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 163, in run_ssh_info
def run_ssh_info(self, ssh_cmd, delim='!', with_header=False):
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py", line 159, in _run_ssh
'err': e.stderr})
cinder.exception.VolumeBackendAPIException: Bad or unexpected response from the storage volume backend API: CLI Exception output:
command: ['svcinfo', 'lsiogrp', '-delim', '!']
stdout:
stderr: Error running SSH command.

Akrog commented

I don't know why that is happening, it doesn't make much sense to me.

I have found that there are additional DB calls, but I don't think those are the problem. Just in case I have updated the patch, and you can get the latest content here: https://git.openstack.org/cgit/openstack/cinderlib/plain/cinderlib/persistence/base.py?h=refs/changes/12/648212/2

Is there a simulator for the IBM SVC I can use to reproduce the issue? Because I'm not sure I'll be able to find out the problem without debugging it.

Ok, I will try the patch at next monday.
Also, I just have a SVC enviroment and I don't know how to deploy the simulator for IBM SVC. If any help can't resolve the issue, please let me know.

Thanks
Ray

@Akrog

Hi Gorka,
I try your patch. I don't see the issue again. Maybe, you have fixed the issue. :)

Thanks
Ray

Akrog commented

@tanshaolong

I'm glad to hear the current patch fixes your issue.
I'll close the issue as it'll be fixed upstream as soon as the patch gets merged.