iXsystems / cinder

Other
35 stars 18 forks source link

driver wants to use http, not https and cannot handle 307s #16

Open yellowpattern opened 4 years ago

yellowpattern commented 4 years ago

On newer FreeNAS systems, port 80 is but this:

    server {
        listen 10.1.1.1:80;
        listen [::]:80;
        server_name localhost;
        return 307 https://$host:443$request_uri;
    }

However this plugin wants to use port 80 and can't handle the 307:

...
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 985, in _create_raw_volume
ERROR oslo_messaging.rpc.server     ret = self.driver.create_volume(volume)
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ixsystems/iscsi.py", line 93, in create_volume
ERROR oslo_messaging.rpc.server     self.common._create_volume(freenas_volume['name'], freenas_volume['size'])
ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/ixsystems/common.py", line 89, in _create_volume
ERROR oslo_messaging.rpc.server     raise FreeNASApiError('Unexpected error', msg)
ERROR oslo_messaging.rpc.server FreeNASApiError: FREENAS api failed. Reason - Unexpected error:Error while creating volume: 307:Temporary Redirect
ERROR oslo_messaging.rpc.server
yellowpattern commented 4 years ago

Might be worth changing the default for ixsystems_transport_type:

ixsystems_transport_type = https

hbonath commented 4 years ago

Which git revision are you working with here? I noticed that your error referenced python2.7. The "1.0" tag is the last version that supported Python2. The current master branch as of 8a09f57cc876bbb90b7476f654d6a08d32e42862 focuses on Python3 for the Openstack Train release and beyond.

yellowpattern commented 4 years ago

Not using Train so went with 1.0.

yellowpattern commented 4 years ago

Maybe there should be a 1.1 release, at least with pullup #5

YiHuangDB commented 1 year ago

With PR #29 merged to master branch now you can add ixsystems_transport_type = https or http to choose which transportation protocol to use in /etc/cinder/cinder.conf config file. When your Openstack version is above Train (which drop python2 support and require python3), this issue no longer exists on master branch code.