diff --git a/ceilometer/tests/tempest/service/client.py b/ceilometer/tests/tempest/service/client.py
index 332b450..59c585e 100644
--- a/ceilometer/tests/tempest/service/client.py
+++ b/ceilometer/tests/tempest/service/client.py
@@ -16,16 +16,9 @@
 from oslo_serialization import jsonutils as json
 from six.moves.urllib import parse as urllib
 
+from tempest import clients
 from tempest import config
 from tempest.lib.common import rest_client
-from tempest.lib.services.compute import flavors_client as flavor_cli
-from tempest.lib.services.compute import floating_ips_client as floatingip_cli
-from tempest.lib.services.compute import networks_client as network_cli
-from tempest.lib.services.compute import servers_client as server_cli
-from tempest.lib.services.image.v2 import images_client as img_cli_v2
-from tempest import manager
-from tempest.services.object_storage import container_client as container_cli
-from tempest.services.object_storage import object_client as obj_cli
 
 
 CONF = config.CONF
@@ -89,43 +82,9 @@
         return rest_client.ResponseBody(resp, body)
 
 
-class Manager(manager.Manager):
+class Manager(clients.Manager):
 
-    load_clients = [
-        'servers_client',
-        'compute_networks_client',
-        'compute_floating_ips_client',
-        'flavors_client',
-        'image_client_v2',
-        'telemetry_client',
-        'container_client',
-        'object_client',
-    ]
-
-    default_params = {
-        'disable_ssl_certificate_validation':
-            CONF.identity.disable_ssl_certificate_validation,
-        'ca_certs': CONF.identity.ca_certificates_file,
-        'trace_requests': CONF.debug.trace_requests
-    }
-
-    compute_params = {
-        'service': CONF.compute.catalog_type,
-        'region': CONF.compute.region or CONF.identity.region,
-        'endpoint_type': CONF.compute.endpoint_type,
-        'build_interval': CONF.compute.build_interval,
-        'build_timeout': CONF.compute.build_timeout,
-    }
-    compute_params.update(default_params)
-
-    image_params = {
-        'service': CONF.image.catalog_type,
-        'region': CONF.image.region or CONF.identity.region,
-        'endpoint_type': CONF.image.endpoint_type,
-        'build_interval': CONF.image.build_interval,
-        'build_timeout': CONF.image.build_timeout,
-    }
-    image_params.update(default_params)
+    default_params = config.service_client_config()
 
     telemetry_params = {
         'service': CONF.telemetry.catalog_type,
@@ -134,53 +93,18 @@
     }
     telemetry_params.update(default_params)
 
-    object_storage_params = {
-        'service': CONF.object_storage.catalog_type,
-        'region': CONF.object_storage.region or CONF.identity.region,
-        'endpoint_type': CONF.object_storage.endpoint_type
-    }
-    object_storage_params.update(default_params)
-
-    def __init__(self, credentials=None, service=None):
-        super(Manager, self).__init__(credentials)
-        for client in self.load_clients:
-            getattr(self, 'set_%s' % client)()
-
-    def set_servers_client(self):
-        self.servers_client = server_cli.ServersClient(
-            self.auth_provider,
-            **self.compute_params)
-
-    def set_compute_networks_client(self):
-        self.compute_networks_client = network_cli.NetworksClient(
-            self.auth_provider,
-            **self.compute_params)
-
-    def set_compute_floating_ips_client(self):
-        self.compute_floating_ips_client = floatingip_cli.FloatingIPsClient(
-            self.auth_provider,
-            **self.compute_params)
-
-    def set_flavors_client(self):
-        self.flavors_client = flavor_cli.FlavorsClient(
-            self.auth_provider,
-            **self.compute_params)
-
-    def set_image_client_v2(self):
-        self.image_client_v2 = img_cli_v2.ImagesClient(
-            self.auth_provider,
-            **self.image_params)
+    def __init__(self, credentials):
+        # TODO(andreaf) Overriding Manager is a workaround. The "proper" way
+        # would it to expose the ceilometer service client via the plugin
+        # interface, use tempest.lib.clients and tempest master.
+        # Then ceilometer service client would be loaded and configured
+        # automatically into ServiceClients.
+        # In any case we're about to declare clients.Manager a stable
+        # interface for plugins and we won't change it, so this code won't
+        # break.
+        super(Manager, self).__init__(credentials=credentials)
+        self.set_telemetry_client()
 
     def set_telemetry_client(self):
         self.telemetry_client = TelemetryClient(self.auth_provider,
                                                 **self.telemetry_params)
-
-    def set_container_client(self):
-        self.container_client = container_cli.ContainerClient(
-            self.auth_provider,
-            **self.object_storage_params)
-
-    def set_object_client(self):
-        self.object_client = obj_cli.ObjectClient(
-            self.auth_provider,
-            **self.object_storage_params)
