Browse Source

Update ceph usage with correct osd_pool_size

Change-Id: I408c7a46c1aa13179341ed686ad8e47766e6b8c1
Victor Ryzhenkin 2 years ago
parent
commit
cde50fe4be

+ 51
- 1
murano_plugin_tests/helpers/helpers.py View File

@@ -115,7 +115,9 @@ class PluginHelper(object):
115 115
                 'volumes_lvm': False,
116 116
                 'volumes_ceph': True,
117 117
                 'images_ceph': True,
118
-                'objects_ceph': True
118
+                'objects_ceph': True,
119
+                'ephemeral_ceph': True,
120
+                'osd_pool_size': "1"
119 121
         }
120 122
 
121 123
     def prepare_plugin(self, plugin_path):
@@ -346,6 +348,54 @@ class PluginHelper(object):
346 348
         helpers.wait(lambda: not self.fuel_web.get_nailgun_node_by_devops_node(
347 349
             node)['online'], timeout=60 * 5, timeout_msg=msg)
348 350
 
351
+    def update_cluster_settings(self, opts):
352
+        attrs = self.fuel_web.client.get_cluster_attributes(self.cluster_id)
353
+
354
+        for option in opts:
355
+            section = ''
356
+            if option in ('sahara', 'murano', 'ceilometer', 'mongo',
357
+                          'ironic'):
358
+                section = 'additional_components'
359
+            elif option in {'mongo_db_name', 'mongo_replset', 'mongo_user',
360
+                            'hosts_ip', 'mongo_password'}:
361
+                section = 'external_mongo'
362
+            elif option in {'volumes_ceph', 'images_ceph',
363
+                            'ephemeral_ceph', 'objects_ceph',
364
+                            'osd_pool_size', 'volumes_lvm',
365
+                            'volumes_block_device', 'images_vcenter'}:
366
+                section = 'storage'
367
+            elif option in {'tenant', 'password', 'user'}:
368
+                section = 'access'
369
+            elif option == 'assign_to_all_nodes':
370
+                section = 'public_network_assignment'
371
+            elif option in {'neutron_l3_ha', 'neutron_dvr',
372
+                            'neutron_l2_pop'}:
373
+                section = 'neutron_advanced_configuration'
374
+            elif option in {'dns_list'}:
375
+                section = 'external_dns'
376
+            elif option in {'ntp_list'}:
377
+                section = 'external_ntp'
378
+            elif option in {'propagate_task_deploy'}:
379
+                section = 'common'
380
+            if section:
381
+                try:
382
+                    attrs['editable'][section][option]['value'] = \
383
+                        opts[option]
384
+                except KeyError:
385
+                    if section not in attrs['editable']:
386
+                        raise KeyError(
387
+                            "Section '{0}' not in "
388
+                            "attributes['editable']: {1}".format(
389
+                                section, attrs['editable'].keys()))
390
+                    raise KeyError(
391
+                        "Option {0} not in attributes['editable'][{1}]: "
392
+                        "{2}".format(
393
+                            option, section,
394
+                            attrs['editable'][section].keys()))
395
+
396
+        return self.fuel_web.client.update_cluster_attributes(
397
+            self.cluster_id, attrs)
398
+
349 399
     def emulate_whole_network_disaster(self, delay_before_recover=5 * 60,
350 400
                                        wait_become_online=True):
351 401
         """Simulate a full network outage for all nodes.

+ 6
- 0
murano_plugin_tests/murano_plugin/api.py View File

@@ -92,6 +92,12 @@ class MuranoPluginApi(object):
92 92
             'slave-09': self.settings.role_name,
93 93
         }
94 94
 
95
+    def set_replication_factor(self, replicas='1'):
96
+        opts = {
97
+            'osd_pool_size': replicas
98
+        }
99
+        return self.helpers.update_cluster_settings(opts)
100
+
95 101
     def prepare_plugin(self):
96 102
         """Upload and install the plugin on the Fuel master node."""
97 103
         self.helpers.prepare_plugin(self.settings.plugin_path)

+ 10
- 1
murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py View File

@@ -191,7 +191,16 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
191 191
 
192 192
         self.prepare_plugin()
193 193
 
194
-        self.helpers.create_cluster(name=self.__class__.__name__)
194
+        opts = {
195
+                'volumes_lvm': False,
196
+                'volumes_ceph': True,
197
+                'images_ceph': True,
198
+                'objects_ceph': True,
199
+                'osd_pool_size': "3"
200
+        }
201
+
202
+        self.helpers.create_cluster(name=self.__class__.__name__,
203
+                                    opts=opts)
195 204
 
196 205
         self.activate_plugin()
197 206
 

+ 9
- 3
murano_plugin_tests/murano_plugin/test_system.py View File

@@ -62,10 +62,13 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
62 62
 
63 63
         self.run_ostf(['sanity', 'smoke', 'ha'])
64 64
 
65
-        compute_manipulated_node = {'slave-04': ['compute', 'cinder']}
65
+        compute_manipulated_node = {'slave-04': ['compute', 'ceph-osd']}
66 66
 
67 67
         # Remove compute
68
-        self.helpers.remove_nodes_from_cluster(compute_manipulated_node)
68
+        self.helpers.remove_nodes_from_cluster(compute_manipulated_node,
69
+                                               redeploy=False)
70
+        self.set_replication_factor(replicas="2")
71
+        self.helpers.apply_changes()
69 72
 
70 73
         self.check_plugin_online()
71 74
 
@@ -82,7 +85,10 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
82 85
         self.run_ostf(['sanity', 'smoke', 'ha'])
83 86
 
84 87
         # Add compute
85
-        self.helpers.add_nodes_to_cluster(compute_manipulated_node)
88
+        self.helpers.add_nodes_to_cluster(compute_manipulated_node,
89
+                                          redeploy=False)
90
+        self.set_replication_factor(replicas="3")
91
+        self.helpers.apply_changes()
86 92
 
87 93
         self.check_plugin_online()
88 94
 

Loading…
Cancel
Save