Start Instance 操作详解

来源:互联网 发布:无标度网络 路径短 编辑:程序博客网 时间:2024/05/01 06:20

image184.5.png

本节通过日志文件详细分析 instance start 操作。

下面是 start instance 的流程图

image180.png

  1. 向 nova-api 发送请求

  2. nova-api 发送消息

  3. nova-compute 执行操作

下面我们详细讨论每一个步骤。

向 nova-api 发送请求

客户(可以是 OpenStack 最终用户,也可以是其他程序)向API(nova-api)发送请求:“帮我启动这个 Instance”

查看日志 /opt/stack/logs/n-api.log

nova-api 发送消息

nova-api 向 Messaging(RabbitMQ)发送了一条消息:“启动这个 Instance” 查看源代码 /opt/stack/nova/nova/compute/api.py 的 2002 行,方法是 start。

self.compute_rpcapi.start_instance() 的作用就是向 RabbitMQ 上 nova-compute 的消息队列里发送一条 start instance 的消息。

nova-compute 执行操作

查看日志 /opt/stack/logs/n-cpu.log

开始启动

准备虚拟网卡

准备 instance 的 XML 文件

准备 instance 镜像文件

成功启动



Start 操作的分析就得这里,下节继续讨论其他 nova 操作。

0 0
原创粉丝点击