   (str
    "aws --region " (or region my-region)
    " sns publish --topic-arn " (or topic my-sns-topic)
-   " --message `(echo \"id: " id "\";bin/ec2-metadata -i -p -o) | base64 -w 0`"))
+   " --message `(echo \"id: " id "\";bin/ec2-metadata -i -p -o) | base64 -w 0`"
+   "\n"))
 
 ;(stop-instances :instance-ids ["i-7c949193"])
 ;(modify-instance-attribute :instance-id "i-7c949193" :user-data (s->b64 "echo hello"))
 
+(defn good-strings [vs]
+  (and (sequential?  vs)
+       (every? string? vs)
+       (every? pos? (map count vs))))
+
+
+
+(defn- really-up? [rs->info rs]
+  (let [info (get rs->info rs)]
+    (and
+     (= (:state info) "running")
+     (string? (:ip info))
+     (pos? (count (:ip info))))))
 
 (defn bring-up-spots  [reqmap nmin cmds & opts]
-  (let [cmd (str (send-up) "\n "(clojure.string/join "\n" cmds))
+  (let [id  (.toString (UUID/randomUUID))
+        cmd (str (send-up id) (clojure.string/join "\n" cmds) "\n")
         req (apply ph-assoc reqmap paths opts)
         req (ph-assoc req paths :udata cmd)
-        ;req (assoc req :nmin nmin)
         n   (ph-get reqmap paths :n)
         req (if (<= nmin n) req (ph-assoc req paths :n nmin))
-        id  (.toString (UUID/randomUUID))
         _   (debug "Requesting:" id req)
         cl  (notify-chan id)
         rs  (request-spots req)

                      (cancel-requests rs)
                      nil)
           (= c cl) (recur (inc i))))))))


(def ag (ssh/ssh-agent {}))

          (>! c req) (close! c)))
    c))



