OpenStack Series articles (iv)

Source: Internet
Author: User

Learn about OpenStack's series of articles-Nova
    • Nova Basic Concepts
    • Nova Architecture
    • OpenStack Log
    • Nova Components Introduction
    • Nova Operations Introduction
1. Nova Basic Concepts

Nova is the core service of OpenStack, responsible for managing and maintaining computing resources in the cloud, and the lifecycle management of virtual machines is achieved through Nova.

2. Nova Architecture 2.1 Nova Basic components

As shown, Nova consists of several components that run as sub-services.

For example, determine if the Nova-compute service is running by systemctl status Openstack-nova-compute.service :

Nova Main components:

    • Nova-api: Receiving and responding to client API calls;
    • Nova-scheduler: Virtual Machine Scheduling service, responsible for deciding on which compute node to run the virtual machine;
    • Nova-compute: Manage virtual machine's core service, realize virtual machine life cycle management by calling Hypervisor API;
    • Hypervisor: The Virtualization Management program on compute nodes, the bottom-up program of Virtual machine management, commonly used hypervisor KVM, VMware, etc.
    • Nova-conductor:nova-compute does not directly access the database, the work of accessing the database is done through Nova-conductor, the advantage is that the system has better scalability and higher security;
2.2 Nova Service Deployment

Nova-compute services are typically deployed on compute nodes, and other sub-services are generally deployed on the control node.

Command Nova service-list to show which node the Nova service is running on:

Login controller to see if the Nova-scheduler service is running:

2.3 Virtual Machine Creation steps

This article is written very well: https://ilearnstack.com/2013/04/26/request-flow-for-provisioning-instance-in-openstack/, strongly recommended, do not repeat here.

3. OpenStack Log

The Log storage path for OpenStack Nova is /var/log/nova/ .

The log format is < timestamp >< log level >< code module ><request id>< Log content >< source code location, respectively:

    • Timestamp: The time the log was recorded;
    • Log level, there is info, WARNING, ERROR, DEBUG, and so on, the default is info, to see the details, you can set the DEBUG option in/etc/nova/nova.conf to True, detailed details of the operation of the OpenStack website introduction;
    • code module, currently running code, for example, as shown in:

The code module is Nova.compute.manager and the module is found:

    1. Find /-name COMPUTE Locate the compute directory where the code is located;
    2. CD to the directory, where there is a manager.py code, that is, the code to run;
    3. Search the VM keyword and find the code to print this Log on line 1052:

    • Request ID: The log records consecutive different operations, in order to facilitate the distinction and increase readability, each operation is assigned a unique request ID, easy to find;
    • Log content: Record important information such as the actions and results that are currently being performed;
    • Source code Location: the location of the log code, including the method name, source code file directory location and line number, not all logs have;

4. Nova Components Introduction 4.1 nova-api

Nova-api is the portal for the Nova component, and all requests for Nova are first processed by NOVA-API.

With regard to the virtual machine lifecycle-related operations, the NOVA-API can be processed, and the Nova-api executable is recorded in the Instances Bar drop-down menu in OpenStack Dashboard.

4.2 Nova-scheduler

Nova-scheduler is called based on the user's resource requirements, including Vcpus, RAM, DISK, and Metadata, which are defined in flavor.

How do I make calls based on flavor?

The default scheduler for Nova-scheduler is Filter scheduler, and when the filter scheduler performs a dispatch operation, the filter selects the compute nodes that satisfy the flavor, and calculates the weights of each compute node after selecting the compute nodes that meet the criteria To select the optimal compute node, create a instance on the compute node.

The default filter is indicated in the /etc/nova/nova.conf :

Retryfilter: Brush out the nodes that have already been dispatched.

Availabilityzonefilter: Filter out the compute nodes that are not part of the specified availability zone, as described in the introduction and settings for availability zone this blog post.

Computefilter: It is guaranteed that only the Nova-compute service can be nova-scheduler dispatched in the calculation phase.

Servergroupantiaffinityfilter: Try to deploy the Instance to different nodes as much as possible, provided the Instance is added to the group, and if no server group is specified, filter will not do any filtering.

4.3 nova-compute

The nova-compute runs on the compute nodes and is responsible for managing the instance on the nodes.

The operation of OpenStack to instance, and finally to Nova-compute to complete, nova-compute and Hypervisor together to achieve the instance life cycle of OpenStack management.

The functions of nova-compute can be divided into two categories:

    • Periodically report the state of the compute nodes to OpenStack;
    • Implement the management of the instance lifecycle, including preparing resources for instance, creating instance image files, creating instance XML files, creating virtual networks, and starting a VM.

Hypervisor most clearly compute node information, you can view the compute node and dominfo information through the Virsh nodeinfo and Virsh instance commands:

Note To view the instance information running on the compute nodes, you need to switch to the root user, otherwise nothing will be displayed.

With these commands, it is also possible to calculate the instance that the instance can also accommodate a large number of flavor.

5. Nova Operation Introduction 5.1 Create Instance

Using log to analyze this creation process, the DEBUG option is not open.

The steps are as follows:

1. The user sends a request to NOVA-API: "Create instance"

2. Nova-scheduler complete scheduling, select Compute-0 as instance deployed node

3. Nova-compute first allocates memory, disk space, and Vcpus based on flavor for instance

Flavor the required resources are allocated before assigning network resources to instance:

Create an image for instance:

Note that Nova-compute will check if the image exists on compute node, and if it exists, it is used directly, and if it does not exist, SSH to glance downloads the image to the local via SCP:

Download the uploaded image to the /var/lib/nova/instances/_base/ directory and download the image uuid as cce3aa2cd0a67c02306843a3523a997f632ee284 , the image is viewed by the qemu-img info command in the following format:

The image of the instance is in the Qcow2 format, so it is also necessary to convert the raw format image to the qcow2 image for instance, the converted image in /var/lib/nova/instances Directory, the UUID is 17edd30c-bf61-4592-8784-8774e8156469, which is the UUID of instance.

Similarly, see if the image is in qcow2 format by qemu-img info :

4. Instance created successfully

5.2 Rescue/unrescue

Rescue: Failure recovery mechanism, due to misoperation or sudden power outages and other operations so that the operating system does not come, in order to maximize the data, use a system disk to boot up the system, and then try to recover. If the problem is not too serious, you can make the system work again in this way.

5.3 Soft/hard Reboot

Soft Reboot: Restart the operating system, the entire process, instance is still running, the equivalent of executing Reboot commands in Linux.

Hard Reboot: Restart instance, which is equivalent to shutting down and then powering on.

5.4 Migrate

Migrate: Migrating instance from the current compute node to another node, do not ask the source and destination nodes to share storage, must meet a condition before Migrate: The compute nodes need to be configured without password access to the Nova user.

5.5 Live Migrate

Live Migrate: Online migration, instance no downtime, divided into shared storage migrations and non-shared storage migrations.

This blog post is visible about shared storage NFS content.

5.6 Resize

Resize: Adjusting the Vcpus, memory, and disk resources of the instance, Migrate is a special Resize because flavor did not change during the migration process.

Reference article:

Https://www.cnblogs.com/CloudMan6/p/5548294.html

Https://www.cnblogs.com/liuyisai/p/5992511.html

OpenStack Series articles (iv)

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.