From: Stuart McLaren Date: Tue, 11 Jun 2013 13:55:20 +0000 (+0000) Subject: Allow disabling ssl compression for glance client X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c927949616be6e961b2750a3dbe1935f875455fd;p=openstack-build%2Fcinder-build.git Allow disabling ssl compression for glance client Add a new parameter 'glance_api_ssl_compression' which allows disabling ssl layer compression negotiation for glance requests. This may improve data throughput, eg when high network bandwidth is available and you are using already compressed image formats such as qcow2 . Addresses bug 1189903. Change-Id: I180501cc25a1ea177d0d8c52a879682b8a3921c6 --- diff --git a/cinder/flags.py b/cinder/flags.py index 35e432133..f2db0ed4c 100644 --- a/cinder/flags.py +++ b/cinder/flags.py @@ -121,7 +121,15 @@ global_opts = [ cfg.BoolOpt('glance_api_insecure', default=False, help='Allow to perform insecure SSL (https) requests to ' - 'glance'), + 'glance'), + cfg.BoolOpt('glance_api_ssl_compression', + default=False, + help='Whether to attempt to negotiate SSL layer compression ' + 'when using SSL (https) requests. Set to False to ' + 'disable SSL layer compression. In some cases disabling ' + 'this may improve data throughput, eg when high network ' + 'bandwidth is available and you are using already ' + 'compressed image formats such as qcow2 .'), cfg.StrOpt('scheduler_topic', default='cinder-scheduler', help='the topic scheduler nodes listen on'), diff --git a/cinder/image/glance.py b/cinder/image/glance.py index ca1dd0964..34c0fd2cc 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -60,12 +60,14 @@ def _create_glance_client(context, netloc, use_ssl, """Instantiate a new glanceclient.Client object.""" if version is None: version = FLAGS.glance_api_version + params = {} if use_ssl: scheme = 'https' + # https specific params + params['insecure'] = FLAGS.glance_api_insecure + params['ssl_compression'] = FLAGS.glance_api_ssl_compression else: scheme = 'http' - params = {} - params['insecure'] = FLAGS.glance_api_insecure if FLAGS.auth_strategy == 'keystone': params['token'] = context.auth_token endpoint = '%s://%s' % (scheme, netloc) diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index 4e8b127d6..18d5b1e6c 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -67,6 +67,14 @@ # (boolean value) #glance_api_insecure=false +# Whether to attempt to negotiate SSL layer compression +# when using SSL (https) requests. Set to False to +# disable SSL layer compression. In some cases disabling +# this may improve data throughput, eg when high network +# bandwidth is available and you are using already compressed +# image formats such as qcow2 . +#glance_api_ssl_compression=false + # the topic scheduler nodes listen on (string value) #scheduler_topic=cinder-scheduler