发表于 2018-5-31 11:26:08

Start Instance 操作详解

  Start Instance 操作详解 - 每天5分钟玩转 OpenStack(31)

本节通过日志文件详细分析 instance start 操作。
下面是 start instance 的流程图


[*]向 nova-api 发送请求
[*]nova-api 发送消息
[*]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 操作。
页: [1]
查看完整版本: Start Instance 操作详解