OpenStack Universal Design Ideas-play 5 minutes a day OpenStack (25)

Source: Internet
Author: User

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498453349065819.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498585905023822.jpg "alt=" Image143.5.png "style=" border:0px; "/>

API front-end services

Each OpenStack component may contain several sub-services, which must have an API service that is responsible for receiving customer requests.

In Nova, for example, Nova-api as a unique window to the Nova component, exposing the capabilities that Nova can provide to customers. When customers need to perform VM-related operations, they can and only send REST requests to NOVA-API. Customers here include end users, command lines, and other OpenStack components.

The benefits of designing API front-end services are: 1. Provide a unified interface to the outside, hide implementation Details 2. The API provides REST standard invocation services for easy integration with third-party systems 3. High availability of APIs can be easily implemented by running multiple API service instances, such as running multiple NOVA-API processes

Scheduler Dispatch Service

For an operation, if more than one entity can complete the task, there is usually a scheduler responsible for picking out the most appropriate one from those entities to perform the operation.

In the previous example, Nova has multiple compute nodes. When a virtual machine needs to be created, Nova-scheduler chooses the most appropriate compute node to run the VM based on the resource usage of the compute node at the time.

The scheduling service is like a project manager in a development team, and when a new development task is received, the project manager assesses the difficulty of the task, the current workload and skill level of the team members, and assigns the task to the most appropriate developer.

In addition to the Nova, the Block service component Cinder also has a scheduler sub-service, which we will discuss in detail later.

Worker Work Services

The dispatch service just assigns tasks, and the worker work service is the real task.

In Nova, this Worker is Nova-compute. The functional partitioning of Scheduler and Worker makes OpenStack very easy to scale:

    1. Increase compute nodes (increase Worker) when compute resources are insufficient to create a virtual machine

    2. When the customer's request volume is too large to dispatch, you can increase the Scheduler

Driver Frame

OpenStack is an open infrastracture as a Service cloud operating system that supports the industry's best technologies. These technologies may be open source free, or it may be a commercial charge. This open architecture allows OpenStack to be technically advanced and competitive without creating a vendor lock-in (lock-in).

Where does this openness of OpenStack manifest itself? An important aspect is the adoption of a Driver-based framework.

For Nova, for example, OpenStack's compute nodes support multiple Hypervisor. Includes KVM, Hyper-V, VMWare, Xen, Docker, LXC and more.

Nova-compute defines a unified interface for these Hypervisor, Hypervisor can plug and play into OpenStack in the form of driver by simply implementing these interfaces. Here's the Nova driver architecture

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498524356081025.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498587439070722.jpg "style=" border:0px;float:none; "/>

In Nova-compute configuration file/etc/nova/nova.conf, the Compute_driver configuration item specifies which Hypervisor the compute node uses driver

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498524363048329.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498587779038837.jpg "style=" border:0px;white-space:normal;float:none; "/>

In our environment, because it is KVM, we are configuring the Libvirt driver.

I wonder if you remember when we learned Glance: OpenStack supports multiple backend to store an image. It can be local file system, Cinder,ceph,swift and so on.

In fact, this is also a driver architecture. The new storage method can easily be added to the backend support list as long as the Glance definition specification is met.

We will also see the application of the driver framework in the back Cinder and Neutron.

Messaging Service

In the process of creating a virtual machine earlier, we saw that the call between the nova-* sub-services was heavily dependent on Messaging. Messaging is the backbone of the nova-* sub-service interaction.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498524491085336.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498587907055686.jpg "style=" border:0px;white-space:normal;float:none; "/>

Students who have not been exposed to distributed systems before may not understand why the API calls scheduler directly, or let Scheuler call Compute directly, rather than Messaging. Here are some explanations.

There are usually two kinds of calls between programs: synchronous calls and asynchronous invocations.

Synchronous invocation

The interface that the API calls Scheduler directly is the synchronous call. It is characterized by the need to wait until the API makes a request, until Scheduler completes the dispatch of the Compute and returns the result to the API before the API can continue to do the work behind it.

asynchronous invocation

The API calls Scheduler indirectly through Messaging is called asynchronously. The feature is that the API does not need to wait after the request, directly return, continue to do the work behind. Scheduler executes the dispatch operation after receiving the request from Messaging and sends the result to the API via Messaging after completion.

In a distributed system such as OpenStack, an asynchronous invocation is often used, with the benefit of:

    1. Each sub-service sub-service does not need to know where other services are running, just send a message to Messaging to complete the call.

    2. Improve performance asynchronous calls make it unnecessary for callers to wait for the result to return. This allows you to continue to do more work and improve the overall throughput of your system.

    3. The scaling-up service can be scaled as needed to enable more instances to process more requests, increasing availability and increasing the scalability of the entire system. And this change does not affect other sub-services, which means that the change is transparent to others.

In the following sections, we can see the application of Messaging.

Database

OpenStack components need to maintain their own state information. For example, Nova has a virtual machine in the specification, state, and this information is maintained in the database. Each OpenStack component has its own database in MySQL.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498524483095776.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498588103051690.jpg "style=" border:0px;white-space:normal;float:none; "/>

Summary

Nova is the most important component in OpenStack and is also a typical component. Nova fully embodies the design ideas of OpenStack. Understanding this idea, and then learning the other OpenStack components can be extrapolate, clear and much easier.

We will also review these design ideas in the study of Cinder and Neutron later.

650) this.width=650; "title=" "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160424-1461498588207052401.jpg "style=" Border:0px;vertical-align:middle;color:rgb ( 63,63,63); font-family: ' Microsoft Yahei '; Font-size:15px;line-height:21.75px;text-align:justify;white-space: Normal;background-color:rgb (246,246,246); "/>

OpenStack Universal Design Ideas-play 5 minutes a day OpenStack (25)

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.