Home > openstack > VM creation process in OpenStack nova

VM creation process in OpenStack nova

VM creation process in Openstack nova – a step by step guide

1. **** Python Nova-Client **** :
nova boot –image cirros-0.3.1-x86_64-uec-kernel –flavor m1.tiny s2

2. **** Nova API **** :
a. /opt/stack/nova/nova/api/openstack/compute/servers.py M: create() Description: Gather information about new vm (flavor, network and so on)
b. /opt/stack/nova/nova/compute/api.py M : create() Description: check vm create policies, call rpc to send message to scheduler
c. /opt/stack/nova/nova/compute/rpcapi.py M: run_instance Description: cast the vm createtion message to the scheulder
d. An entry is made in the dababase setting the vm status “BUILD” / “Swapning”





when Intercepted from rabbitmq VM creattion Message looks like:

"memo ry_mb":512,
"_context_user_ name":"demo",


At the scheduler side:
a. RPC Dispatcher OpenStack/common/rpc/dispatcher.py dispatches the message to the worker.
b. /opt/stack/nova/nova/scheduler/manager.py M: run_instance() is called to create and run the VM
c. /opt/stack/nova/nova/scheduler/filter_scheduler.py M: schedule_run_instance() is called to find eligible host where new vm can be created and run.
d. If possible VM is created & run and in the database the status of the machine is changed to Active / Error or something else.
d. The status of the creation process is also send through notifier.notify() method.
f. /opt/stack/nova/nova/openstack/common/notifier/api.py M: notify() is called which put the message in the message queue.

A nofication (of type Info) message (truncated) stating VM creation error is following:

"_contex t_auth_token":"b194a1b3275f407d9dfdaf5013b59267",
"_context_is_ admin":false,
"_context_user_ name":"demo",

Note that both message has the same request id which is shown by the field _context_request_id and both message refer to the same VM which is dictated by the field _unique_id. So, upon receiving the message, the notification system may know the status of vm creation process.

Categories: openstack Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s