# File lib/openshift-origin-msg-broker-mcollective/lib/openshift/mcollective_application_container_proxy.rb, line 704
      def move_gear_pre(app, gear, state_map, keep_uid)
        reply = ResultIO.new
        source_container = gear.container
        gi = app.group_instance_map[gear.group_instance_name]
        app.start_order.reverse.each { |ci_name|
          next if not gi.component_instances.include? ci_name
          cinst = app.comp_instance_map[ci_name]
          cart = cinst.parent_cart_name
          next if cart==app.name
          idle, leave_stopped = state_map[ci_name]
          # stop the cartridge if it needs to
          unless leave_stopped
            log_debug "DEBUG: Stopping existing app cartridge '#{cart}' before moving"
            do_with_retry('stop') do
              reply.append source_container.stop(app, gear, cart)
            end
            if framework_carts.include? cart
              log_debug "DEBUG: Force stopping existing app cartridge '#{cart}' before moving"
              do_with_retry('force-stop') do
                reply.append source_container.force_stop(app, gear, cart)
              end
            end
          end
          # execute pre_move
          if embedded_carts.include? cart and not keep_uid
            if (app.scalable and not cart.include? app.proxy_cartridge) or not app.scalable
              log_debug "DEBUG: Performing cartridge level pre-move for embedded #{cart} for '#{app.name}' on #{source_container.id}"
              reply.append source_container.send(:run_cartridge_command, "embedded/" + cart, app, gear, "pre-move", nil, false)
            end
          end
        }
        reply
      end