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


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 操作。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM