]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Allow disabling ssl compression for glance client
authorStuart McLaren <stuart.mclaren@hp.com>
Tue, 11 Jun 2013 13:55:20 +0000 (13:55 +0000)
committerStuart McLaren <stuart.mclaren@hp.com>
Tue, 11 Jun 2013 14:18:12 +0000 (14:18 +0000)
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

cinder/flags.py
cinder/image/glance.py
etc/cinder/cinder.conf.sample

index 35e4321335bf1b0620c72fc6760a76aa41cccfdc..f2db0ed4ca5a2c069afc567b15ac3fdc830f3fde 100644 (file)
@@ -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'),
index ca1dd0964886ba139a6dd6005aed975ca5cbf2b2..34c0fd2cc9f5255e4b9bbfe870e9087633a97c93 100644 (file)
@@ -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)
index 4e8b127d6d9e80f0d8d3c4f5cebb9fbbbca088ac..18d5b1e6c93b1a1d96d374a9917b96450a6ef5c9 100644 (file)
 # (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