diff --git a/balance-containers/run.bash b/balance-containers/run.bash index 03d0d5e..a547d78 100755 --- a/balance-containers/run.bash +++ b/balance-containers/run.bash @@ -24,9 +24,16 @@ show_usage() { } move_ct() { - echo -n " move: " - lxc move --target $target $ct 2> /dev/null - [[ $? -eq 0 ]] && echo "success" || echo "failed" + # SI la machine est redondée (nom finissant par un charactère) + if [[ "$(lxc list --columns Ln --format csv $ct | awk '/[0-9][a-z]$/')" == "${ct}" ]]; then + echo " move: skipped" + else + echo " move: pending" + lxc move --target $target $ct 2> /dev/null + lxc_move_result=$? + echo -n " move: " + [[ $? -eq 0 ]] && echo "success" || echo "failed" + fi } migrate_ct() {