From 406b58a4e690d13323e276c0b4ac941332c7b51d Mon Sep 17 00:00:00 2001 From: Tomek Jaroszyk Date: Wed, 2 Feb 2022 12:59:26 +0100 Subject: [PATCH 1/2] [ceph] fix issue with upmap used for adding missing osd Related-Prod: PROD-36764 Change-Id: I1e6891b6800b7b9b6068101cb6f1924a6d0c1f8f --- src/com/mirantis/mk/Ceph.groovy | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/com/mirantis/mk/Ceph.groovy b/src/com/mirantis/mk/Ceph.groovy index 957b4385..7735394b 100644 --- a/src/com/mirantis/mk/Ceph.groovy +++ b/src/com/mirantis/mk/Ceph.groovy @@ -306,10 +306,15 @@ def generateMapping(pgmap,map) { for(pg in pgmap) { pg_new = pg["up"].minus(pg["acting"]) pg_old = pg["acting"].minus(pg["up"]) - for(int i = 0; i < pg_new.size(); i++) { - // def string = "ceph osd pg-upmap-items " + pg["pgid"].toString() + " " + pg_new[i] + " " + pg_old[i] + ";" - def string = "ceph osd pg-upmap-items ${pg["pgid"]} ${pg_new[i]} ${pg_old[i]}" - map.add(string) + if(pg_old.isEmpty()) { + // use standard rebalancing to just fill gaps with new osds + unsetFlags('norebalance') + } + else { + for(int i = 0; i < pg_new.size(); i++) { + def string = "ceph osd pg-upmap-items ${pg["pgid"]} ${pg_new[i]} ${pg_old[i]}" + map.add(string) + } } } } From 6fb7a50fa8666145a5897fd4861ea2e3c84bd267 Mon Sep 17 00:00:00 2001 From: Vladimir Khlyunev Date: Thu, 24 Feb 2022 14:14:44 +0400 Subject: [PATCH 2/2] Use local pip storage for offline deploy PROD-36734 Change-Id: I4cf702a709585174513b92c17b5f93567451d326 --- src/com/mirantis/mk/Python.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/mirantis/mk/Python.groovy b/src/com/mirantis/mk/Python.groovy index 29288f99..9839f4a0 100644 --- a/src/com/mirantis/mk/Python.groovy +++ b/src/com/mirantis/mk/Python.groovy @@ -53,7 +53,12 @@ def setupVirtualenv(path, python = 'python2', reqs=[], reqs_path=null, clean=fal writeFile file: "${path}/requirements.txt", text: args reqs_path = "${path}/requirements.txt" } - runVirtualenvCommand(path, "pip install -r ${reqs_path}", true) + + def install_cmd = 'pip install' + if (offlineDeployment) { + install_cmd += " --find-links=/opt/pip-mirror " + } + runVirtualenvCommand(path, "${install_cmd} -r ${reqs_path}", true) } /**