Automated cluster ops across four nodes

HMLG

I run four DGX Sparks locally on a 200G switch, and I automated the ops: one script drains the cluster, regroups the switch ports and moves the four Sparks between four modes. DeepSeek-V4.1-Flash-1017 on all four, GLM on all four, or GLM on three or two with image and video jobs on the rest. It said "done" when nothing was running. Five states it never checked. 1. "Done." The 4-node model never started. My 3-node and 4-node GLM setups shared one container name. Switching from 3 to 4, the script saw that name running and called the new mode ready. It stopped the 3-node and never started the 4-node. Fix: one container name per setup, plus a test that fails on duplicates. "Done" now means the new mode answered a request. 2. Ten minutes on "verifying". The new 3-node setup was missing its internal key file. Verify couldn't read it and kept retrying quietly until its 600 s timeout, and by then the old mode had already been stopped. Fix: check every target's keys before touching anything. One missing, nothing moves. 3. My check found itself. Deploying my gateway took it down for 4 min 16 s. The deploy ran the start script directly and got "Permission denied": the file isn't executable; it has always been run with bash. Rollback ran it directly too and failed the same way. Then my "is rollback still running?" check, pgrep -f, matched its own command line, so a rollback that had already failed looked like it was still working. Fix: run scripts the way you always run them, bash -n both versions before you deploy, and don't take pgrep -f as proof. 4. Every request: 503 "draining". The new gateway checked the same drain flag as the front end it replaced. The old one had left its flag behind when it shut down, so the new one thought it was draining. It happened in the first acceptance test, before any real user. Fix: each component owns its own state files. A minute later: 23/23 passed. 5. The first boot gave up. I set the cluster to boot straight into the 4-node DeepSeek mode. That means stopping the media service on two Sparks first. Right after boot its state read "unknown", and the script refuses "unknown". Fix: at boot, stop media no matter what; nothing can be in flight yet. Second reboot, hands off: serving in about 5 min 40 s. Cheat sheet: - "Done" = the new mode answered a real request - One container name per setup; test for duplicates - Check every key and file before you stop the old one - Each component owns its state; never inherit a drain flag - bash -n before you deploy; pgrep -f finds itself - Reboot-test it. Twice. Now "done" means something. If you're running one of these: good luck, and have fun with it.
View original post