[go: up one dir, main page]

CN103092650B - Method and system is generated based on the virtual machine image of software pre-installation under cloud environment - Google Patents

Method and system is generated based on the virtual machine image of software pre-installation under cloud environment Download PDF

Info

Publication number
CN103092650B
CN103092650B CN201310007532.3A CN201310007532A CN103092650B CN 103092650 B CN103092650 B CN 103092650B CN 201310007532 A CN201310007532 A CN 201310007532A CN 103092650 B CN103092650 B CN 103092650B
Authority
CN
China
Prior art keywords
software
installation
virtual machine
operating system
software pre
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310007532.3A
Other languages
Chinese (zh)
Other versions
CN103092650A (en
Inventor
吴松
金海�
石宣化
余盛雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201310007532.3A priority Critical patent/CN103092650B/en
Publication of CN103092650A publication Critical patent/CN103092650A/en
Application granted granted Critical
Publication of CN103092650B publication Critical patent/CN103092650B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

本发明公开了一种云环境下基于软件预安装的虚拟机镜像生成方法,包括:接收用户的上传软件,并对上传的软件进行依赖性检查,接收并分析用户提交的操作系统配置信息,以得到操作系统配置信息分析结果,根据操作系统配置信息分析结果生成基于软件预安装技术安装操作系统所必需的基本环境,在生成的基本环境下使用虚拟机启动配置文件启动虚拟机,同时启动监控进程,在虚拟机中运行操作系统安装程序,以用非交互式的方式安装操作系统,同时监控进程判断操作系统的安装是出错还是已完成,如果出错,则关闭虚拟机,并清理基本环境中的临时文件,向IP地址池归还IP地址。本发明能够解决现有方式存在的不够灵活、速度慢、资源耗费严重等不足。

The invention discloses a virtual machine image generation method based on software pre-installation in a cloud environment, comprising: receiving uploaded software from users, performing dependency check on the uploaded software, receiving and analyzing operating system configuration information submitted by users, and Obtain the analysis results of the operating system configuration information, generate the basic environment necessary for installing the operating system based on the software pre-installation technology according to the analysis results of the operating system configuration information, use the virtual machine startup configuration file to start the virtual machine in the generated basic environment, and start the monitoring process at the same time , run the operating system installation program in the virtual machine to install the operating system in a non-interactive manner, and monitor the process to determine whether the installation of the operating system has an error or has been completed. If an error occurs, shut down the virtual machine and clean up the basic environment. Temporary file, returns the IP address to the IP address pool. The invention can solve the deficiencies of the existing methods such as inflexibility, slow speed, serious resource consumption and the like.

Description

云环境下基于软件预安装的虚拟机镜像生成方法和系统Method and system for generating virtual machine image based on software pre-installation in cloud environment

技术领域technical field

本发明属于云计算领域,更具体地,涉及一种云环境下基于软件预安装的虚拟机镜像生成方法和系统。The invention belongs to the field of cloud computing, and more specifically relates to a method and system for generating a virtual machine image based on software pre-installation in a cloud environment.

背景技术Background technique

随着云计算的发展,云计算上应用也越来越多样化,而这些应用都有赖于虚拟机磁盘镜像对软件的封装。由于用户的需求的千差万别,为满足用户的需求,虚拟机镜像的定制化服务成为各个云计算平台不可或缺的组成部分。With the development of cloud computing, cloud computing applications are becoming more and more diverse, and these applications all depend on the encapsulation of software by virtual machine disk images. Due to the vastly different needs of users, in order to meet the needs of users, the customized service of virtual machine image has become an indispensable part of each cloud computing platform.

现有的虚拟机镜像定制基本可以分为两大类:The existing virtual machine image customization can basically be divided into two categories:

修改现有模板:这种办法是选择一个云平台上原有的虚拟机镜像来启动一台虚拟机,用户登录虚拟机后,在虚拟机上做安装软件,删除软件或修改配置等操作,之后将关掉这台虚拟机,并将它的磁盘镜像保存为虚拟机云平台新的虚拟机镜像;Modify the existing template: This method is to select an original virtual machine image on the cloud platform to start a virtual machine. After the user logs in to the virtual machine, he installs software on the virtual machine, deletes the software, or modifies the configuration. Turn off this virtual machine, and save its disk image as a new virtual machine image on the virtual machine cloud platform;

操作系统定制:用户在浏览器前选择需要安装系统的版本,选择所需要安装的软件,输入分区信息和用户信息等,之后启动虚拟机安装操作系统,安装完毕之后将虚拟机镜像保存为云平台的虚拟机镜像。Operating system customization: the user selects the version of the system to be installed in front of the browser, selects the software to be installed, enters the partition information and user information, etc., and then starts the virtual machine to install the operating system. After the installation is complete, the virtual machine image is saved as a cloud platform virtual machine image.

这两种方式各有优劣:第一种定制方法的特点是方便做少量的修改,时间开销比较小,但这种方式有着无法克服的缺点,即无法满足更专业的软件定制化需求,这一点在虚拟设备(VirtualAppliance)等对镜像定制化要求较高的领域体现得愈加明显,比如无法调整磁盘大小和分区,无法保证现有虚拟机镜像是干净的(没有不安全的内容),且一般这种方式是用增量镜像来保存修改后的镜像模板,会很大程度上降低I/O性能;第二种方式的优点则在可以做到彻底的定制,包括要安装哪些软件,磁盘大小多少,分区如何,是否需要图形化界面等,缺点是从头安装操作系统需要耗费大量的时间,降低了虚拟机镜像定制服务的用户体验。因此,业界还需要一种既可以做到完全定制化,时间开销也较小的虚拟机镜像生成方案。These two methods have their own advantages and disadvantages: the first customization method is characterized by the convenience of doing a small amount of modification, and the time cost is relatively small, but this method has an insurmountable disadvantage, that is, it cannot meet the needs of more professional software customization, which means This point is more obvious in areas such as virtual appliance (Virtual Appliance) that require high image customization. For example, the disk size and partition cannot be adjusted, and the existing virtual machine image cannot be guaranteed to be clean (no unsafe content). This method uses incremental mirroring to save the modified image template, which will greatly reduce I/O performance; the advantage of the second method is that it can be completely customized, including which software to install and disk size How many, what partitions, whether a graphical interface is required, etc. The disadvantage is that it takes a lot of time to install the operating system from scratch, which reduces the user experience of the virtual machine image customization service. Therefore, the industry also needs a virtual machine image generation solution that can be fully customized and has less time overhead.

第二种方式定制虚拟机镜像的速度比较慢主要原因是在安装操作系统的时候,需要从头安装虚拟机镜像里的软件。常用的操作系统安装程序(如RedHat系列的Anaconda),都是针对于物理环境下设计的,它可以做到交互式安装和自动安装,由于硬件之间可能的差异,每次安装都是从头再来的,没有考虑到多次安装过程中重复部分,但顾及到操作系统安装程序的普适性,这种做法在物理环境是比较合理的。The main reason for the slow speed of customizing the virtual machine image in the second way is that the software in the virtual machine image needs to be installed from scratch when the operating system is installed. Commonly used operating system installation programs (such as Anaconda of the RedHat series) are designed for physical environments. It can be installed interactively and automatically. Due to possible differences between hardware, each installation starts from scratch. Yes, it does not take into account the repeated parts during multiple installations, but considering the universality of the operating system installation program, this approach is more reasonable in the physical environment.

但在云环境下,基于虚拟化的云计算平台则不需要考虑硬件的差异,且云计算平台上的虚拟机镜像中的软件具有很大的共同性。正常情况下安装操作系统最花费时间的部分便是安装软件包,每次都定制虚拟机镜像都需要重新来安装一遍这些重复的软件,无疑既浪费了时间,也浪费了宝贵的硬件资源。虽然修改现有模板的方式本质上也是避免重复安装软件,但这种方式无法克服以上所说的固有缺点;而对于操作系统定制的方式,还缺乏有效的手段来提高镜像的生成速度。However, in the cloud environment, the virtualization-based cloud computing platform does not need to consider hardware differences, and the software in the virtual machine image on the cloud computing platform has a lot in common. Under normal circumstances, the most time-consuming part of installing an operating system is installing software packages. Every time you customize a virtual machine image, you need to re-install these repeated software, which undoubtedly wastes time and precious hardware resources. Although the method of modifying the existing template is essentially to avoid repeated software installation, this method cannot overcome the inherent shortcomings mentioned above; and for the method of operating system customization, there is still no effective means to improve the image generation speed.

发明内容Contents of the invention

针对现有技术的缺陷,本发明的目的在于提供一种云环境下基于软件预安装的虚拟机镜像生成方法和系统,其针对云环境下的特点,并旨在解决现有虚拟机镜像定制系统生成镜像的方式存在的不够灵活、速度慢、资源耗费严重等不足。Aiming at the defects of the prior art, the object of the present invention is to provide a virtual machine image generation method and system based on software pre-installation in the cloud environment, which is aimed at the characteristics of the cloud environment and aims to solve the problem of the existing virtual machine image customization system There are deficiencies in the way of generating images, such as inflexibility, slow speed, and serious resource consumption.

为实现上述目的,本发明提供了一种云环境下基于软件预安装的虚拟机镜像生成方法,包括以下步骤:In order to achieve the above object, the present invention provides a virtual machine image generation method based on software pre-installation in a cloud environment, comprising the following steps:

(1)接收用户的上传软件,并对上传的软件进行依赖性检查;(1) Receive the user's uploaded software and check the dependencies of the uploaded software;

(2)接收并分析用户提交的操作系统配置信息,以得到操作系统配置信息分析结果;(2) Receive and analyze the operating system configuration information submitted by the user to obtain the analysis results of the operating system configuration information;

(3)根据操作系统配置信息分析结果生成基于软件预安装技术安装操作系统所必需的基本环境;(3) Generate the basic environment necessary to install the operating system based on the software pre-installation technology based on the analysis results of the operating system configuration information;

(4)在步骤(3)生成的基本环境下使用虚拟机启动配置文件启动虚拟机,同时启动监控进程;(4) Use the virtual machine startup configuration file to start the virtual machine in the basic environment generated in step (3), and start the monitoring process at the same time;

(5)在虚拟机中运行操作系统安装程序,以用非交互式的方式安装操作系统,同时监控进程判断操作系统的安装是出错还是已完成,如果出错,则关闭虚拟机,并转入步骤(7),如果已完成,则关闭虚拟机,并转入步骤(6);(5) Run the operating system installation program in the virtual machine to install the operating system in a non-interactive manner. At the same time, the monitoring process determines whether the installation of the operating system is wrong or completed. If there is an error, shut down the virtual machine and go to the step (7), if completed, shut down the virtual machine and go to step (6);

(6)判断在操作系统安装过程中是否生成了软件预安装包,如果生成则在软件预安装包库中注册该软件预安装包,然后进入步骤(7),否则直接进入步骤(7);(6) Determine whether a software pre-installation package has been generated during the operating system installation process, if it is generated, register the software pre-installation package in the software pre-installation package library, and then enter step (7), otherwise directly enter step (7);

(7)清理基本环境中的临时文件,向IP地址池归还IP地址,并向用户报告安装结果。(7) Clean up the temporary files in the basic environment, return the IP address to the IP address pool, and report the installation result to the user.

步骤(1)具体为,对软件依赖性的分析是通过查询软件源的数据库文件来解决,如果依赖性没得到满足,则提示用户上传的软件没能满足依赖关系的原因,还需上传哪些软件包才能满足软件依赖关系,重复(1)步骤,直到软件的依赖关系得到满足为止。Step (1) specifically, the analysis of software dependencies is solved by querying the database files of software sources. If the dependencies are not satisfied, the user is prompted to upload the software that fails to meet the reasons for the dependencies, and which software needs to be uploaded. The package can satisfy the software dependency, repeat (1) step until the software dependency is satisfied.

临时文件包括软件预安装包的副本、启动光盘以及虚拟机启动配置文件。Temporary files include copies of software pre-installation packages, boot CDs, and virtual machine startup configuration files.

步骤(2)包括以下子步骤:Step (2) includes the following sub-steps:

(2-1)从用户提交的操作系统配置信息中提取将要安装的软件,通过依赖关系分析得到完整的软件列表;(2-1) Extract the software to be installed from the operating system configuration information submitted by the user, and obtain a complete software list through dependency analysis;

(2-2)使用完整的软件列表去软件预安装包库中查找一个符合最大匹配原则的软件预安装包,以得到软件预安装包匹配结果;其中,软件预安装包匹配结果包括是否找到匹配的软件预安装包、匹配程度和匹配的软件预安装包编号,最大匹配原则指作为最终的查询结果的软件预安装包中的软件集是拿去查询的完整的软件列表中的软件集合的最大子集,匹配程度包括完全匹配、包含和不匹配;(2-2) Use the complete software list to find a software pre-installation package that meets the principle of maximum matching in the software pre-installation package library to obtain the matching result of the software pre-installation package; where the matching result of the software pre-installation package includes whether a match is found The software pre-installation package, matching degree and matching software pre-installation package number, the maximum matching principle means that the software set in the software pre-installation package as the final query result is the largest software set in the complete software list for query Subsets, the matching degree includes exact match, inclusion and no match;

(2-3)从用户提交的操作系统配置信息中判断用户是否要求在生成虚拟机镜像的过程中生成软件预安装包,若用户要求,且(2-1)中得到的匹配程度是包含或者不匹配,则表示需要生成软件预安装包的判断结果为是,否则表示不需要生成软件预安装包。(2-3) Judging from the operating system configuration information submitted by the user whether the user requests to generate a software pre-installation package during the process of generating the virtual machine image, if the user requests, and the matching degree obtained in (2-1) contains or If it does not match, it means that the judgment result of generating a software pre-installation package is yes; otherwise, it means that a software pre-installation package does not need to be generated.

步骤(3)包括以下子步骤:Step (3) includes the following sub-steps:

(3-1)根据操作系统配置信息的分析结果,生成与软件预安装包相关的基本环境;(3-1) According to the analysis results of the operating system configuration information, generate the basic environment related to the software pre-installation package;

(3-2)生成启动虚拟机所需的基本环境;(3-2) Generate the basic environment required to start the virtual machine;

步骤(3-1)具体为,若步骤(2)中软件预安装包匹配结果指示找到匹配的软件预安装包,则在匹配的软件预安装包上建立一个QCOW2格式的增量镜像作为软件预安装包副本,并把剩余要安装软件的软件列表放置到其中;若用户需要生成软件预安装包,且步骤(2)中软件预安装包匹配结果指示没有找到完全匹配的软件预安装包,则新建一个QCOW2格式的虚拟磁盘,并在该虚拟磁盘里面放置好标识文件以表示这是一个将要用来放置软件预安装包的虚拟磁盘。Step (3-1) is specifically, if the matching result of the software pre-installation package in step (2) indicates that a matching software pre-installation package is found, then create an incremental image in QCOW2 format on the matched software pre-installation package as the software pre-installation package. The copy of the installation package, and put the remaining software list of the software to be installed in it; if the user needs to generate a software pre-installation package, and the matching result of the software pre-installation package in step (2) indicates that no exact matching software pre-installation package was found, then Create a new virtual disk in QCOW2 format, and place an identification file in the virtual disk to indicate that this is a virtual disk that will be used to place the software pre-installation package.

步骤(3-2)具体为,从IP地址池获取IP地址,生成用于装载最终目标根文件系统的目标磁盘镜像,生成包含有依据用户提交的配置信息而生成的软件安装程序配置文件的启动光盘和虚拟机启动配置文件;其中虚拟机启动配置文件的硬盘项除了目标磁盘镜像外,还应有(3-1)中生成的磁盘镜像,以便在启动虚拟机时加载进去。Step (3-2) is specifically to obtain an IP address from the IP address pool, generate a target disk image for loading the final target root file system, and generate a startup program containing a software installation program configuration file generated based on the configuration information submitted by the user. CD and virtual machine startup configuration file; the hard disk item of the virtual machine startup configuration file should include the disk image generated in (3-1) in addition to the target disk image, so that it can be loaded when starting the virtual machine.

步骤(5)包含以下子步骤:Step (5) contains the following sub-steps:

(5-1)在安装软件之前,按照正常的流程安装操作系统,包括格式化目的虚拟机磁盘等,安装过程中若出现错误,则转入步骤(5-8);(5-1) Before installing the software, install the operating system according to the normal process, including formatting the target virtual machine disk, etc. If there is an error during the installation process, go to step (5-8);

(5-2)判断是否加载了软件预安装包,如果加载了软件预安装包,则转到步骤(5-3),否则转到步骤(5-4),若过程中出现错误,则转到步骤(5-8);(5-2) Determine whether the software pre-installation package is loaded. If the software pre-installation package is loaded, go to step (5-3), otherwise go to step (5-4). If an error occurs during the process, go to to step (5-8);

(5-3)将软件预安装包的根文件系统拷贝到刚格式化的目标虚拟磁盘中去,读取软件预安装包中剩余待安装软件列表,安装其中的软件包到目的虚拟机磁盘中,若过程中出现错误,则转入步骤(5-8);(5-3) Copy the root file system of the software pre-installation package to the newly formatted target virtual disk, read the list of remaining software to be installed in the software pre-installation package, and install the software packages in the target virtual machine disk , if an error occurs during the process, go to step (5-8);

(5-4)提取操作系统安装程序配置文件中的软件列表,通过依赖性分析得到完整的待安装软件包列表,依次安装其中的每一个软件包到目的虚拟机磁盘中,若过程中出现错误,则转入步骤(5-8);(5-4) Extract the software list in the configuration file of the operating system installer, obtain a complete list of software packages to be installed through dependency analysis, and install each of the software packages to the target virtual machine disk in turn. If an error occurs during the process , then go to step (5-8);

(5-5)判断虚拟机是否加载了带有空软件预安装包标识的虚拟机磁盘,若加载了,则转到步骤(5-6),否则直接转到步骤(5-7);若过程中出现错误,则转入步骤(5-8);(5-5) Determine whether the virtual machine is loaded with a virtual machine disk with an empty software pre-installation package identifier, if it is loaded, go to step (5-6), otherwise go directly to step (5-7); if If an error occurs during the process, go to step (5-8);

(5-6)将安装好了软件包的目标虚拟机磁盘中的根文件系统拷贝到空的虚拟机磁盘中,并去掉空软件预安装包标识,过程中若出现错误,则转入步骤(5-8);(5-6) Copy the root file system in the target virtual machine disk with the software package installed to an empty virtual machine disk, and remove the empty software pre-installation package logo. If an error occurs during the process, go to step ( 5-8);

(5-7)按正常流程在目的虚拟机磁盘中执行下面的操作系统安装过程,包括选择语言、时区,配置防火墙和安装GRUB,若安装过程中出现错误,则转到步骤(5-8),若未出现错误,则转到步骤(5-9);(5-7) Perform the following operating system installation process on the target virtual machine disk according to the normal process, including selecting language, time zone, configuring firewall and installing GRUB. If an error occurs during the installation process, go to step (5-8) , if no error occurs, go to step (5-9);

(5-8)向监控进程报告安装出错,并转到步骤(5-10);(5-8) Report an installation error to the monitoring process and go to step (5-10);

(5-9)向监控进程报告安装完成,过程结束;(5-9) Report to the monitoring process that the installation is complete and the process ends;

(5-10)终止操作系统安装过程。(5-10) Terminate the operating system installation process.

一种云环境下基于软件预安装的虚拟机镜像生成系统,包括软件上传模块、操作系统配置信息分析模块、基本环境生成模块、虚拟机启动模块、操作系统安装和安装监控模块、软件预安装包注册模块和环境清理模块,软件上传模块用于接收用户的上传软件,并对上传的软件进行依赖性检查,操作系统配置信息分析模块用于接收并分析用户提交的操作系统配置信息,以得到操作系统配置信息分析结果,基本环境生成模块用于根据操作系统配置信息分析结果生成基于软件预安装技术安装操作系统所必需的基本环境,虚拟机启动模块用于在基本环境生成模块生成的基本环境下使用虚拟机启动配置文件启动虚拟机,同时启动监控进程,操作系统安装和安装监控模块用于在虚拟机中运行操作系统安装程序,以用非交互式的方式安装操作系统,同时监控进程判断操作系统的安装是出错还是已完成,如果出错,则关闭虚拟机,并转入环境清理模块,如果已完成,则关闭虚拟机,并转入软件预安装包注册模块,软件预安装包注册模块用于判断在操作系统安装过程中是否生成了软件预安装包,如果生成则在软件预安装包库中注册该软件预安装包,然后进入环境清理模块,否则直接进入环境清理模块,环境清理模块用于清理基本环境中的临时文件,向IP地址池归还IP地址,并向用户报告安装结果。A virtual machine image generation system based on software pre-installation in a cloud environment, including a software upload module, an operating system configuration information analysis module, a basic environment generation module, a virtual machine startup module, an operating system installation and installation monitoring module, and a software pre-installation package The registration module and the environment cleaning module, the software upload module is used to receive the user's uploaded software and check the dependencies of the uploaded software, and the operating system configuration information analysis module is used to receive and analyze the operating system configuration information submitted by the user to obtain the operation The system configuration information analysis result, the basic environment generation module is used to generate the basic environment necessary for installing the operating system based on the software pre-installation technology according to the operating system configuration information analysis result, and the virtual machine startup module is used to generate in the basic environment generated by the basic environment generation module Use the virtual machine startup configuration file to start the virtual machine, and start the monitoring process at the same time. The operating system installation and installation monitoring module is used to run the operating system installation program in the virtual machine to install the operating system in a non-interactive manner, and monitor the process to determine the operation. Whether the installation of the system has gone wrong or has been completed, if a mistake is made, then close the virtual machine and transfer to the environment cleaning module, if it has been completed, then close the virtual machine and transfer to the software pre-installation package registration module It is used to judge whether a software pre-installation package is generated during the operating system installation process. If it is generated, the software pre-installation package is registered in the software pre-installation package library, and then enters the environment cleaning module, otherwise it directly enters the environment cleaning module. The environment cleaning module uses It is used to clean up temporary files in the basic environment, return IP addresses to the IP address pool, and report the installation results to users.

操作系统配置信息分析模块包括软件列表生成子模块、软件预安装包匹配子模块以及软件预安装包生成判断子模块,软件列表生成子模块用于从用户提交的操作系统配置信息中提取将要安装的软件,通过依赖关系分析得到完整的软件列表,软件预安装包匹配子模块用于使用完整的软件列表去软件预安装包库中查找一个符合最大匹配原则的软件预安装包,以得到软件预安装包匹配结果,软件预安装包生成判断子模块用于从用户提交的操作系统配置信息中判断用户是否要求在生成虚拟机镜像的过程中生成软件预安装包,若用户要求,且软件列表生成子模块中得到的匹配程度是包含或者不匹配,则表示需要生成软件预安装包的判断结果为是,否则表示不需要生成软件预安装包,基本环境生成模块包括软件预安装包基本环境生成子模块和虚拟机启动基本环境生成子模块,软件预安装包基本环境生成子模块用于根据操作系统配置信息的分析结果,生成与软件预安装包相关的基本环境,虚拟机启动基本环境生成模块用于生成启动虚拟机所需的基本环境。The operating system configuration information analysis module includes a software list generation sub-module, a software pre-installation package matching sub-module, and a software pre-installation package generation judgment sub-module. The software list generation sub-module is used to extract the operating system configuration information submitted by the user to be installed Software, through dependency analysis to obtain a complete software list, the software pre-installation package matching sub-module is used to use the complete software list to search for a software pre-installation package that meets the principle of maximum matching in the software pre-installation package library, so as to obtain the software pre-installation The package matching result, the software pre-installation package generation judgment sub-module is used to judge from the operating system configuration information submitted by the user whether the user requires the software pre-installation package to be generated during the process of generating the virtual machine image, if the user requires it, and the software list generation sub-module If the matching degree obtained in the module is included or not matched, it means that the judgment result of the need to generate the software pre-installation package is yes, otherwise it means that the software pre-installation package does not need to be generated. The basic environment generation module includes the software pre-installation package basic environment generation sub-module and the virtual machine startup basic environment generation submodule, the software preinstallation package basic environment generation submodule is used to generate the basic environment related to the software preinstallation package according to the analysis results of the operating system configuration information, and the virtual machine startup basic environment generation module is used for Generate the basic environment needed to start the virtual machine.

操作系统安装模块包括软件安装前执行子模块、软件预安装包加载判别子模块、基于软件预安装包技术的软件安装子模块、正常软件安装子模块、空软件预安装包磁盘镜像加载判别子模块、软件预安装包生成子模块、软件安装后执行子模块、错误处理子模块、安装完毕处理子模块以及操作系统安装终止子模块,软件安装前执行子模块用于完成软件安装开始之前阶段的工作,包括格式化虚拟机本身虚拟磁盘等,即按正常的流程完成操作系统安装程序软件安装开始前的各部分工作;若安装出现错误,则转入错误处理子模块,软件预安装包加载判别子模块用于判别虚拟机是否加载了软件预安装包,如果加载了软件预安装包,则转到软件安装子模块,否则转到正常软件安装子模块,若过程中出现错误,则转到错误处理子模块,基于软件预安装包技术的软件安装子模块用于将软件预安装包的根文件系统拷贝到刚格式化的目标虚拟磁盘中去,读取软件预安装包中剩余待安装软件列表,安装其中的软件包到目的虚拟机磁盘中,若过程中出现错误,则转入错误处理子模块,正常软件安装子模块用于提取操作系统安装程序配置文件中的软件列表,通过依赖性分析得到完整的待安装软件包列表,依次安装其中的每一个软件包到目的虚拟机磁盘中,若过程中出现错误,则转入错误处理子模块,空软件预安装包磁盘镜像加载判别子模块用于判断虚拟机是否加载了带有空软件预安装包标识的虚拟磁盘;若加载了,则转到软件预安装包生成子模块,否则直接转到软件安装后执行子模块;若过程中出现错误,则转入错误处理子模块,软件预安装包生成子模块用于将安装好了软件包的目标虚拟机磁盘中的根文件系统拷贝到空的虚拟机磁盘中,并去掉空软件预安装包标识,过程中若出现错误,则转入错误处理子模块,软件安装后执行子模块用于执行软件包安装完毕之后的操作系统安装步骤,包括选择语言、时区,配置防火墙和安装多重启动管理器;若过程中出现错误,则转入错误处理子模块,若未出现错误,则转入安装完成处理子模块,错误处理子模块用于向监控进程报告安装出错,并转到终止操作系统安装子模块,安装完成处理子模块用于向监控进程报告安装完成,过程结束,终止操作系统安装子模块用于终止操作系统安装。The operating system installation module includes a pre-software execution sub-module, a software pre-installation package loading identification sub-module, a software installation sub-module based on software pre-installation package technology, a normal software installation sub-module, and an empty software pre-installation package disk image loading identification sub-module , software pre-installation package generation sub-module, software installation execution sub-module, error handling sub-module, installation completion processing sub-module, and operating system installation termination sub-module, and the pre-software installation execution sub-module is used to complete the work before the software installation starts , including formatting the virtual disk of the virtual machine itself, that is, to complete the various parts of the operating system installation program before the software installation starts according to the normal process; The module is used to judge whether the virtual machine has loaded the software pre-installation package. If the software pre-installation package is loaded, it will go to the software installation sub-module, otherwise it will go to the normal software installation sub-module. If an error occurs during the process, it will go to the error handling Sub-module, the software installation sub-module based on the software pre-installation package technology is used to copy the root file system of the software pre-installation package to the newly formatted target virtual disk, read the list of remaining software to be installed in the software pre-installation package, Install the software package in it to the target virtual machine disk. If an error occurs during the process, it will be transferred to the error handling sub-module. The normal software installation sub-module is used to extract the software list in the operating system installer configuration file, which is obtained through dependency analysis. A complete list of software packages to be installed, and install each of them to the target virtual machine disk in turn. If an error occurs during the process, it will be transferred to the error handling submodule. The empty software pre-installation package disk image loading identification submodule is used Determine whether the virtual machine is loaded with a virtual disk with an empty software pre-installation package identifier; if it is loaded, go to the software pre-installation package to generate the sub-module, otherwise go directly to the sub-module after the software is installed; if an error occurs during the process, Then transfer to the error handling submodule, the software preinstallation package generation submodule is used to copy the root file system in the target virtual machine disk with the software package installed to the empty virtual machine disk, and remove the empty software preinstallation package identification , if an error occurs during the process, it will be transferred to the error handling submodule, and the execution submodule after software installation is used to execute the operating system installation steps after the software package is installed, including selecting language, time zone, configuring firewall and installing a multi-boot manager; If there is an error in the process, then transfer to the error handling submodule, if no error occurs, then transfer to the installation completion processing submodule, the error handling submodule is used to report installation errors to the monitoring process, and go to the termination operating system installation submodule , the installation completion processing submodule is used to report the installation completion to the monitoring process, and the process ends, the termination operating system installation submodule is used to terminate the installation of the operating system.

通过本发明所构思的以上技术方案,与现有技术相比,本发明具有以下的有益效果:Through the above technical solutions conceived by the present invention, compared with the prior art, the present invention has the following beneficial effects:

(1)提高了虚拟机镜像的生成速度。本发明通过修改操作系统安装程序,使安装程序能够使用加载到虚拟机中的软件预安装包,并在软件预安装包的基础之上安装剩余的软件,从而可以避免软件的重复安装过程,节省安装软件带来的时间开销。(1) Increased the generation speed of the virtual machine image. By modifying the installation program of the operating system, the present invention enables the installation program to use the software pre-installation package loaded into the virtual machine, and installs the remaining software on the basis of the software pre-installation package, thereby avoiding repeated software installation processes and saving The time overhead of installing software.

(2)用户可以根据自己的需求定制软件预安装包。本发明系统不仅可以预先准备了多个用户常用的软件预安装包,还允许用户根据自己的需求定制软件预安装包。由于这种软件预安装包是用户自己定制的,里面的软件集往往可以更好地匹配用户将要安装的软件集,从而可以进一步提高镜像的生成速度。此外用户还可以把自己的软件预安装包发布到虚拟机镜像定制平台中,供平台所有的用户使用,这样就可增加软件预安装包的来源,以应对各种不同的需求。(2) Users can customize the software pre-installation package according to their own needs. The system of the present invention not only prepares a plurality of software pre-installation packages commonly used by users in advance, but also allows users to customize the software pre-installation packages according to their own needs. Since this kind of software pre-installation package is customized by the user, the software set inside can often better match the software set to be installed by the user, thereby further improving the image generation speed. In addition, users can also publish their own software pre-installation packages to the virtual machine image customization platform for use by all users of the platform. In this way, the sources of software pre-installation packages can be increased to meet various needs.

附图说明Description of drawings

图1是本发明云环境下基于软件预安装的虚拟机镜像生成方法的应用环境图。FIG. 1 is an application environment diagram of a method for generating a virtual machine image based on software pre-installation in a cloud environment of the present invention.

图2是本发明云环境下基于软件预安装的虚拟机镜像生成方法的流程图。FIG. 2 is a flow chart of a method for generating a virtual machine image based on software pre-installation in a cloud environment of the present invention.

图3是本发明方法中步骤(2)的细化流程图。Fig. 3 is a detailed flowchart of step (2) in the method of the present invention.

图4是本发明方法中步骤(3)的细化流程图。Fig. 4 is a detailed flowchart of step (3) in the method of the present invention.

图5是本发明方法中步骤(5)的细化流程图。Fig. 5 is a detailed flowchart of step (5) in the method of the present invention.

图6是本发明软件预安装包匹配子模块采用的匹配算法的流程图。Fig. 6 is a flow chart of the matching algorithm adopted by the software pre-installation package matching sub-module of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

如图1所示,本发明通过Web前端与用户交互,用户通过浏览器上传软件和提交操作系统安装配置信息;后台对操作系统安装配置信息进行分析后,依据分析结果生成基于软件预安装操作系统所需要的基本环境;然后启动虚拟机非交互式地安装操作系统,在启动的虚拟机中运行修改过的操作系统安装程序,使操作系统安装程序能够基于软件预安装包安装操作系统和生成新的软件预安装包,还能对外报告安装进展;同时启动监控进程监控虚拟机内部的操作系统安装情况,当出错或者完成后,清除现场,注册新的软件预安装包,并将镜像生成结果返回给用户。As shown in Figure 1, the present invention interacts with the user through the Web front end, and the user uploads the software and submits the operating system installation configuration information through the browser; after the background analyzes the operating system installation configuration information, it generates a software-based pre-installed operating system The basic environment required; then start the virtual machine to install the operating system non-interactively, run the modified operating system installer in the started virtual machine, so that the operating system installer can install the operating system based on the software pre-installation package and generate a new The software pre-installation package can also report the installation progress to the outside world; at the same time, start the monitoring process to monitor the installation of the operating system inside the virtual machine. When an error occurs or is completed, the site will be cleared, a new software pre-installation package will be registered, and the image generation result will be returned. to the user.

如图2所示,本发明云环境下基于软件预安装的虚拟机镜像生成方法包括以下步骤:As shown in Figure 2, the virtual machine image generation method based on software pre-installation under the cloud environment of the present invention comprises the following steps:

(1)接收用户的上传软件,并对上传的软件进行依赖性检查;具体而言,对软件依赖性的分析是通过查询软件源的数据库文件来解决,如果依赖性没得到满足,则提示用户上传的软件没能满足依赖关系的原因,还需上传哪些软件包才能满足软件依赖关系,重复(1)步骤,直到软件的依赖关系得到满足为止;(1) Receive the software uploaded by the user, and check the dependencies of the uploaded software; specifically, the analysis of software dependencies is solved by querying the database files of the software source, and if the dependencies are not satisfied, the user is prompted The reason why the uploaded software fails to satisfy the dependency relationship, which software packages need to be uploaded to satisfy the software dependency relationship, repeat step (1) until the software dependency relationship is satisfied;

(2)接收并分析用户提交的操作系统配置信息,以得到操作系统配置信息分析结果;具体而言,操作系统配置信息是用户通过Web浏览器提交的,包括磁盘大小和分区、时区和语言选择、软件列表和是否要在在制作虚拟机镜像的过程中生成软件预安装包;对操作系统配置信息的分析包括在软件预安装包库中查找符合最大匹配原则的软件预安装包和判断否要在后续步骤中生成软件预安装包,其中软件预安装包库是一个用于记录每个软件预安装包的数据库;操作系统配置信息分析结果包括软件预安装包匹配结果(包括有是否找到匹配的软件预安装包、匹配程度和匹配的软件预安装包编号)和是否要生成软件预安装包的判断结果;在这一步,选出一个最佳匹配软件预安装包是为了让达到节省最多操作系统安装时间的目的,同时通过允许用户生成新的软件预安装包,平台就被赋予了自定义软件预安装包的功能,这样就能更好的满足需求,更多的减小安装操作系统的时间开销;(2) Receive and analyze the operating system configuration information submitted by the user to obtain the analysis results of the operating system configuration information; specifically, the operating system configuration information is submitted by the user through a web browser, including disk size and partition, time zone and language selection , software list and whether to generate a software pre-installation package during the process of making a virtual machine image; the analysis of the operating system configuration information includes searching for the software pre-installation package that meets the principle of maximum matching in the software pre-installation package library and judging whether to In the subsequent steps, the software pre-installation package is generated, wherein the software pre-installation package library is a database for recording each software pre-installation package; the analysis result of the operating system configuration information includes the matching result of the software pre-installation package (including whether a matching Software pre-installation package, matching degree and matching software pre-installation package number) and the judgment result of whether to generate a software pre-installation package; in this step, the purpose of selecting the best matching software pre-installation package is to save the most operating system The purpose of installation time, and by allowing users to generate new software pre-installation packages, the platform is given the function of custom software pre-installation packages, so that it can better meet the needs and reduce the time for installing the operating system. overhead;

(3)根据操作系统配置信息分析结果生成基于软件预安装技术安装操作系统所必需的基本环境;具体而言,首先依据软件预安装包匹配结果生成(2)中所查找的软件预安装包的副本,依据是否要生成软件预安装包的判断结果生成用来装载软件预安装包的空虚拟机磁盘镜像,然后从IP地址池获取IP地址,生成用于装载最终目标根文件系统的目的磁盘镜像,最后生成包含操作系统安装程序配置文件的启动光盘,以及虚拟机启动配置文件,其中,操作系统安装程序配置文件是依据用户提交的操作系统配置信息生成的,虚拟机启动配置文件的磁盘项包含了上面生成的虚拟磁盘;(3) Generate the basic environment necessary to install the operating system based on the software pre-installation technology based on the analysis results of the operating system configuration information; specifically, first generate the software pre-installation package found in (2) based on the matching results of the software pre-installation package Copy, generate an empty virtual machine disk image for loading the software pre-installation package according to the judgment result of whether to generate the software pre-installation package, and then obtain the IP address from the IP address pool to generate the destination disk image for loading the final target root file system , and finally generate a boot CD containing the operating system installer configuration file and a virtual machine startup configuration file, wherein the operating system installer configuration file is generated based on the operating system configuration information submitted by the user, and the disk item of the virtual machine startup configuration file includes The virtual disk generated above;

(4)在步骤(3)生成的基本环境下使用虚拟机启动配置文件启动虚拟机,同时启动监控进程;其中监控进程用于监控虚拟机中操作系统的安装情况;(4) Use the virtual machine startup configuration file to start the virtual machine in the basic environment generated in step (3), and start the monitoring process at the same time; the monitoring process is used to monitor the installation of the operating system in the virtual machine;

(5)在虚拟机中运行操作系统安装程序,以用非交互式的方式安装操作系统,同时监控进程判断操作系统的安装是出错还是已完成,如果出错,则关闭虚拟机,并转入步骤(7),如果已完成,则关闭虚拟机,并转入步骤(6);具体而言,在虚拟机中运行的是经过修改的操作系统安装程序,其能够支持基于软件预安装操作系统和生成软件预安装包,同时能够在安装操作系统的过程中跟外面的监控进程交互,报告虚拟机中的操作系统安装到哪一步,安装是否完成,以及安装是否出错;在这一步,如果虚拟机加载了软件预安装包,将直接将预安装包里已安装的软件拷贝到目标虚拟磁盘中去,从而节省了下载和安装这些软件包的时间;(5) Run the operating system installation program in the virtual machine to install the operating system in a non-interactive manner. At the same time, the monitoring process determines whether the installation of the operating system is wrong or completed. If there is an error, shut down the virtual machine and go to the step (7), if it has been completed, shut down the virtual machine, and turn to step (6); specifically, what is running in the virtual machine is a modified operating system installation program, which can support software-based pre-installation of the operating system and Generate a software pre-installation package, and at the same time be able to interact with the external monitoring process during the installation of the operating system, and report the step where the operating system in the virtual machine is installed, whether the installation is complete, and whether there is an error in the installation; at this step, if the virtual machine If the software pre-installation package is loaded, the installed software in the pre-installation package will be directly copied to the target virtual disk, thus saving the time for downloading and installing these software packages;

(6)判断在操作系统安装过程中是否生成了软件预安装包,如果生成则在软件预安装包库中注册该软件预安装包,然后进入步骤(7),否则直接进入步骤(7);(6) Determine whether a software pre-installation package has been generated during the operating system installation process, if it is generated, register the software pre-installation package in the software pre-installation package library, and then enter step (7), otherwise directly enter step (7);

(7)清理基本环境中的临时文件,向IP地址池归还IP地址,并向用户报告安装结果;其中临时文件包括软件预安装包的副本、启动光盘以及虚拟机启动配置文件。(7) Clean up the temporary files in the basic environment, return the IP address to the IP address pool, and report the installation result to the user; the temporary files include the copy of the software pre-installation package, the boot CD, and the virtual machine startup configuration file.

如图3所示,本发明步骤(2)包括以下子步骤:As shown in Figure 3, step (2) of the present invention includes the following sub-steps:

(2-1)从用户提交的操作系统配置信息中提取将要安装的软件,通过依赖关系分析得到完整的软件列表;(2-1) Extract the software to be installed from the operating system configuration information submitted by the user, and obtain a complete software list through dependency analysis;

(2-2)使用完整的软件列表去软件预安装包库中查找一个符合最大匹配原则的软件预安装包,以得到软件预安装包匹配结果;其中,软件预安装包匹配结果包括是否找到匹配的软件预安装包、匹配程度和匹配的软件预安装包编号;最大匹配原则指作为最终的查询结果的软件预安装包中的软件集是拿去查询的完整的软件列表中的软件集合的最大子集;匹配程度包括完全匹配、包含和不匹配,完全匹配指软件预安装包中包含的软件集与拿去查询的完整的软件列表中的软件集合完全相同,包含指软件预安装包中包含的软件集是拿去查询的完整的软件列表中的软件集合的真子集,不匹配是指除以上两种情况外的其它匹配结果;(2-2) Use the complete software list to find a software pre-installation package that meets the principle of maximum matching in the software pre-installation package library to obtain the matching result of the software pre-installation package; where the matching result of the software pre-installation package includes whether a match is found The software pre-installation package, matching degree and matching software pre-installation package number; the principle of maximum matching means that the software set in the software pre-installation package as the final query result is the largest software set in the complete software list to be queried Subset; the matching degree includes exact match, inclusion and mismatch. Exact match means that the software set contained in the software pre-installation package is exactly the same as the software set in the complete software list taken to query, and inclusion means that the software pre-installation package contains The software set is a proper subset of the software set in the complete software list to be queried, and the mismatch refers to other matching results except the above two cases;

(2-3)从用户提交的操作系统配置信息中判断用户是否要求在生成虚拟机镜像的过程中生成软件预安装包,若用户要求,且(2-1)中得到的匹配程度是包含或者不匹配,则表示需要生成软件预安装包的判断结果为是,否则表示不需要生成软件预安装包。(2-3) Judging from the operating system configuration information submitted by the user whether the user requests to generate a software pre-installation package during the process of generating the virtual machine image, if the user requests, and the matching degree obtained in (2-1) contains or If it does not match, it means that the judgment result of generating a software pre-installation package is yes; otherwise, it means that a software pre-installation package does not need to be generated.

如图4所示,本发明步骤(3)包括以下子步骤:As shown in Figure 4, step (3) of the present invention includes the following sub-steps:

(3-1)根据操作系统配置信息的分析结果,生成与软件预安装包相关的基本环境;具体而言,若步骤(2)中软件预安装包匹配结果指示找到匹配的软件预安装包,则在匹配的软件预安装包上建立一个QCOW2格式的增量镜像作为软件预安装包副本,并把剩余要安装软件的软件列表放置到其中;若用户需要生成软件预安装包,且步骤(2)中软件预安装包匹配结果指示没有找到完全匹配的软件预安装包,则新建一个QCOW2格式的虚拟磁盘,并在该虚拟磁盘里面放置好标识文件以表示这是一个将要用来放置软件预安装包的虚拟磁盘;(3-1) According to the analysis results of the operating system configuration information, generate the basic environment related to the software pre-installation package; specifically, if the matching result of the software pre-installation package in step (2) indicates that a matching software pre-installation package is found, Then build an incremental image in QCOW2 format on the matching software pre-installation package as a copy of the software pre-installation package, and place the remaining software list to be installed in it; if the user needs to generate a software pre-installation package, and step (2 ) indicates that no exact matching software pre-installation package is found, create a new virtual disk in QCOW2 format, and place an identification file in the virtual disk to indicate that this is a software pre-installation package that will be placed Package's virtual disk;

(3-2)生成启动虚拟机所需的基本环境,具体而言,包括从IP地址池获取IP地址,生成用于装载最终目标根文件系统的目标磁盘镜像,生成包含有依据用户提交的配置信息而生成的软件安装程序配置文件的启动光盘和虚拟机启动配置文件;其中虚拟机启动配置文件的硬盘项除了目标磁盘镜像外,还应有(3-1)中生成的磁盘镜像,以便在启动虚拟机时加载进去。(3-2) Generate the basic environment required to start the virtual machine, specifically, including obtaining the IP address from the IP address pool, generating the target disk image for loading the final target root file system, and generating the configuration containing the configuration submitted by the user The boot CD of the software installer configuration file and the virtual machine startup configuration file generated by the information; the hard disk item of the virtual machine startup configuration file should have the disk image generated in (3-1) in addition to the target disk image, so that the Loaded when starting the virtual machine.

如图5所示,本发明步骤(5)包含以下子步骤:As shown in Figure 5, step (5) of the present invention includes the following sub-steps:

(5-1)在安装软件之前,按照正常的流程安装操作系统,包括格式化目的虚拟机磁盘等,安装过程中若出现错误,则转入步骤(5-8);(5-1) Before installing the software, install the operating system according to the normal process, including formatting the target virtual machine disk, etc. If there is an error during the installation process, go to step (5-8);

(5-2)判断是否加载了软件预安装包,具体而言就是判断虚拟机是否加载了一块带软件预安装包的虚拟磁盘,如果加载了软件预安装包,则转到步骤(5-3),否则转到步骤(5-4),若过程中出现错误,则转到步骤(5-8);(5-2) Determine whether the software pre-installation package is loaded. Specifically, it is to determine whether the virtual machine has loaded a virtual disk with a software pre-installation package. If the software pre-installation package is loaded, go to step (5-3 ), otherwise go to step (5-4), if an error occurs during the process, go to step (5-8);

(5-3)将软件预安装包的根文件系统拷贝到刚格式化的目标虚拟磁盘中去,读取软件预安装包中剩余待安装软件列表,安装其中的软件包到目的虚拟机磁盘中,若过程中出现错误,则转入步骤(5-8);(5-3) Copy the root file system of the software pre-installation package to the newly formatted target virtual disk, read the list of remaining software to be installed in the software pre-installation package, and install the software packages in the target virtual machine disk , if an error occurs during the process, go to step (5-8);

(5-4)提取操作系统安装程序配置文件中的软件列表,通过依赖性分析得到完整的待安装软件包列表,依次安装其中的每一个软件包到目的虚拟机磁盘中,若过程中出现错误,则转入步骤(5-8);(5-4) Extract the software list in the configuration file of the operating system installer, obtain a complete list of software packages to be installed through dependency analysis, and install each of the software packages to the target virtual machine disk in turn. If an error occurs during the process , then go to step (5-8);

(5-5)判断虚拟机是否加载了带有空软件预安装包标识的虚拟机磁盘,若加载了,则转到步骤(5-6),否则直接转到步骤(5-7);若过程中出现错误,则转入步骤(5-8);(5-5) Determine whether the virtual machine is loaded with a virtual machine disk with an empty software pre-installation package identifier, if it is loaded, go to step (5-6), otherwise go directly to step (5-7); if If an error occurs during the process, go to step (5-8);

(5-6)将安装好了软件包的目标虚拟机磁盘中的根文件系统拷贝到空的虚拟机磁盘中,并去掉空软件预安装包标识,过程中若出现错误,则转入步骤(5-8);(5-6) Copy the root file system in the target virtual machine disk with the software package installed to an empty virtual machine disk, and remove the empty software pre-installation package logo. If an error occurs during the process, go to step ( 5-8);

(5-7)按正常流程在目的虚拟机磁盘中执行下面的操作系统安装过程,包括选择语言、时区,配置防火墙和安装多重启动管理器(GRandUnifiedBootloader,GRUB),若安装过程中出现错误,则转到步骤(5-8),若未出现错误,则转到步骤(5-9);(5-7) Perform the following operating system installation process on the target virtual machine disk according to the normal process, including selecting language, time zone, configuring firewall and installing multi-boot manager (GRandUnifiedBootloader, GRUB). If an error occurs during the installation process, then Go to step (5-8), if no error occurs, go to step (5-9);

(5-8)向监控进程报告安装出错,并转到步骤(5-10);(5-8) Report an installation error to the monitoring process and go to step (5-10);

(5-9)向监控进程报告安装完成,过程结束;(5-9) Report to the monitoring process that the installation is complete and the process ends;

(5-10)终止操作系统安装过程。(5-10) Terminate the operating system installation process.

本发明云环境下基于软件预安装的虚拟机镜像生成系统包括软件上传模块1、操作系统配置信息分析模块2、基本环境生成模块3、虚拟机启动模块4、操作系统安装和安装监控模块5、软件预安装包注册模块6和环境清理模块7。The virtual machine image generation system based on software pre-installation in the cloud environment of the present invention includes a software upload module 1, an operating system configuration information analysis module 2, a basic environment generation module 3, a virtual machine startup module 4, an operating system installation and installation monitoring module 5, Software pre-installation package registration module 6 and environment cleaning module 7.

其中软件上传模块1用于接收用户的上传软件,并对上传的软件进行依赖性检查。The software uploading module 1 is used for receiving the software uploaded by the user, and checking the dependencies of the uploaded software.

操作系统配置信息分析模块2用于接收并分析用户提交的操作系统配置信息,以得到操作系统配置信息分析结果。The operating system configuration information analysis module 2 is used to receive and analyze the operating system configuration information submitted by the user to obtain the analysis result of the operating system configuration information.

基本环境生成模块3根据操作系统配置信息分析结果生成基于软件预安装技术安装操作系统所必需的基本环境。The basic environment generating module 3 generates the basic environment necessary for installing the operating system based on the software pre-installation technology according to the analysis result of the operating system configuration information.

虚拟机启动模块4用于在基本环境生成模块3生成的基本环境下使用虚拟机启动配置文件启动虚拟机,同时启动监控进程。The virtual machine startup module 4 is used to start the virtual machine using the virtual machine startup configuration file under the basic environment generated by the basic environment generation module 3, and start the monitoring process at the same time.

操作系统安装和安装监控模块5用于在虚拟机中运行操作系统安装程序,以用非交互式的方式安装操作系统,同时监控进程判断操作系统的安装是出错还是已完成,如果出错,则关闭虚拟机,并转入环境清理模块7,如果已完成,则关闭虚拟机,并转入软件预安装包注册模块6。The operating system installation and installation monitoring module 5 is used to run the operating system installation program in the virtual machine to install the operating system in a non-interactive manner. At the same time, the monitoring process judges whether the installation of the operating system is wrong or completed, and if it is wrong, it is closed. Virtual machine, and proceed to environment cleaning module 7, if finished, then close virtual machine, and proceed to software pre-installation package registration module 6.

软件预安装包注册模块6用于判断在操作系统安装过程中是否生成了软件预安装包,如果生成则在软件预安装包库中注册该软件预安装包,然后进入环境清理模块7,否则直接进入环境清理模块7。The software pre-installation package registration module 6 is used to judge whether a software pre-installation package has been generated in the operating system installation process, if it is generated, the software pre-installation package is registered in the software pre-installation package library, and then enters the environment cleaning module 7, otherwise directly Enter environment cleaning module 7.

环境清理模块7用于清理基本环境中的临时文件,向IP地址池归还IP地址,并向用户报告安装结果。。The environment cleaning module 7 is used to clean up the temporary files in the basic environment, return the IP address to the IP address pool, and report the installation result to the user. .

操作系统配置信息分析模块2包括软件列表生成子模块21、软件预安装包匹配子模块22、软件预安装包生成判断子模块23。The operating system configuration information analysis module 2 includes a software list generation submodule 21 , a software preinstallation package matching submodule 22 , and a software preinstallation package generation judging submodule 23 .

软件列表生成子模块21用于从用户提交的操作系统配置信息中提取将要安装的软件,通过依赖关系分析得到完整的软件列表。The software list generation sub-module 21 is used to extract the software to be installed from the operating system configuration information submitted by the user, and obtain a complete software list through dependency analysis.

软件预安装包匹配子模块22用于使用完整的软件列表去软件预安装包库中查找一个符合最大匹配原则的软件预安装包,以得到软件预安装包匹配结果。具体而言,软件预安装包匹配子模块22维护一个数据库即软件预安装包库,里面保存每个软件预安装包和其软件列表信息,软件件预安装包库采用倒排索引的方式保存软件列表信息,索引的键是软件包名,值是包含该软件的软件预安装包的ID号;匹配算法如图6所示,匹配时,需要维护一个数组,数组元素是一个结构体,代表数组下标对应的ID号的cache,结构体成员有两个,分别是已匹配的次数(初值为0)和该cache的软件包数目;遍历待匹配的软件包列表,每个软件预安装包ID命中一次,把ID为下标的数组元素中的匹配次数加一,遍历完后,从数组中选出命中次数等于cache软件包数中命中次数最多的那个数组元素,其下标即是对应cache即是匹配的软件预安装包,若数组中没有命中次数等于cache软件包数的元素,则表示没能找到匹配的软件预安装包。The software pre-installation package matching sub-module 22 is used to use the complete software list to search for a software pre-installation package that meets the maximum matching principle in the software pre-installation package library, so as to obtain the software pre-installation package matching result. Specifically, the software pre-installation package matching sub-module 22 maintains a database, that is, the software pre-installation package library, which stores each software pre-installation package and its software list information, and the software pre-installation package library uses an inverted index to save the software List information, the key of the index is the software package name, and the value is the ID number of the software pre-installed package containing the software; the matching algorithm is shown in Figure 6. When matching, an array needs to be maintained, and the array element is a structure, representing the array The cache with the ID number corresponding to the subscript has two structure members, which are the number of matching times (initial value is 0) and the number of software packages in the cache; traverse the list of software packages to be matched, each software pre-installed package Once the ID hits, add one to the number of matches in the array element with the ID as the subscript. After traversing, select the array element with the highest number of hits from the array whose number of hits is equal to the number of cache software packages, and its subscript is the corresponding cache. That is, the matching software pre-installation package. If there is no element in the array whose number of hits is equal to the number of cache software packages, it means that no matching software pre-installation package can be found.

软件预安装包生成判断子模块23用于从用户提交的操作系统配置信息中判断用户是否要求在生成虚拟机镜像的过程中生成软件预安装包,若用户要求,且软件列表生成子模块21中得到的匹配程度是包含或者不匹配,则表示需要生成软件预安装包的判断结果为是,否则表示不需要生成软件预安装包。The software pre-installation package generation judging submodule 23 is used to judge whether the user requires from the operating system configuration information submitted by the user to generate a software pre-installation package in the process of generating the virtual machine image, if the user requires, and the software list generation submodule 21 If the obtained matching degree is included or not matched, it means that the judgment result of needing to generate a software pre-installation package is yes, otherwise it means that a software pre-installation package does not need to be generated.

本发明基本环境生成模块3包括软件预安装包基本环境生成子模块31和虚拟机启动基本环境生成子模块32。The basic environment generation module 3 of the present invention includes a software preinstallation package basic environment generation submodule 31 and a virtual machine startup basic environment generation submodule 32 .

其中软件预安装包基本环境生成子模块31用于根据操作系统配置信息的分析结果,生成与软件预安装包相关的基本环境;具体而言,若模块2中得到的软件预安装包匹配结果指示找到匹配的软件预安装包,则在匹配的软件预安装包上建立一个QCOW2格式的增量镜像作为软件预安装包副本,并把剩余要安装软件的软件列表放置到其中;若用户需要生成软件预安装包,且模块2中得到的软件预安装包匹配结果指示没有找到完全匹配的软件预安装包,则新建一个QCOW2格式的虚拟磁盘,并在该虚拟磁盘里面放置好标识文件以表示这是一个将要用来放置软件预安装包的虚拟磁盘;Wherein the software pre-installation package basic environment generation sub-module 31 is used to generate the basic environment related to the software pre-installation package according to the analysis results of the operating system configuration information; specifically, if the software pre-installation package matching result obtained in module 2 indicates If a matching software pre-installation package is found, an incremental image in QCOW2 format is created on the matching software pre-installation package as a copy of the software pre-installation package, and the rest of the software list to be installed is placed in it; if the user needs to generate software pre-installation package, and the matching result of the software pre-installation package obtained in module 2 indicates that no completely matching software pre-installation package is found, create a new virtual disk in QCOW2 format, and place an identification file in the virtual disk to indicate that this is A virtual disk on which the software pre-installation package will be placed;

虚拟机启动基本环境生成模块32用于生成启动虚拟机所需的基本环境;具体而言,包括从IP地址池获取IP地址,生成用于装载最终目标根文件系统的目标磁盘镜像,生成包含有依据用户提交的配置信息而生成的软件安装程序配置文件的启动光盘和虚拟机启动配置文件。The virtual machine startup basic environment generation module 32 is used to generate the basic environment required for starting the virtual machine; specifically, it includes obtaining an IP address from the IP address pool, generating a target disk image for loading the final target root file system, and generating a target disk image containing The startup CD of the software installer configuration file and the virtual machine startup configuration file generated according to the configuration information submitted by the user.

本发明操作系统安装模块5包括软件安装前执行子模块51、软件预安装包加载判别子模块52、基于软件预安装包技术的软件安装子模块53、正常软件安装子模块54、空软件预安装包磁盘镜像加载判别子模块55、软件预安装包生成子模块56、软件安装后执行子模块57、错误处理子模块58、安装完毕处理子模块59以及操作系统安装终止子模块510。The operating system installation module 5 of the present invention includes an execution submodule 51 before software installation, a software preinstallation package loading discrimination submodule 52, a software installation submodule 53 based on software preinstallation package technology, a normal software installation submodule 54, and an empty software preinstallation module. Package disk image loading judgment submodule 55, software pre-installation package generation submodule 56, software installation execution submodule 57, error handling submodule 58, installation completion processing submodule 59, and operating system installation termination submodule 510.

其中软件安装前执行子模块51用于完成软件安装开始之前阶段的工作,包括格式化虚拟机本身虚拟磁盘等,即按正常的流程完成操作系统安装程序软件安装开始前的各部分工作;若安装出现错误,则转入错误处理子模块58。Among them, the pre-software installation execution sub-module 51 is used to complete the work before the software installation begins, including formatting the virtual disk of the virtual machine itself, that is, to complete the various parts of the operating system installation program before the software installation begins according to the normal process; When an error occurs, proceed to the error handling submodule 58.

软件预安装包加载判别子模块52用于判别虚拟机是否加载了软件预安装包,如果加载了软件预安装包,则转到软件安装子模块53,否则转到正常软件安装子模块54,若过程中出现错误,则转到错误处理子模块58。The software pre-installation package loading judgment submodule 52 is used to judge whether the virtual machine has loaded the software pre-installation package, if the software pre-installation package is loaded, then go to the software installation sub-module 53, otherwise go to the normal software installation sub-module 54, if Error occurs in the process, then go to error handling submodule 58.

基于软件预安装包技术的软件安装子模块53用于将软件预安装包的根文件系统拷贝到刚格式化的目标虚拟磁盘中去,读取软件预安装包中剩余待安装软件列表,安装其中的软件包到目的虚拟机磁盘中,若过程中出现错误,则转入错误处理子模块58。The software installation submodule 53 based on the software pre-installation package technology is used to copy the root file system of the software pre-installation package to the target virtual disk that has just been formatted, read the remaining software list to be installed in the software pre-installation package, and install it software package in the destination virtual machine disk, if an error occurs in the process, then transfer to the error handling submodule 58.

正常软件安装子模块54用于提取操作系统安装程序配置文件中的软件列表,通过依赖性分析得到完整的待安装软件包列表,依次安装其中的每一个软件包到目的虚拟机磁盘中,若过程中出现错误,则转入错误处理子模块58。The normal software installation sub-module 54 is used to extract the software list in the operating system installer configuration file, obtain a complete list of software packages to be installed through dependency analysis, and install each software package in turn to the target virtual machine disk. If there is an error in the system, it will go to the error handling submodule 58.

空软件预安装包磁盘镜像加载判别子模块55用于判断虚拟机是否加载了带有空软件预安装包标识的虚拟磁盘;若加载了,则转到软件预安装包生成子模块56,否则直接转到软件安装后执行子模块57;若过程中出现错误,则转入错误处理子模块58。Empty software pre-installation package disk image loading submodule 55 is used to judge whether the virtual machine has loaded a virtual disk with an empty software pre-installation package identification; if loaded, then go to software pre-installation package generation submodule 56, otherwise directly Go to the execution submodule 57 after the software is installed; if an error occurs in the process, then go to the error handling submodule 58.

软件预安装包生成子模块56用于将安装好了软件包的目标虚拟机磁盘中的根文件系统拷贝到空的虚拟机磁盘中,并去掉空软件预安装包标识,过程中若出现错误,则转入错误处理子模块58。The software pre-installation package generation submodule 56 is used to copy the root file system in the target virtual machine disk of the software package to the empty virtual machine disk, and remove the empty software pre-installation package identification. If an error occurs in the process, Then transfer to the error handling submodule 58.

软件安装后执行子模块57用于执行软件包安装完毕之后的操作系统安装步骤,包括选择语言、时区,配置防火墙和安装多重启动管理器;若过程中出现错误,则转入错误处理子模块58,若未出现错误,则转入安装完成处理子模块59;Execute the submodule 57 after software installation is used to carry out the operating system installation step after the software package is installed, comprise selection language, time zone, configure firewall and install multi-boot manager; If error occurs in the process, then transfer to error handling submodule 58 , if no error occurs, then proceed to the installation completion processing submodule 59;

错误处理子模块58用于向监控进程报告安装出错,并转到终止操作系统安装子模块510。The error handling submodule 58 is used to report installation errors to the monitoring process, and transfer to the submodule 510 for terminating the installation of the operating system.

安装完成处理子模块59用于向监控进程报告安装完成,过程结束。The installation completion processing sub-module 59 is used to report the installation completion to the monitoring process, and the process ends.

终止操作系统安装子模块510用于终止操作系统安装。The sub-module 510 for terminating the installation of the operating system is used for terminating the installation of the operating system.

实例:Example:

为了验证本发明系统的可行性和有效性,在真实环境下部署了本发明系统,通过与直接启动虚拟机来制作虚拟机镜像进行对比。实验物理环境是两台一样配置的服务器,具体配置如表1所示。制作的镜像是CentOS5.5的操作系统。实验选择4组软件集,比较每组软件集下在两种发案下生成虚拟机镜像所花费的时间(当然本发明系统事先制作好了制作好了Base基础软件集的软件预安装包),实验的结果如表2。In order to verify the feasibility and effectiveness of the system of the present invention, the system of the present invention is deployed in a real environment, and compared with directly starting a virtual machine to make a virtual machine image. The physical environment of the experiment is two servers with the same configuration, and the specific configuration is shown in Table 1. The mirror image produced is the operating system of CentOS5.5. The experiment selects 4 groups of software sets, and compares the time spent in generating virtual machine images under two kinds of cases under each group of software sets (of course, the system of the present invention has made the software pre-installation package of the Base basic software set in advance), The results of the experiment are shown in Table 2.

表1实验配置环境Table 1 Experiment configuration environment

表2实验结果Table 2 Experimental results

由结果可知使用了BASE软件集的软件预安装包之后,4个软件集都基本上节省了大约4分钟的时间,由此可见软件预安装包能够有效地节省镜像模版的生成时间。It can be seen from the results that after using the software pre-installation package of the BASE software set, the time of the four software sets is basically saved by about 4 minutes. It can be seen that the software pre-installation package can effectively save the generation time of the image template.

本发明的基本原理是通过修改过的操作系统安装程序预先生成软件预安装包,即一个安装了一些软件但没有做后续系统配置的qcow2格式的虚拟磁盘,以后每次用户需要自定义虚拟机镜像时,先将所要安装的软件集与已存在的软件预安装包中的软件集做匹配,选择符合最大匹配原则的软件预安装包加载到安装操作系统的虚拟机中去,并在此基础上安装剩余的软件,以节省安装软件所花费的时间。本发明改进了上面提到的操作系统定制的方式,既能灵活地定制虚拟机镜像,还能大大地降低定制虚拟机镜像所花费的时间。The basic principle of the present invention is to pre-generate the software pre-installation package through the modified operating system installation program, that is, a virtual disk in qcow2 format with some software installed but no follow-up system configuration, and each time the user needs to customize the virtual machine image , first match the software set to be installed with the software set in the existing software pre-installation package, select the software pre-installation package that meets the principle of maximum matching and load it into the virtual machine where the operating system is installed, and on this basis Install the remaining software to save time spent installing software. The present invention improves the above-mentioned manner of customizing the operating system, can flexibly customize the virtual machine image, and can greatly reduce the time spent in customizing the virtual machine image.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, All should be included within the protection scope of the present invention.

Claims (6)

1. under a cloud environment based on the virtual machine image generation method of software pre-installation, it is characterized in that, comprise the following steps:
(1) receive the upload software of user, and dependence inspection is carried out to the software uploaded;
(2) receive and analyze user submit to operating system configuration information, to obtain operating system configuration information analysis result; This step comprises following sub-step:
(2-1) from the operating system configuration information that user submits to, extract the software that will install, obtain complete software matrix by dependence analysis;
(2-2) complete software matrix is used to go in software pre-installation Bao Ku, to search the software pre-installation bag that meets maximum match principle, to obtain software pre-installation bag matching result; Wherein, software pre-installation bag matching result comprises the software pre-installation packet number of software pre-installation bag, matching degree and the coupling whether finding coupling, maximum match principle refers to as the software collection in the software pre-installation bag of final Query Result is the maximal subset of software assembly of taking away in the complete software matrix of inquiry, and matching degree comprises mates completely, comprises and do not mate;
(2-3) from the operating system configuration information that user submits to, judge whether user requires in the process of generating virtual machines mirror image, generate software pre-installation bag, if user's requirement, and the matching degree obtained in (2-2) comprises or do not mate, then represent that the judged result needing to generate software pre-installation bag is yes, otherwise expression does not need to generate software pre-installation bag;
(3) generate based on the necessary Essential Environment of software pre-installation technology installing operating system according to operating system configuration information analysis result;
(4) use virtual machine activation configuration file to start virtual machine under the Essential Environment generated in step (3), start monitoring process simultaneously;
(5) operation system installation procedure in virtual machine, with with noninteractive mode installing operating system, monitoring process judges that the installation of operating system makes mistakes or completes simultaneously, if made mistakes, then close virtual machine, and proceed to step (7), if completed, then close virtual machine, and proceed to step (6); This step comprises following sub-step:
(5-1) before mounting software, according to normal flow process installing operating system, comprise format object magnetic disk of virtual machine, if there is mistake in installation process, then proceed to step (5-8);
(5-2) judge whether to be loaded with software pre-installation bag, if be loaded with software pre-installation bag, then forward step (5-3) to, otherwise forward step (5-4) to, if there is mistake in process, then forward step (5-8) to;
(5-3) root file system of software pre-installation bag is copied in the object magnetic disk of virtual machine of just format and go, software matrix to be installed is remained in reading software pre-installation bag, installation software package is wherein in object magnetic disk of virtual machine, if there is mistake in process, then proceed to step (5-8);
(5-4) software matrix in operating system installation application configuration file is extracted, complete software package list to be installed is obtained by dependency analysis, each software package is wherein installed successively in object magnetic disk of virtual machine, if there is mistake in process, then proceed to step (5-8);
(5-5) judge whether virtual machine is loaded with the magnetic disk of virtual machine be with and be free software pre-installation bag to identify, if be loaded with, then forwards step (5-6) to, otherwise directly forwards step (5-7) to; If there is mistake in process, then proceed to step (5-8);
(5-6) root file system installed in the object magnetic disk of virtual machine of software package is copied in empty magnetic disk of virtual machine, and remove sky software pre-installation bag mark, if there is mistake in process, then proceed to step (5-8);
(5-7) perform in object magnetic disk of virtual machine by normal flow below operating system installation process, comprise and select language, time zone, configuring firewalls and installation GRUB, if there is mistake in installation process, then forward step (5-8) to, if there is not mistake, then forward step (5-9) to;
(5-8) make mistakes to monitoring process report installation, and forward step (5-10) to;
(5-9) to monitoring process report installation, process terminates;
(5-10) terminating operation system installation process;
(6) judge in operating system installation process, whether generate software pre-installation bag, if generated, in software pre-installation Bao Ku, register this software pre-installation bag, then enter step (7), otherwise directly enter step (7);
(7) clear up the temporary file in Essential Environment, give back IP address to IP address pool, and to user report installation results.
2. virtual machine image generation method according to claim 1, it is characterized in that, step (1) is specially, solved by the database file in query software source to the dependent analysis of software, if dependence is not met, then the software of pointing out user to upload could not meet the reason of dependence, also needs to upload which software package and could meet software dependence, repeat (1) step, until the dependence of software is met.
3. virtual machine image generation method according to claim 1, is characterized in that, temporary file comprises the copy of software pre-installation bag, Bootable CD-ROM and virtual machine activation configuration file.
4. virtual machine image generation method according to claim 1, is characterized in that, step (3) comprises following sub-step:
(3-1) according to the analysis result of operating system configuration information, the Essential Environment relevant to software pre-installation bag is generated;
(3-2) Essential Environment started needed for virtual machine is generated.
5. virtual machine image generation method according to claim 4, is characterized in that,
Step (3-1) is specially, if the software pre-installation bag of coupling is found in the instruction of software pre-installation bag matching result in step (2), then coupling software pre-installation wrap set up a QCOW2 form increment mirror image as software pre-installation bag copy, and residue want the software matrix of mounting software to be placed into wherein; If user needs to generate software pre-installation bag, and the software pre-installation bag mated completely is not found in the instruction of software pre-installation bag matching result in step (2), the then magnetic disk of virtual machine of a newly-built QCOW2 form, and inside this magnetic disk of virtual machine, place identification document to represent that this is a magnetic disk of virtual machine that will be used for placing software pre-installation bag;
Step (3-2) is specially, secondary IP address pond obtains IP address, generating the destination disc mirror image for loading final purpose root file system, generating the Bootable CD-ROM and virtual machine activation configuration file that include the software installation procedure configuration file generated according to the configuration information of user's submission; Wherein the hard disk item of virtual machine activation configuration file is except destination disc mirror image, also should have the disk mirroring generated in (3-1), to load when starting virtual machine.
6. under a cloud environment based on the virtual machine image generation system of software pre-installation, comprise software upload module, operating system configuration information analysis module, Essential Environment generation module, virtual machine activation module, operating system installation and installation monitoring module, software pre-installation bag Registering modules and environment cleaning module, it is characterized in that
Software upload module for receiving the upload software of user, and carries out dependence inspection to the software uploaded;
Operating system configuration information analysis module for receive and analyze user submit to operating system configuration information, to obtain operating system configuration information analysis result; Operating system configuration information analysis module comprises the generation of software matrix generation submodule, software pre-installation bag matched sub-block and software pre-installation bag and judges submodule;
Software matrix generates submodule and is used for extracting the software that will install the operating system configuration information submitted to from user, obtains complete software matrix by dependence analysis;
Software pre-installation bag matched sub-block searches for using complete software matrix to go the software pre-installation bag that meets maximum match principle in software pre-installation Bao Ku, to obtain software pre-installation bag matching result; Wherein, software pre-installation bag matching result comprises the software pre-installation packet number of software pre-installation bag, matching degree and the coupling whether finding coupling, maximum match principle refers to as the software collection in the software pre-installation bag of final Query Result is the maximal subset of software assembly of taking away in the complete software matrix of inquiry, and matching degree comprises mates completely, comprises and do not mate;
Software pre-installation bag generates and judges that submodule is used for judging whether user requires in the process of generating virtual machines mirror image, generate software pre-installation bag the operating system configuration information submitted to from user, if user's requirement, and the matching degree obtained in software pre-installation bag matched sub-block comprises or do not mate, then represent that the judged result needing to generate software pre-installation bag is yes, otherwise expression does not need to generate software pre-installation bag;
Essential Environment generation module comprises software pre-installation bag Essential Environment and generates submodule and virtual machine activation Essential Environment generation submodule;
Software pre-installation bag Essential Environment generates submodule for the analysis result according to operating system configuration information, generates the Essential Environment relevant to software pre-installation bag;
Virtual machine activation Essential Environment generates submodule for generating the Essential Environment started needed for virtual machine;
Essential Environment generation module is used for generating based on the necessary Essential Environment of software pre-installation technology installing operating system according to operating system configuration information analysis result;
Virtual machine activation module uses virtual machine activation configuration file to start virtual machine under being used for the Essential Environment generated at Essential Environment generation module, start monitoring process simultaneously;
Operating system installation and installation monitoring module are used for operation system installation procedure in virtual machine, with with noninteractive mode installing operating system, monitoring process judges that the installation of operating system makes mistakes or completes simultaneously, if made mistakes, then close virtual machine, and proceed to environment cleaning module, if completed, then close virtual machine, and proceed to software pre-installation bag Registering modules; Before operating system installation and installation monitoring module comprise software installation, implementation sub-module, software pre-installation bag loading differentiation submodule, the software installation submodule based on software pre-installation packet technology, normal software installation submodule, empty software pre-installation bag disk mirroring load differentiation submodule, software pre-installation bag generation submodule, software installation rear implementation sub-module, error handle submodule, install process submodule and operating system installation terminator module;
Front implementation sub-module installs the last stage of beginning work for completing software installed by software, comprises format object magnetic disk of virtual machine, namely install each several part work before starting by normal flow process complete operation system installation procedure software; If install and occur mistake, then proceed to error handle submodule;
Software pre-installation bag loads and differentiates that submodule is for differentiating whether virtual machine is loaded with software pre-installation bag, if be loaded with software pre-installation bag, then forward software to and submodule is installed, otherwise forward normal software installation submodule to, if there is mistake in process, then forward error handle submodule to;
Software based on software pre-installation packet technology is installed submodule and is gone for being copied to by the root file system of software pre-installation bag in the firm object magnetic disk of virtual machine formatd, software matrix to be installed is remained in reading software pre-installation bag, installation software package is wherein in object magnetic disk of virtual machine, if there is mistake in process, then proceed to error handle submodule;
Normal software installs submodule for extracting the software matrix in operating system installation application configuration file, complete software package list to be installed is obtained by dependency analysis, each software package is wherein installed successively in object magnetic disk of virtual machine, if there is mistake in process, then proceed to error handle submodule;
Empty software pre-installation bag disk mirroring loads and differentiates that submodule is for judging whether virtual machine is loaded with the magnetic disk of virtual machine be with and be free software pre-installation bag to identify; If be loaded with, then forward software pre-installation bag to and generate submodule, otherwise implementation sub-module after directly forwarding software installation to; If there is mistake in process, then proceed to error handle submodule;
Software pre-installation bag generates submodule and is used for the root file system installed in the object magnetic disk of virtual machine of software package to copy in empty magnetic disk of virtual machine, and removes sky software pre-installation bag mark, if there is mistake in process, then proceeds to error handle submodule;
After software installation, implementation sub-module is used for the operating system installation step after software package executable installs, and comprises and selects language, time zone, configuring firewalls and installation multiboot manager; If there is mistake in process, then proceed to error handle submodule, if there is not mistake, then proceed to and install process submodule;
Error handle submodule is used for makeing mistakes to monitoring process report installation, and forwards operating system installation terminator module to;
Install process submodule for reporting installation to monitoring process, process terminates;
Operating system installation terminator module is used for terminating operation system and installs;
Software pre-installation bag Registering modules is used for judging in operating system installation process, whether generate software pre-installation bag, if generated, in software pre-installation Bao Ku, register this software pre-installation bag, then entered environment cleaning module, otherwise directly entered environment clears up module;
Environment cleaning module, for clearing up the temporary file in Essential Environment, gives back IP address to IP address pool, and to user report installation results.
CN201310007532.3A 2013-01-09 2013-01-09 Method and system is generated based on the virtual machine image of software pre-installation under cloud environment Expired - Fee Related CN103092650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310007532.3A CN103092650B (en) 2013-01-09 2013-01-09 Method and system is generated based on the virtual machine image of software pre-installation under cloud environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310007532.3A CN103092650B (en) 2013-01-09 2013-01-09 Method and system is generated based on the virtual machine image of software pre-installation under cloud environment

Publications (2)

Publication Number Publication Date
CN103092650A CN103092650A (en) 2013-05-08
CN103092650B true CN103092650B (en) 2015-11-18

Family

ID=48205261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310007532.3A Expired - Fee Related CN103092650B (en) 2013-01-09 2013-01-09 Method and system is generated based on the virtual machine image of software pre-installation under cloud environment

Country Status (1)

Country Link
CN (1) CN103092650B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077379A (en) * 2016-04-25 2017-08-18 深圳前海达闼云端智能科技有限公司 A kind of virtual machine creation method and device

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424012B (en) * 2013-08-20 2018-03-16 国际商业机器公司 Method and apparatus for providing custom virtual appliances
WO2016029807A1 (en) 2014-08-28 2016-03-03 北京金山安全软件有限公司 Cleanup method and device for terminal resource and terminal
CN104182532B (en) * 2014-08-28 2018-10-16 北京金山安全软件有限公司 Terminal file cleaning method and device and terminal
CN104503772B (en) * 2014-11-21 2018-10-12 北京奇虎科技有限公司 The method and apparatus that operating system installation based on virtual machine, test environment are built
CN105007261A (en) * 2015-06-02 2015-10-28 华中科技大学 Security protection method for image file in virtual environment
CN105138346B (en) * 2015-07-13 2018-10-16 北京金山安全软件有限公司 Application installation method and device
CN105045644A (en) * 2015-09-17 2015-11-11 上海赛为信息技术有限公司 Production method of virtual device program installation package and production method of virtual device
CN105573817B (en) * 2015-12-11 2019-02-12 北京奇虎科技有限公司 Method, device and system for virtual input control
CN106250205B (en) * 2016-07-22 2019-09-24 浪潮(北京)电子信息产业有限公司 A kind of virtual machine method for customizing and system
CN107729117B (en) * 2016-08-10 2021-07-06 中国移动通信集团重庆有限公司 A method and system for generating a virtual machine
CN106406980B (en) * 2016-09-06 2019-11-22 青岛海信传媒网络技术有限公司 A kind of dispositions method and device of virtual machine
CN107004032B (en) 2016-11-17 2023-12-08 华为云计算技术有限公司 Mirror image file conversion method and device
CN106713420B (en) * 2016-11-30 2019-11-22 国网北京市电力公司 Monitoring deployment method and device
CN106843976B (en) * 2017-01-25 2018-11-16 北京百度网讯科技有限公司 Method and apparatus for generating image file
CN106911500B (en) * 2017-02-20 2020-12-04 北京百度网讯科技有限公司 Physical machine configuration method and device and physical machine
CN107992309A (en) * 2017-10-24 2018-05-04 东软集团股份有限公司 Software installation method, device, system, medium and electronic equipment
CN109634697A (en) * 2018-11-05 2019-04-16 广东微云科技股份有限公司 Internationalized intelligent switching method and system for computer languages
CN109491715B (en) * 2018-11-06 2021-10-22 深圳市风云实业有限公司 Application management method, device and terminal based on Windows NT
CN109739518B (en) * 2018-12-25 2021-05-28 杭州数梦工场科技有限公司 Method and device for generating offline software resources
CN112306509A (en) * 2020-10-27 2021-02-02 西安万像电子科技有限公司 Software installation method, server, terminal equipment and system
CN112306513A (en) * 2020-12-24 2021-02-02 智道网联科技(北京)有限公司 Installation method and device of third-party application, computing equipment and storage medium
CN114610357B (en) * 2022-03-31 2024-11-26 中国电子科技集团公司第三十研究所 A method for releasing, deploying and upgrading container images and software system resources separately

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470616A (en) * 2007-12-27 2009-07-01 英业达股份有限公司 Pre-installation method, pre-installation image and pre-installation image system forming method
US7577722B1 (en) * 2002-04-05 2009-08-18 Vmware, Inc. Provisioning of computer systems using virtual machines
CN102063312A (en) * 2009-11-16 2011-05-18 英业达股份有限公司 Pre-installed software detection methods
CN102122274A (en) * 2010-01-10 2011-07-13 微软公司 Automated configuration and installation of virtualized solutions
CN102339444A (en) * 2010-07-27 2012-02-01 戴元顺 Cloud supermarket system
CN102722391A (en) * 2012-06-07 2012-10-10 浪潮电子信息产业股份有限公司 Automatic integrated system configuration and software installation method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7577722B1 (en) * 2002-04-05 2009-08-18 Vmware, Inc. Provisioning of computer systems using virtual machines
CN101470616A (en) * 2007-12-27 2009-07-01 英业达股份有限公司 Pre-installation method, pre-installation image and pre-installation image system forming method
CN102063312A (en) * 2009-11-16 2011-05-18 英业达股份有限公司 Pre-installed software detection methods
CN102122274A (en) * 2010-01-10 2011-07-13 微软公司 Automated configuration and installation of virtualized solutions
CN102339444A (en) * 2010-07-27 2012-02-01 戴元顺 Cloud supermarket system
CN102722391A (en) * 2012-06-07 2012-10-10 浪潮电子信息产业股份有限公司 Automatic integrated system configuration and software installation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077379A (en) * 2016-04-25 2017-08-18 深圳前海达闼云端智能科技有限公司 A kind of virtual machine creation method and device
CN107077379B (en) * 2016-04-25 2019-03-15 深圳前海达闼云端智能科技有限公司 A kind of virtual machine creation method and device

Also Published As

Publication number Publication date
CN103092650A (en) 2013-05-08

Similar Documents

Publication Publication Date Title
CN103092650B (en) Method and system is generated based on the virtual machine image of software pre-installation under cloud environment
US11789715B2 (en) Systems and methods for transformation of reporting schema
US8429645B2 (en) Method for optimizing migration of software applications to address needs
US8850423B2 (en) Assisting server migration
JP5598017B2 (en) Judgment program, method and apparatus
US8799893B2 (en) Method, system and computer program product for solution replication
US8515799B2 (en) Constructing change plans from component interactions
CN102279750B (en) Iterative code generation method based on domain knowledge sharing
CN104954453A (en) Data mining REST service platform based on cloud computing
CN112068852B (en) Method, system, equipment and medium for installing open-source software based on domestic server
CN106599167B (en) A system and method for supporting incremental database upgrade
US20130014082A1 (en) Method of configuring business logic supporting multi-tenancy
US8856775B2 (en) Unstacking software components for migration to virtualized environments
CN106598874A (en) Method and device for automatically testing software
CN1280727C (en) Human-machine order testing method
CN111625407B (en) SSD performance test method and related components
CN116974826A (en) Information processing method, device, equipment and medium for configuration items
CN116578497A (en) Automatic interface testing method, system, computer equipment and storage medium
CN112464596B (en) Regression testing method, system, device and readable storage medium
CN114372259B (en) Method and system for marking object tags and generating security policies in operating system
CN108733566A (en) A kind of virtualization system automatization test system and method based on python
US20080288501A1 (en) Integrating Database Functionality with Workload Schedulers
Fabra et al. Integration of grid, cluster and cloud resources to semantically annotate a large‐sized repository of learning objects
CN119376741B (en) Java migration compatibility processing method, device and storage medium
US9038049B2 (en) Automated discovery of resource definitions and relationships in a scripting environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151118

CF01 Termination of patent right due to non-payment of annual fee