             (deliver completion-promise :deleted)
             (-> id->service
                 (update-in [service-id :service :instances] dec)
-                (assoc-in [service-id :id->instance instance-id :killed?] true)
-                (assoc-in [service-id :id->instance instance-id :shell-scheduler/process] nil)))
+                (update-in [service-id :id->instance instance-id] assoc
+                           :killed? true
+                           :message message
+                           :shell-scheduler/process nil)))
           (do
             (log/info "instance" instance-id "does not exist")
             (deliver completion-promise :no-such-instance-exists)


  (kill-instance [this {:keys [id service-id] :as instance}]
    (if (scheduler/service-exists? this service-id)
      (let [completion-promise (promise)]
        (send id->service-agent kill-instance service-id id
              port->reservation-atom port-grace-period-ms
              completion-promise)
        (let [result (deref completion-promise)


(defn- kill-instance
  "Deletes the instance corresponding to service-id/instance-id and returns the updated id->service map"
  [id->service service-id instance-id message port->reservation-atom port-grace-period-ms completion-promise]
  (try
    (if (contains? id->service service-id)
      (let [{:keys [id->instance]} (get id->service service-id)
