From f941d3f5de74c9a7fff997e4b6c42370140ca545 Mon Sep 17 00:00:00 2001 From: Dheeraj Gautam Date: Thu, 9 Mar 2017 22:16:18 -0800 Subject: [PATCH] Sm-storage: change replica size, and call hdparm Change-Id: I7cc1485a3adda7d7eccfea5d4c6338cd8d82ec41 Closes-Bug:#1671701 --- .../contrail/manifests/lib/storage_common.pp | 15 ++++++++------- .../contrail/manifests/lib/storage_disk.pp | 5 +++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp index bd04cf90..8a8a212f 100644 --- a/contrail/environment/modules/contrail/manifests/lib/storage_common.pp +++ b/contrail/environment/modules/contrail/manifests/lib/storage_common.pp @@ -166,6 +166,13 @@ inject => $inject_keys, } + if $contrail_num_storage_hosts > 1 { + $contrail_storage_replica_size = 3 + } else { + $contrail_storage_replica_size = 1 + } + + if 'storage-compute' in $contrail_host_roles { if $contrail_storage_osd_disks != '' { contrail::lib::storage_disk { $contrail_storage_osd_disks:} @@ -175,7 +182,7 @@ $contrail_pool_map = join($pool_data, "', '") $host_num_disk = size($contrail_storage_osd_disks) - ceph::pool {'internal': size => 1 } -> + ceph::pool {'internal': size => $contrail_storage_replica_size } -> file { 'compute_pool_config' : path => '/opt/contrail/bin/compute_pool_config.py', content => template("${module_name}/compute-pool-config.erb"), @@ -294,12 +301,6 @@ Exec['setup_storage_chassis_config']-> Exec['setup-config-storage-openstack'] } - if $contrail_num_storage_hosts > 1 { - $contrail_storage_replica_size = 2 - } else { - $contrail_storage_replica_size = 1 - } - $contrail_ceph_pg_num = 32 * $contrail_storage_num_osd ## if no disks on this host, don't run pools related stuf ceph::pool{['data', 'metadata', 'rbd']: diff --git a/contrail/environment/modules/contrail/manifests/lib/storage_disk.pp b/contrail/environment/modules/contrail/manifests/lib/storage_disk.pp index 690f5471..2ee90690 100644 --- a/contrail/environment/modules/contrail/manifests/lib/storage_disk.pp +++ b/contrail/environment/modules/contrail/manifests/lib/storage_disk.pp @@ -48,6 +48,11 @@ -> ceph::osd { $ready_disk_name: require => Contrail::Lib::Prepare_disk[$ready_disk_name] + } -> + exec {"hdparm_$ready_disk_name": + command => "/sbin/hdparm -z ${disk_details[0]} || true", + provider => shell, + logoutput => true, } } #contrail::lib::storage_disk {'/dev/sda':}