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) + } } } } 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) } /**