Through this article, you will be able to understand how to configure the hybrid hypervisor in openstack and the basic analysis of its implementation principles. This article analyzes the principles of the hybrid hypervisor scenario in openstack based on the actual development experience of the author in Nova, and introduces how to configure the hybrid hypervisor scenario in actual application scenarios.
Generally, there are three key steps to deploy an openstack-based hybrid hypervisor:
- Configure compute nodes of different hypervisor types
- Identifies the image's platform/hypervisor attributes, that is, the image's applicable platform/hypervisor
- Creates a VM based on a hypervisor image.
In the actual deployment environment, the deployment architecture of the hybrid hypervisor is usually shown in figure-1 (here we will take the hybrid scenario of powervm and KVM as an example:
Figure 1. deployment architecture of hybrid hypervisor (powervm + KVM)
With the continuous development of enterprise-level data centers, their business needs for hybrid virtualization environments are also growing, resulting in demands for multi-hypervisor management tools and technologies on cloud computing platforms. As an industry-leading open-source cloud computing management platform, openstack provides excellent support for hybrid hypervisor management.
What is openstack?
Openstack is both a community and an open source software project. It provides an operating platform for cloud deployment. openstack is an open source project designed to provide software for the construction and management of public and private clouds. As an infrastructure-as-a-service (IAAS) resource, openstack is designed to simplify the cloud deployment process and improve scalability.
Openstack is an open-source software project. To facilitate the management of the Development of each part of the project, openstack is divided into core projects, incubator projects, and support projects and related projects. The most mature and important projects are core projects. They are:
Openstack compute (NOVA), openstack Image Service (glance), and openstack Identity Service (keystone. Openstack compute (NOVA) is a cloud computing controller. It provides a tool for cloud deployment, including instance deployment and network management.
Openstack Image Service (glance) is a storage, query, and Retrieval System for Virtual Machine images. Its restfulapi allows users to query VM image metadata and retrieve actual images through HTTP requests.
Openstack Identity Service (keystone) is an identity service that provides identity creation, authentication, and management.
Obtain openstack source code
We can query and download the source code of the opensstack sub-project in the openstack source code repository.
The usual download method is to use git, for example:
git clone http://github.com/openstack/nova.git
Install and configure openstack
This article describes the principles and best practices of the hybrid hypervisor scenario in openstack. The components involved include openstack compute (NOVA), openstack Image Service (glance), and openstack identity (keystone ). For the basic installation and configuration of openstack, refer to the devstack website to learn how to use the devstack script to quickly install and configure the openstack environment (we recommend using devstack to quickly install and configure openstack ).
See openstack installation, configuration, and verification to learn how to install, configure, and verify openstack.
Refer to the openstack Platform Installation Introduction to learn about the best openstack installation practices on each platform.
How to operate openstack
How to operate openstack: openstack dashboard, openstack command-line clients, and openstack APIs.
As a sub-project of openstack, openstack dashboard provides a web-based GUI.
Refer to the openstack dashboard operation for details about the openstack dashboard operation.
Openstack command-line clients: the core sub-projects of openstack have the corresponding command-line client. For example, the command-line Client: glance (Python-glanceclient) corresponding to the openstack glance sub-project ), command-line client for the openstack keystone sub-project: keystone (Python-keystoneclient), command-line client for the openstack Nova sub-project: Nova (Python-novaclient), etc, see openstack command-line clients for details about openstack command-line clients.
Openstack provides a large number of APIs. See openstack APIs for details about openstack APIs.
(This article uses command-line clients to complete the hybrid hypervisor practices in openstack .)
Hypervisors supported by openstack
Openstack supports almost all mainstream hypervisors: powervm, KVM, hyperv, xen, and VMWare. For details, see hypervisors. Openstack provides the corresponding compute driver for the hypervisor under the subdirectory Nova/virt/of the Nova component, for example, Nova/virt/powervm provides powervm's compute driver, Nova/virt/libvirt/provides KVM's compute driver, and so on.
It is worth noting that the configuration file in Nova is Nova. the configuration of the powervm Computer Driver in conf is compute_driver = Nova. virt. powervm. powervmdriver: the configuration of the KVM computer driver is compute_driver = Nova. virt. libvirt. lib1_driver, instead of compute_driver = Nova/virt/powervm, compute_driver = Nova/virt/libvirt.
Currently, openstack only supports IVM and HMC does not. For more information, see openstack powervm configuration.
Configure the compute node and start the service
Generally, openstack has one or more control nodes, also known as Cloud Controller nodes. For simple deployment scenarios, public components such as keystone, glance, database, and message queue in openstack are deployed on a control node.
Generally, the minimum openstack service set to be started includes: qpid, MySQL, keystone-all, Nova-API, Nova-conductor, Nova-network, Nova-schdctor, and Nova-compute, glance-API, glance-registry.
Run the "NOVA-manage Service list" command to view the service status related to "NOVA. In addition, KVM is not running in the same operating system as the compute node and openstack control node in the hybrid hypervisor scenario involved in this article. Therefore, some ports on the control node need to be opened to ensure normal communication between the two, such as port 5672 used by qpid and port 9292 used by glance-API.
Powervm node configuration
When we confirm that other services have been properly started, we choose to start the powervm-based compute service on the control node. The powervm driver actually communicates with a remote powervm through the SSH protocol. Therefore, the powervm-based compute service can theoretically run on any operating system that can communicate normally with the control node, considering the complexity of the configuration, we can run it on the control node to simplify the deployment topology. Next we need to modify the configuration file Nova. conf of Nova to support management of powervm:
compute_driver=nova.virt.powervm.PowerVMDriverpowervm_mgr_type=ivmpowervm_mgr=ivm_hostname_or_ip_addresspowervm_mgr_user=padminpowervm_mgr_passwd=padmin_user_passwordpowervm_img_remote_path=/path/to/remote/image/directorypowervm_img_local_path=/path/to/local/image/directory/on/compute/hosthost=PowervmHost
- Compute_driver indicates the current compute driver
- Powervm_mgr_type indicates the current powervm manager type. Currently, only IVM is supported.
- Powervm_mgr is used to specify the ivm ip address or hostname
- Powervm_mgr_user is used to specify the username of the powervm manager.
- Powervm_mgr_passwd is used to specify the password of the powervm manager.
- Powervm_img_remote_path is used to specify the path for storing the image on powervm manager.
- Powervm_img_local_path is used to specify the storage path of the image on the compute service node.
- Host is used to identify the name of a compute node and distinguish it from other compute nodes.
KVM node configuration
The compute configuration of KVM is slightly different from that of powervm. Compared with powervm driver, the configuration of libvirt driver is simpler because it does not involve authentication issues.
#1. configure the name of the compute node host = kvmhost #2. configure KVM as hypervisorlib1__type = kvmcompute_driver = Nova. virt. libvirt. lib1_driver #3. configure the IP address of the control node so that the current compute node can communicate with the control node. SQL _connection = MYSQL: // NOVA: Nova @ controller_node_ip/novaglance_api_servers = controller_node_ip: 9292qpid_hostname = controller_node_ipauth_host = controller_node_ipauth_uri = http: // controller_node_ip: 35357/
Similarly, after the NOVA-compute service is started, you can run the NOVA-manage Service list on the control node to check the state of the compute service on this KVM node.
Image attribute settings and implementation principles
After you run the "NOVA-Manager Service list" command or the "Nova service-list" command to check whether the two compute services of powervm and KVM are normal, the next important step before deploying a virtual machine is to set the image attribute. Only after the hypervisor_type attribute of the image is set, Nova schedtype can process the new VM creation request, filter out the host list that meets the condition based on the attribute specified by the image hypervisor type.
Image attribute settings
Currently, the image service component glance in openstack allows you to specify the hypervisor_type attribute when creating an image. It also supports updating this attribute for the created image.
The following command registers an image of the powervm type:
glance image-create --name="PowerRhel6" --propertyHypervisor_type=powervm --disk-format=raw --container-format=bare < /home/image/Rhel6.raw.gz
The command for registering an image of the KVM type is as follows:
Glance image-create -- name = cirros-0.3.0-x86_64 -- propertyhypervisor_type = KVM -- Disk-format = qcow2 -- container-format = bare
Implementation Principle
In openstack, when deploying Virtual Machine instances, Nova scheduler filters out qualified hosts for Virtual Machine deployment. Therefore, it is difficult to understand the principles of hybrid hypervisor deployment. That is to say, the basic filter condition is to ensure that the hypervisor_type attribute of the image matches the hypervisor type published by the host.
According to the design of Nova compute driver, compute Driver (powervm driver, KVM driver ,...) after obtaining information about the host, a property named supported_instances is provided, that is, its own hypervisor type. When deploying a VM instance, Nova-scheduler compares the hypervisor_type of the image and the hypervisor_type of the instance supported by the host through image_props_filter. If the two are the same, the host will be selected as the available host for instance deployment. If the two are different, the host will be filtered out. For more implementation details, refer to the code here:
Https://github.com/openstack/nova/blob/master/nova/scheduler/filters/image_props_filter.py
Instance deployment
After correct configuration of powervm, KVM's Nova compute service, and image attributes, the commands deployed on the virtual machine do not need to be specified with special parameters and settings.
Deploy a powervm instance:
nova boot --image PowerRhel6 --flavor 1 PowerRhel6Inst
Deploy a KVM instance:
nova boot --image cirros-0.3.0-x86_64 --flavor 1 KVMCirrosInst
Next, you can verify by using commands related to powervm and KVM to check whether the two VM instances have been correctly deployed to the correct hypervisor.
You can use lssyscfg-r lpar on powervm (IVM) to view Virtual Machine instances deployed on powervm. You can use virsh list -- all on KVM to view Virtual Machine instances deployed on KVM.
Conclusion
In many cloud computing application scenarios, especially in private clouds, configuration and management of hybrid hypervisor scenarios are one of the common application requirements. This article briefly introduces how to configure the compute service of powervm and KVM in openstack. It also shows how to set attributes for powervm and KVM images so that Nova scheduler can filter out qualified host nodes, and briefly analyzes its implementation principles. This article describes how to configure openstack to manage hybrid hypervisor scenarios in a cloud computing environment.
Openstack mixture hypervisorsdriver configure and implementation Theory