跳转到: 导航, 搜索

BootFromVolume

  • Launchpad 条目: NovaSpec:boot-from-volume
  • 创建时间: 2011-04-19
  • 贡献者: Isaku Yamahata, Yoshiaki Tamura

总结

支持使用 nova api 和 ec2 api 从 EC2 EBS 启动

发布说明

当实现此功能时,虚拟机将能够根据用户指定的方式,以附加卷的方式启动。一些相关的命令和库需要是最新版本。(我正在使用 euca2ools 进行测试。我不了解 ec2 工具)我使用的是 Ubuntu 11.04(natty),并替换了一些代码。

  • euca2ools
   lp:euca2ools rev 421 
   I'm using the one from the repo which includes several bug fixes.
   Maybe more bug fixes might come related to block device mapping.
  • boto
   from the google repo. http://code.google.com/p/boto/
   https://github.com/boto/boto/commit/6c9e5181193c829b926e5445a90508ba0375e009
   or later.(which is newer than officital release 2.0b4)
   It includes some bug fixes and requires python 2.7 or later. (it doesn't work with python 2.6)
  • python 2.7
   boto 2.0bN requires python 2.7 (or later), so I'm using Ubuntu 11.04(natty)
   I'm not sure tt would be easy to use boto 2.0 on ubuntu 10.x which adopt python 2.6.

原理

EC2 支持基于 EBS 的启动,而 OpenStack 还没有相应的机制。Amazon 提倡基于 EBS 的启动比基于 S3 的启动更有优势。对于 OpenStack,特别是我们可以获得

  • 更短的启动时间
  • 持久的根分区

用户故事

  • 用户注册卷 ID 或快照 ID 到镜像,或者在启动时指定这些 ID。
  • 用户将看到以附加卷启动的实例。

前提条件

对于卷快照的支持,假定以下蓝图:

设计

启动卷所需的信息将被传递到计算节点和虚拟驱动程序。在传递过程中,将采取必要的行动并相应地更新数据库。

实现

  • 镜像支持
  enhance machine image to allow volume id/snapshot id.
  • 卷数据库
  add new column to allows delete-on-terminate
  • 用户 API
    • ec2 api 已经由 Amazon 设计。
    • nova api 使用 json 格式添加卷,例如 "volume": {"id":"7", "mountpoint":"/dev/vda"}
  • api 节点
  parser enhance and pass down those infos compute-api updates volume db to tell compute node which
  volumes to be used by changing its status into in-use.
  For supporting ephemeral device or snapshot, more infos needs to be passed to compute node via db or somehow.
  Currently volume db is used to avoid changing db schema.
  • 计算节点
  Check if which volumes are attached. If snapshot ids are specify, create the volumes based on them.
  Lastly tell virt driver so.
  • 当虚拟机终止时,如果指定了“终止时删除”,则删除该卷。

UI 变更

  • AMI 设置
  • 创建实例

代码变更

待办事项 代码更改应包括需要更改的内容概述,并且在某些情况下甚至包括具体细节。

迁移

待办事项 包括

  • 数据迁移(如果有)
  • 从旧 URL 到新 URL 的重定向(如果有)
  • 如何引导用户使用新的操作方式(如果需要)。

测试/演示计划

这不必在规范接近 Beta 之前添加或完成。

未解决的问题

At the moment EC2 API allows snapshot id to specify boot volume. However right now volume id is used.
As a result the patches for euca2ools is necessary which includes bug fix.

BoF 议程和讨论

使用本节记录 BoF 期间的笔记;如果将其保留在批准的规范中,请用于总结讨论内容并记录任何被拒绝的选项。