
本節通過日志文件詳細分析 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 操作。
