技术领域technical field
本发明涉及物理机电源控制技术领域,特别是一种基于Openstack的物理机远程关机方法。The invention relates to the technical field of physical machine power control, in particular to an Openstack-based remote shutdown method for a physical machine.
背景技术Background technique
随着Openstack开源云平台快速发展,已经有越来越多服务商和企业通过开源IasS(基础设施即服务)云平台搭建类似亚马逊公有云的服务,包括有新浪、中国移动、中国电信、国家电网、日本电信运营商KDDI等用户也使用上开源Openstack云平台。然而Openstack云平台侧重于对虚拟机进行远程管控,而忽略物理机远程管控重要性。随着业务的不断扩展导致云平台增加越来越多的物理机节点来提供虚拟化服务,随之而来的问题:With the rapid development of the Openstack open source cloud platform, more and more service providers and enterprises have built services similar to Amazon's public cloud through the open source IasS (Infrastructure as a Service) cloud platform, including Sina, China Mobile, China Telecom, and State Grid , Japanese telecom operator KDDI and other users also use the open source Openstack cloud platform. However, the Openstack cloud platform focuses on remote control of virtual machines, while ignoring the importance of remote control of physical machines. With the continuous expansion of business, the cloud platform adds more and more physical machine nodes to provide virtualization services, and the following problems arise:
一是传统开源云平台通常没有物理机远程管理的功能,不能通过云平台统一远程管理物理机,需要另外一套物理机管理系统来管理物理机,特别是服务器空闲不用,需要远程对物理机进行关机操作。One is that the traditional open source cloud platform usually does not have the function of remote management of physical machines. It cannot remotely manage physical machines through the cloud platform. Another set of physical machine management system is needed to manage physical machines. Especially when the server is idle, it is necessary to remotely manage physical machines. Shutdown operation.
二是应用服务质量问题。众所周知,用户的最关心的应用都部署在虚拟机里面,而虚拟机则基于物理机。若对物理机进行关机,为了保证应用能够数据完整性,就需要通过云平台先关闭该物理机上所有虚拟机,保证应用正常退出,才能通过其他系统进行物理机关机操作。The second is the problem of application service quality. As we all know, the most concerned applications of users are deployed in virtual machines, and virtual machines are based on physical machines. If the physical machine is shut down, in order to ensure the data integrity of the application, all virtual machines on the physical machine need to be shut down through the cloud platform to ensure that the application exits normally, and then the physical shutdown operation can be performed through other systems.
为了Openstack云平台统一管理物理机和虚拟机的电源状态,提高应用服务质量,需要一种基于Openstack的物理机远程关机的方法,统一管理虚拟机和物理机的电源状态。In order to uniformly manage the power status of physical machines and virtual machines on the Openstack cloud platform and improve application service quality, a method for remotely shutting down physical machines based on Openstack is needed to uniformly manage the power status of virtual machines and physical machines.
发明内容Contents of the invention
本发明解决的技术问题在于提供一种基于Openstack的物理机远程关机的方法,解决了物理机关机前先关闭虚拟机、提高部署在虚拟机上的应用程序服务质量、满足Openstack开源云平台Juno版本不能远程物理机关机、不能统一管理物理机和虚拟机电源状态等问题。The technical problem solved by the present invention is to provide a method for remote shutdown of a physical machine based on Openstack, which solves the problem of shutting down the virtual machine before the physical shutdown, improving the service quality of the application program deployed on the virtual machine, and meeting the Juno version of the Openstack open source cloud platform Issues such as the inability to remotely physically shut down the machine, and the inability to manage the power status of physical machines and virtual machines in a unified manner.
本发明解决上述技术问题的技术方案是:The technical scheme that the present invention solves the problems of the technologies described above is:
所述的方法包括如下步骤:Described method comprises the steps:
步骤1:设置物理机的IPMI智能平台管理接口地址、登录用户名和密码;Step 1: Set the IPMI intelligent platform management interface address, login user name and password of the physical machine;
步骤2:用户请求对目标节点远程关机;Step 2: The user requests to remotely shut down the target node;
步骤3:发送请求“关闭目标节点所有的虚拟机”;Step 3: Send a request "shut down all virtual machines on the target node";
步骤4:目标节点执行关闭本机上所有虚拟机;Step 4: The target node performs shutdown of all virtual machines on the machine;
步骤5:通过IPMI智能平台管理接口执行关机。Step 5: Perform shutdown through the IPMI intelligent platform management interface.
所述智能平台管理接口是一种开放标准的通用服务器硬件管理接口,不仅允许进行带外服务器管理,而且不需要通过操作系统来处理请求。The intelligent platform management interface is an open-standard general server hardware management interface, which not only allows out-of-band server management, but also does not need to process requests through the operating system.
所述用户通过Openstack的Web界面,点击目标节点,并请求对目标节点远程关机。The user clicks on the target node through the web interface of Openstack, and requests to remotely shut down the target node.
通过Web服务器判断目标节点的电源状态符合关机的要求,若符合要求则下发请求给后台服务。The power state of the target node is judged by the Web server to meet the shutdown requirements, and if it meets the requirements, a request is sent to the background service.
所述目标节点收到请求后,通过Libvirt接口查询本地上所有处于正在运行状态的虚拟机列表,循环对每个虚拟机执行关闭电源操作,并返回结果。After the target node receives the request, it queries the list of all running virtual machines locally through the Libvirt interface, executes a power-off operation on each virtual machine in a loop, and returns the result.
所述后台服务收到虚拟机关闭电源的结果,IPMI的地址、登录用户名和密码,调用IPMI命令行工具的命令,通过IPMI智能平台管理接口发送给目标节点的BMC执行关机。The background service receives the result that the virtual machine is powered off, the IPMI address, login user name and password, calls the command of the IPMI command line tool, and sends it to the BMC of the target node through the IPMI intelligent platform management interface to perform shutdown.
所述Openstack是由NASA(美国国家航空航天局)和Rackspace合作研发并发起的,以Apache许可证授权的自由软件和开放源代码项目;是一个开源的云计算管理平台项目,由多个主要的组件组合起来完成具体工作Said Openstack is a free software and open source code project authorized by the Apache license, which was jointly developed and initiated by NASA (National Aeronautics and Space Administration) and Rackspace; it is an open source cloud computing management platform project, composed of several major Components combine to do specific work
所述Libvirt是Linux操作系统的免费、开源的主流虚拟化工具的C函数库,其目的是包括Kvm、Xen在内的各种虚拟化工具提供一套方便、可靠的编程接口,支持C、C++、Java和Python等多种主流编程语言。Described Libvirt is the C function storehouse of free, open-source mainstream virtualization tool of Linux operating system, and its purpose is that various virtualization tools including Kvm, Xen provide a set of convenient, reliable programming interface, support C, C++ , Java and Python and other mainstream programming languages.
本发明通过Libvirt接口和智能平台管理接口,支持对各种主流品牌的服务器远程关机,并在平台上统一对虚拟机和物理机先后进行关闭电源操作,本发明也为用户提供很大的便利性。本发明区别于一般的开源云平台不能统一管理物理机和虚拟机的电源状态,不受服务器品牌和操作系统的限制,按需关闭物理机和虚拟机,有效控制电费支出。The present invention supports remote shutdown of servers of various mainstream brands through the Libvirt interface and the intelligent platform management interface, and performs power-off operations on virtual machines and physical machines on the platform in a unified manner. The present invention also provides great convenience for users . The present invention is different from the general open source cloud platform which cannot uniformly manage the power state of the physical machine and the virtual machine, and is not restricted by the server brand and the operating system, shuts down the physical machine and the virtual machine as needed, and effectively controls the electricity expense.
附图说明Description of drawings
下面结合附图对本发明进一步说明:Below in conjunction with accompanying drawing, the present invention is further described:
图1为本发明方法流程图;Fig. 1 is a flow chart of the method of the present invention;
图2为本发明部署图。Fig. 2 is a deployment diagram of the present invention.
具体实施方式Detailed ways
如图1、2所示,本发明首先设置物理机的IPMI智能平台管理接口地址、登录用户名和密码As shown in Figures 1 and 2, the present invention first sets the IPMI intelligent platform management interface address, login user name and password of the physical machine
#The ipmi ip of the physical node#The ipmi ip of the physical node
ipmi_ip=20.251.36.116ipmi_ip=20.251.36.116
#The ipmi user of the physical node#The ipmi user of the physical node
ipmi_user=ADMINipmi_user=ADMIN
#The ipmi password of the physical node#The ipmi password of the physical node
ipmi_password=ADMINipmi_password=ADMIN
这里定义了IPMI智能平台管理接口地址、登录用户名和密码的配置项,保存到目标节点的配置项文件。The IPMI intelligent platform management interface address, login user name and password configuration items are defined here, and are saved to the configuration item file of the target node.
发送请求“关闭目标节点所有的虚拟机”:Send the request "shut down all virtual machines on the target node":
步骤4:目标节点执行关闭本机上所有虚拟机Step 4: The target node performs shutdown of all virtual machines on the machine
执行单个虚拟机的关机流程:Execute the shutdown process of a single virtual machine:
通过IPMI智能平台管理接口执行关机Perform shutdown through the IPMI intelligent platform management interface
这里判断了物理机的状态,若物理机的状态符合关机,才能执行执行关机。The state of the physical machine is judged here. If the state of the physical machine is suitable for shutdown, the shutdown can be executed.
最后,物理机远程关机完成。Finally, the remote shutdown of the physical machine is completed.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510745585.4ACN105306225B (en) | 2015-11-03 | 2015-11-03 | Openstack-based physical machine remote shutdown method |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510745585.4ACN105306225B (en) | 2015-11-03 | 2015-11-03 | Openstack-based physical machine remote shutdown method |
| Publication Number | Publication Date |
|---|---|
| CN105306225A CN105306225A (en) | 2016-02-03 |
| CN105306225Btrue CN105306225B (en) | 2018-09-07 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510745585.4AActiveCN105306225B (en) | 2015-11-03 | 2015-11-03 | Openstack-based physical machine remote shutdown method |
| Country | Link |
|---|---|
| CN (1) | CN105306225B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107179957B (en)* | 2016-03-10 | 2020-08-25 | 阿里巴巴集团控股有限公司 | Physical machine fault classification processing method and device and virtual machine recovery method and system |
| CN107018032A (en)* | 2017-06-08 | 2017-08-04 | 山东超越数控电子有限公司 | A kind of monitoring system server and method |
| CN108228315A (en)* | 2017-12-06 | 2018-06-29 | 顺丰科技有限公司 | virtual machine command line management method and device |
| CN108848155A (en)* | 2018-06-08 | 2018-11-20 | 郑州云海信息技术有限公司 | A kind of method and apparatus for the function controlling physical machine |
| CN109194732A (en)* | 2018-08-28 | 2019-01-11 | 郑州云海信息技术有限公司 | A kind of the High Availabitity dispositions method and device of OpenStack |
| US12183134B2 (en) | 2018-09-26 | 2024-12-31 | Intel Corporation | Power off and power on method and apparatus for an in-vehicle system |
| CN111078310A (en)* | 2019-11-13 | 2020-04-28 | 国云科技股份有限公司 | A method for quickly shutting down a desktop cloud server |
| CN111679862A (en)* | 2020-05-22 | 2020-09-18 | 平安普惠企业管理有限公司 | Cloud host shutdown method and device, electronic equipment and medium |
| CN111752695B (en)* | 2020-06-28 | 2024-11-05 | 北京百度网讯科技有限公司 | Offline method, device, equipment and storage medium |
| CN112783603B (en)* | 2021-01-18 | 2024-08-06 | 深圳市科思科技股份有限公司 | Cluster shutdown control method, system and storage medium |
| CN114237386A (en)* | 2021-11-29 | 2022-03-25 | 歌尔光学科技有限公司 | Control method of virtual reality device, and storage medium |
| CN115904635B (en)* | 2023-02-16 | 2023-06-06 | 江西联创精密机电有限公司 | Virtual machine management method and system based on server |
| CN116225715A (en)* | 2023-03-06 | 2023-06-06 | 深圳市瑞云科技股份有限公司 | Node machine power management method, system and electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101650666A (en)* | 2009-08-31 | 2010-02-17 | 曙光信息产业(北京)有限公司 | Computer management system and method |
| CN103092326A (en)* | 2013-01-25 | 2013-05-08 | 浪潮电子信息产业股份有限公司 | Host energy saving method based on time |
| CN103473139A (en)* | 2013-09-26 | 2013-12-25 | 四川中电启明星信息技术有限公司 | Virtual machine cluster resource allocation and scheduling method |
| CN104079434A (en)* | 2014-07-07 | 2014-10-01 | 用友软件股份有限公司 | Device and method for managing physical devices in cloud computing system |
| CN104270430A (en)* | 2014-09-19 | 2015-01-07 | 国云科技股份有限公司 | A server remote scheduling method suitable for cloud computing |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8112748B2 (en)* | 2005-09-01 | 2012-02-07 | International Business Machines Corporation | Method for operating software configured for internet access on a remote computer |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101650666A (en)* | 2009-08-31 | 2010-02-17 | 曙光信息产业(北京)有限公司 | Computer management system and method |
| CN103092326A (en)* | 2013-01-25 | 2013-05-08 | 浪潮电子信息产业股份有限公司 | Host energy saving method based on time |
| CN103473139A (en)* | 2013-09-26 | 2013-12-25 | 四川中电启明星信息技术有限公司 | Virtual machine cluster resource allocation and scheduling method |
| CN104079434A (en)* | 2014-07-07 | 2014-10-01 | 用友软件股份有限公司 | Device and method for managing physical devices in cloud computing system |
| CN104270430A (en)* | 2014-09-19 | 2015-01-07 | 国云科技股份有限公司 | A server remote scheduling method suitable for cloud computing |
| Publication number | Publication date |
|---|---|
| CN105306225A (en) | 2016-02-03 |
| Publication | Publication Date | Title |
|---|---|---|
| CN105306225B (en) | Openstack-based physical machine remote shutdown method | |
| CN104580519B (en) | A kind of method of rapid deployment openstack cloud computing platforms | |
| EP3284213B1 (en) | Managing virtual network functions | |
| US10003672B2 (en) | Apparatus, systems and methods for deployment of interactive desktop applications on distributed infrastructures | |
| CN103297504B (en) | The method of physics bare machine rapid deployment operating system in a kind of cloud data center | |
| CN106982266A (en) | A kind of method and apparatus of automatically dispose cluster | |
| CN103441867B (en) | Method for updating internal network resource allocation of virtual machine | |
| CN108089913B (en) | Virtual machine deployment method of super-fusion system | |
| US9690593B2 (en) | Server information handling system configuration from an end state definition file | |
| US10432450B2 (en) | Data plane API in a distributed computing network | |
| CN102427481A (en) | System for managing cloud computing service and cloud computing management method | |
| CN103514038B (en) | A kind of smooth method for closing and system of virtual system | |
| US8909912B2 (en) | Apparatus and method for configuring a target machine with captured operational state comprising a static machine profile and a dynamic machine state to continue operations of a source machine | |
| US10353798B1 (en) | Rapid development environment | |
| CN108984272A (en) | The control method and device of OpenStack cloud computing management platform | |
| CN104754032A (en) | Method and device for deploying OpenStack | |
| CN104572269A (en) | Quick cluster deployment method based on Linux operation system | |
| CN105426243A (en) | A method for remote maintenance of physical machines based on Openstack | |
| CN106293847A (en) | Method for supporting service of virtualization platform | |
| CN111786810A (en) | A method and system for automatic deployment of large-scale test bed nodes | |
| CN105450748A (en) | A method of physical machine remote desktop based on Openstack | |
| CN106020935A (en) | Method for running openstack component service across versions | |
| CN106557354B (en) | Method for setting attribute parameters of private image and computer equipment | |
| CN106126283A (en) | A kind of method of product allocation, Apparatus and system | |
| CN106254162B (en) | Network-based Linux system in cluster calculate node operating system recovery method |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP02 | Change in the address of a patent holder | Address after:523808 19th Floor, Cloud Computing Center, Chinese Academy of Sciences, No. 1 Kehui Road, Songshan Lake Hi-tech Industrial Development Zone, Dongguan City, Guangdong Province Patentee after:G-Cloud Technology Co., Ltd. Address before:523808 No. 14 Building, Songke Garden, Songshan Lake Science and Technology Industrial Park, Dongguan City, Guangdong Province Patentee before:G-Cloud Technology Co., Ltd. | |
| CP02 | Change in the address of a patent holder |