EC2 AMI 的 KVM 等效项
我正在构建一个需要从脚本动态启动 KVM 来宾的软件。我希望 KVM 提供类似“AMI”的功能,以便我可以启动新的来宾,而无需完成整个操作系统安装过程。
我读过一些有关“迁移”功能的内容,但听起来不太正确。
我真的很希望能够构建一个来宾,对其进行映像,然后能够一遍又一遍地启动该映像的克隆。
I'm building a piece of software that needs to spin up KVM guests dynamically from a script. I'm hoping that KVM offers an 'AMI' like functionality so that I can spin up new guests without having to go through the entire OS install process.
I've read a little about the 'migrate' functionality but its doesn't sound quite right.
I would really like to be able to build up a guest, image it, and then be able to spin up clones of that image over and over.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以防万一这个问题的答案对任何其他试图在 EC2 和 KVM 之间进行类比的人有所帮助。
使用 KVM,当您启动 guest 虚拟机时,您可以指定一个磁盘映像文件 (guestos.img)。要与另一个来宾重用相同的“图像”,您所要做的就是关闭原始来宾,复制其图像(可能为了清晰起见重命名),然后启动一个指向复制图像的新来宾。瞧!
这是一些咯咯笑的代码:
Just in case the answer to this can be helpful to anyone else who is trying to create analogies between EC2 and KVM here you go.
With KVM, when you start up a guest you specify a disk image file (guestos.img). To reuse that same "image" with another guest all you have to do is shutdown the original guest, copy it's image (and probably rename for clarity's sake) and then start a new guest that points to the copied image. Voila!
Here's some code for giggles: