OpenStack's process of creating cloud hosts-little White (LINUXZKQ)

Source: Internet
Author: User
Tags message queue naming convention

Bloggers ever changed jobs to now, because the work is too busy reasons, has not updated the blog for a long time, deeply apologize, but also hope you understand ...

Today just a bit of time, the process of organizing openstack to create a cloud host, the big God do not spray 650) this.width=650; "alt=" J_0019.gif "src=" http://img.baidu.com/hi/jx2/j_0019. GIF "/>.

First, the flowchart

650) this.width=650; "title=" 1.png "src=" https://s1.51cto.com/wyfs02/M00/A4/F2/ Wkiol1m1bnuxrdnmaaqjpx3hlku625.png-wh_500x0-wm_3-wmp_4-s_4269522419.png "alt=" Wkiol1m1bnuxrdnmaaqjpx3hlku625.png-wh_50 "/>

Second, the virtual machine creation process is as follows

  1. Client (user) side through the command line CLI or dashboard horizon use their own user name Password request authentication component Keystone user authentication;

  2. Keystone by querying whether there is user information in the database user table in Keystone, including the hash value after password encryption, and returning a token_id (token), and Servicecatalog ( The endpoint address of some services, cinder, GLANCE-API after downloading the image and creating block storage will be used);

  3. The client takes the Keystone returned with the token_id and creates the virtual machine related parameters, through the NOVA-API address post requests the Nova component to create the VM;

  4. NOVA-API receives the request, first uses the request carries the token_id to visit the Keystone, verifies the token is valid;

  5. Keystone Verify the updated authentication information after passing the verification;

  6. The Nova API queries the Nova DB Library to verify that the parameters for creating the virtual machine are valid and legitimate.

    Check that the virtual machine name conforms to the naming convention, that flavor_id exists in the database, that Image_uuid is the correct UUID format, and that the number of instance, Vcpus, and Ram exceeds the quota.

  7. When and only if all the parameters are valid, update the NOVA database, create a new instance record, Vm_states set to building,task_state to scheduling;

  8. The Nova API remotely calls the pass request, parameters to Nova Scheduler, the message "Please create a virtual machine for me" drop to the message queue, and then periodically query the state of the virtual machine;

  9. Nova Scheduler This message from the queue to "Please create a virtual machine for me";

  10. Nova Scheduler accesses the Nova database and, through the scheduling algorithm, filters out some suitable, idle compute nodes and sorts them.

  11. Update the VM node information and return an optimal node ID to Nova Scheduler;

  12. Nova Scheduler after selecting Host (optimal Node ID), call the Nova-compute service by Rpc.call and throw the "Create VM request" message to Message Queue (MQ) again;

  13. Nova compute gets the message from MQ to create a virtual machine request;

    #nova-compute has a scheduled task that periodically finds all of the virtual machine information running on that node from the database, counting the number of free CPUs, the amount of free memory, and the size of the free disk. Then update the database compute_node information to ensure the accuracy of the dispatch.

  14. Nova compute queries the virtual machines in the Nova database by Rpc.call, such as host templates and IDs;

  15. Nova conductor Gets the message from the message queue requesting that the (virtual machine information) in the database be queried;

  16. Nova Conductor queries the Nova database;

  17. The Nova database returns the virtual machine information being queried to Nova conductor;

  18. Nova conductor drops the queried virtual machine information into MQ, and Nova Compute obtains the virtual machine's information from the message queue;

  19. Nova COMPUTE requests Glance's RESTful API to download the required images, typically in qcow2 format; http://www.cnblogs.com/zhoumingang/p/5522463.html

  20. The Glance API will also go to Keystone to verify that the token requested is valid;

  21. Token validation is valid, Glance API returns image information to Nova-compute;

  22. Similarly, Nova compute requests Neutron API Configuration network (Quantum (neutron predecessor)), such as the acquisition of virtual machine IP address, mask, gateway and other information;

  23. Neutron API to Keystone Verify that the token requested is valid;

  24. Token validation is valid, Neutron API returns network information to Nova-compute;

  25. 25-27 steps. with glance, neutron authentication token, return block device information, that is, the cloud hard disk to Nova-compute;

  26. 28 steps. based on the virtual machine information configured above, generate the XML, write the Libvirt.xml file, and then call Libvirt driver to start the virtual machine with the Libvirt.xml file.

650) this.width=650; "title=" 2.png "src=" https://s5.51cto.com/wyfs02/M01/A4/F2/ Wkiol1m1cixsbjjfaaaktsbrjga311.png-wh_500x0-wm_3-wmp_4-s_510480044.png "alt=" Wkiol1m1cixsbjjfaaaktsbrjga311.png-wh_50 "/>

Iii. Summary

1, OpenStack This distributed architecture, loose coupling between the various modules, can easily add new modules, and flexible configuration, services can be installed in different nodes, even if some services are hung will not affect.

2, virtual machine to create a simple three-step, Nova API to accept the creation of virtual machine request, Nova Scheduler to create virtual machine designated host, Nova Compute boot virtual machine. If you can understand all the steps above, then the location of the problem can be accurate, and even some problems can be solved on their own, such as virtual machine error, if you see the virtual machine information has the host information, that basic can be seen from the Novacompute log of the problem, if not, The basic is that scheduler will have an error message prompt.

This article is from the cloud computing and Big Data blog, so be sure to keep this source http://linuxzkq.blog.51cto.com/9379412/1964144

OpenStack's process of creating cloud hosts-little White (LINUXZKQ)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.