diff options
| author | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-06-18 11:44:36 +0800 |
|---|---|---|
| committer | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-06-29 23:14:51 +0800 |
| commit | d4269334dd7e99ebd84783a2dc9abf8a55804675 (patch) | |
| tree | 63f45276bd3413129a219aed39eec41ce7287d21 | |
| parent | b7435eeb158e473e17a77190a52e11324a801a7b (diff) | |
| download | kolla-d4269334dd7e99ebd84783a2dc9abf8a55804675.tar.gz kolla-d4269334dd7e99ebd84783a2dc9abf8a55804675.zip | |
Use the disk size as the osd weight when osd_initial_weight is auto
In most of case, the disks used by ceph have different size. Use the
default value 1 may block the ceph when one disk is full. Use the disk
size as osd weight will more reasonally.
TrivialFix
Change-Id: Ib875c7289188cbb9380355baf0c8048f1eb09332
| -rw-r--r-- | docker/base/Dockerfile.j2 | 1 | ||||
| -rw-r--r-- | docker/ceph/ceph-osd/extend_start.sh | 4 | ||||
| -rw-r--r-- | releasenotes/notes/support-disk-size-as-weight-in-ceph-9d6353f1d3f03199.yaml | 11 |
3 files changed, 16 insertions, 0 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 62a1df652..f3ac32bc6 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -200,6 +200,7 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences {% set base_apt_packages = [ 'ca-certificates', 'curl', + 'gawk', 'lvm2', 'open-iscsi', 'python', diff --git a/docker/ceph/ceph-osd/extend_start.sh b/docker/ceph/ceph-osd/extend_start.sh index 733e45ff9..ee745d0af 100644 --- a/docker/ceph/ceph-osd/extend_start.sh +++ b/docker/ceph/ceph-osd/extend_start.sh @@ -50,6 +50,10 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then CEPH_ROOT_NAME=cache fi + if [[ "${OSD_INITIAL_WEIGHT}" == "auto" ]]; then + OSD_INITIAL_WEIGHT=$(parted --script ${OSD_PARTITION} unit TB print | awk 'match($0, /^Disk.* (.*)TB/, a){printf("%.2f", a[1])}') + fi + # These commands only need to be run once per host but are safe to run # repeatedly. This can be improved later or if any problems arise. ceph osd crush add-bucket "${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" host diff --git a/releasenotes/notes/support-disk-size-as-weight-in-ceph-9d6353f1d3f03199.yaml b/releasenotes/notes/support-disk-size-as-weight-in-ceph-9d6353f1d3f03199.yaml new file mode 100644 index 000000000..5aff9c7ae --- /dev/null +++ b/releasenotes/notes/support-disk-size-as-weight-in-ceph-9d6353f1d3f03199.yaml @@ -0,0 +1,11 @@ +--- +prelude: > + In most of case, the disks used by ceph have different size. Use the default + value 1 may block the ceph when one disk is full. Use the disk size as osd + weight will more reasonally. +features: + - support using the disk size as the osd weight when osd_initial_weight is + auto +upgrade: + - the os_initial_weight still has the default value 1, it will not break + cluster when upgrading. |
