[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109325012A - A method of modification virtual machine image subregion - Google Patents

A method of modification virtual machine image subregion Download PDF

Info

Publication number
CN109325012A
CN109325012A CN201810897238.7A CN201810897238A CN109325012A CN 109325012 A CN109325012 A CN 109325012A CN 201810897238 A CN201810897238 A CN 201810897238A CN 109325012 A CN109325012 A CN 109325012A
Authority
CN
China
Prior art keywords
mirror image
new
virtual machine
subregion
size
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.)
Withdrawn
Application number
CN201810897238.7A
Other languages
Chinese (zh)
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.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud Technology Co Ltd
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 G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201810897238.7A priority Critical patent/CN109325012A/en
Publication of CN109325012A publication Critical patent/CN109325012A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to desktop cloud mirror image administrative skill field, especially a kind of method for modifying virtual machine image subregion.Method of the present invention is to create new mirror image according to the virtual machine partitions situation inquired;And according to the subregion for needing to modify new mirror image;Former mirror image is replaced with new mirror image again.The present invention solves and can not modify mirrored partition automatically, can not compress mirror image, cannot come into force to the virtual machine that mirror image is used, can not reduce the problems such as mirror image partition size;It can be applied to desktop cloud mirror image administrative skill field.

Description

A method of modification virtual machine image subregion
Technical field
The present invention relates to desktop cloud mirror image administrative skill field, especially a kind of method for modifying virtual machine image subregion.
Background technique
There are more and more desktop cloud platforms to be applied to inside each enterprise now, each enterprise demand is very It is personalized;It much requires and existing server is utilized, such as create cloud desktop based on existing server;In this way The disk configuration of cloud desktop is usually also required to personalization.Traditional mode mainly by way of manual, needs to make according to user The cloud desktop for making the disk partition to meet the requirements of the customers is supplied to user's use, can there is following hidden danger in this way:
First is that a secondary mirror will be remake by hand according to each customer demand when desktop cloud project is more and more Picture.Actually the software of cloud desktop is all consistent with operating system, and only disk partition and CPU configuration are different.And CPU configuration is logical It is all often that dynamic adjusts, and system disk subregion is then mirror image default.And a completely new mirror image is made, it is various to installing by bare machine Software is very time-consuming and laborious.
Second is that client wants to adjust partition size again actually in use process, need into each cloud desktop Inside operating system, the subregion of each cloud desktop is modified by hand in the same way, and the usual quantity of the desktop of desktop cloud all compares Huger, such efficiency is very low, and manual operation user makes mistakes.
To solve the above-mentioned problems, a kind of method for modifying virtual machine image subregion is needed.It is virtual by a kind of modification The method of machine mirrored partition, in a manner of full-automatic, efficient, mirrored partition can not be modified automatically, can not press by being able to solve Contracting mirror image cannot come into force to the virtual machine that mirror image is used, can not reduce the problems such as mirror image partition size.
Summary of the invention
Present invention solves the technical problem that being to provide a kind of method for modifying virtual machine image subregion;Solving can not be certainly Dynamic modification mirrored partition, mirror image can not be compressed, cannot be come into force to the virtual machine that mirror image is used, can not to reduce mirrored partition big The problems such as small.
The technical solution that the present invention solves above-mentioned technical problem is:
The method is to create new mirror image according to the virtual machine partitions situation inquired;And according to needing to modify new mirror The subregion of picture;Former mirror image is replaced with new mirror image again.
The method includes the following steps:
Step 1: checking subregion service condition;
Step 2: creating new mirror image;
Step 3: modifying new mirrored partition;
Step 4: compressing new image file;
Step 5: replacing former mirror image using new mirror image;
Step 6: starting virtual machine;
Described checks subregion service condition, refers to the service condition for checking former mirrored partition, includes title, type, The mirror image is used with space, available space, total size and which virtual machine;
The type containing type has subregion, block device;
The subregion refers to disk partition.
The new mirror image of creation is the new image file for creating a size and former mirror image striking resemblances.
The new mirrored partition of modification, which refers to, all shuts down the virtual machine that former mirror image is used, then by former mirror image Information imported into inside new mirror image while modifying new mirrored partition size.
The new mirrored partition size of the modification refers to increase or reduces the size of mirrored partition;If desired mirror image is reduced Subregion, first judges whether available space is greater than the space of diminution, if so then execute mirror image partition size is reduced;Otherwise modification is shown Mirrored partition failure.
The new image file of compression refers to the actual size for compressing new image file;Image file is by increase Afterwards, authentic document size can expand automatically, at this time in order to save memory space, then need to compress the actual size of mirror image, compression The logic size of mirror image can't change afterwards.
Replacing former mirror image using new mirror image is that original mirror image is replaced by new mirror image, realizes mirrored partition modification.
The starting virtual machine is the virtual machine that starting uses the mirror image, and virtual machine will load repair during startup Mirrored partition after changing.
For the present invention by a kind of method for modifying virtual machine image subregion, mirrored partition, nothing can not be modified automatically by solving Method compression mirror image cannot come into force to the virtual machine that mirror image is used, can not reduce the problems such as mirror image partition size.The present invention is whole A process is full-automatic, does not need manual intervention, is different from general method.The method provided by the present invention can not only extend mirror image point The size in area can also reduce the size of mirrored partition, and a variety of granularities after being different from a kind of backup of virtual machine image grade are restored Method can not extend or reduce automatically subregion.The method provided by the present invention re-compresses mirror image after extending mirror image, guarantees mirror image Physics occupied space minimizes, and maximally utilizes memory space, is suitble to desktop cloud to the very high project of cost requirement, is different from one As method.The method provided by the present invention all uniformly comes into force to the virtual machine based on former mirror image, after restarting virtual machine, point of virtual machine Area's size becomes consistent after mirrored partition is modified, and helps adaptation project individual demand, is different from general method.
Detailed description of the invention
The following further describes the present invention with reference to the drawings:
Fig. 1 is flow chart of the present invention.
Specific embodiment
There are many embodiments of the present invention, illustrates one of implementation method, process by taking desktop cloud platform as an example here Figure is as shown in Figure 1, specific implementation process is as follows
1, check that subregion service condition, process are as follows:
1) information of file system is checked;
2) information of case of non-partitioned is filtered out, is left all to be partition information;
3) the virtual machine list based on former mirror image is inquired.
2, new mirror image is created, process is as follows:
1) size of former mirror image is obtained;
2) a new image file with former mirror image size striking resemblances is created.
3, new mirrored partition is modified, process is as follows:
1) all virtual machines based on former mirror image are closed;
2) judge modification mode, if reduction operation, then judge whether subregion available space is greater than the space of diminution, if Then continue, otherwise reports exception and the process that terminates;If extended operation, then whether host operating system current space available is judged New mirror image is created enough, if then continuing, otherwise reports exception and the process that terminates;
3) former mirror file system is imported into new image file while modifies mirrored partition size.
4, new image file is compressed, process is as follows:
1) by new mirror image boil down to qcow2 format;
2) actual size and logic size of new mirror image are checked;
3) whether decision logic size changes, and exception is reported if changing and the process that terminates.
5, former mirror image is replaced using new mirror image, process is as follows:
1) new be mirrored on mirror image server is uploaded;
2) virtual machine based on former mirror image is all uniformly revised as based on new mirror image.
6, start virtual machine, check the modified partition information of virtual machine.
Whole flow process terminates.

Claims (8)

1. a kind of method for modifying virtual machine image subregion, it is characterised in that: the method is according to the virtual machine inquired Partitioning scenario creates new mirror image;And according to the subregion for needing to modify new mirror image;Former mirror image is replaced with new mirror image again.
2. according to the method described in claim 1, its feature is being: the method includes the following steps:
Step 1: checking subregion service condition;
Step 2: creating new mirror image;
Step 3: modifying new mirrored partition;
Step 4: compressing new image file;
Step 5: replacing former mirror image using new mirror image;
Step 6: starting virtual machine.
3. according to the method described in claim 2, referring to and checking former mirror it is characterized by: described checks subregion service condition Which as the service condition of subregion, comprising title, type, it is used with space, available space, total size and virtual machine The mirror image;
The type containing type has subregion, block device;
The subregion refers to disk partition.
4. according to the method described in claim 2, it is characterized by: the new mirror image of the creation is one size of creation and former mirror As the same new image file.
5. according to the method described in claim 2, it is characterized by: the new mirrored partition of the modification, which refers to, will be used original The virtual machine of mirror image all shuts down, and then the information of former mirror image is imported into inside new mirror image while to modify new mirrored partition big It is small.
The new mirrored partition size of the modification refers to increase or reduces the size of mirrored partition;If desired mirrored partition is reduced, Judge whether available space is greater than the space of diminution, first if so then execute mirror image partition size is reduced;Otherwise modification mirror image is shown Subregion failure.
6. according to the method described in claim 2, it is characterized by: the new image file of the compression refers to the new mirror image text of compression The actual size of part;After increasing, authentic document size can expand image file automatically, empty in order to save storage at this time Between, then need to compress the actual size of mirror image, the logic size of mirror image can't change after compression.
7. according to the method described in claim 2, it is characterized by: replacing former mirror image using new mirror image is replaced by new mirror image Mirror image originally realizes mirrored partition modification.
8. according to the method described in claim 1, it is characterized by: the starting virtual machine is the void that starting uses the mirror image Quasi- machine, virtual machine will load modified mirrored partition during startup.
CN201810897238.7A 2018-08-08 2018-08-08 A method of modification virtual machine image subregion Withdrawn CN109325012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810897238.7A CN109325012A (en) 2018-08-08 2018-08-08 A method of modification virtual machine image subregion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810897238.7A CN109325012A (en) 2018-08-08 2018-08-08 A method of modification virtual machine image subregion

Publications (1)

Publication Number Publication Date
CN109325012A true CN109325012A (en) 2019-02-12

Family

ID=65264154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810897238.7A Withdrawn CN109325012A (en) 2018-08-08 2018-08-08 A method of modification virtual machine image subregion

Country Status (1)

Country Link
CN (1) CN109325012A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831314A (en) * 2020-06-24 2020-10-27 烽火通信科技股份有限公司 Method and device for patching non-writable partition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006534A1 (en) * 2007-06-29 2009-01-01 Microsoft Corporation Unified Provisioning of Physical and Virtual Images
CN107004032A (en) * 2016-11-17 2017-08-01 华为技术有限公司 Image file conversion method and device
CN107015995A (en) * 2016-01-28 2017-08-04 华为技术有限公司 The amending method and device of a kind of image file
CN107844260A (en) * 2016-09-19 2018-03-27 深圳市深信服电子科技有限公司 A kind of method and device of magnetic disk of virtual machine space dilatation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006534A1 (en) * 2007-06-29 2009-01-01 Microsoft Corporation Unified Provisioning of Physical and Virtual Images
CN107015995A (en) * 2016-01-28 2017-08-04 华为技术有限公司 The amending method and device of a kind of image file
CN107844260A (en) * 2016-09-19 2018-03-27 深圳市深信服电子科技有限公司 A kind of method and device of magnetic disk of virtual machine space dilatation
CN107004032A (en) * 2016-11-17 2017-08-01 华为技术有限公司 Image file conversion method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
运维个西瓜: "修改KVM虚拟机镜像中的文件的几种方法(Guestfish/Guestmount/virt-*tools)", 《CSDN博客》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831314A (en) * 2020-06-24 2020-10-27 烽火通信科技股份有限公司 Method and device for patching non-writable partition
CN111831314B (en) * 2020-06-24 2022-11-22 烽火通信科技股份有限公司 Method and device for patching non-writable partition

Similar Documents

Publication Publication Date Title
KR101417759B1 (en) Device and method for upgrading information of system
CN103942058B (en) A kind of EMBEDDED AVIONICS method for upgrading software and system
CN101110788B (en) Method and system for updating client software
CN108205481B (en) Application container instance creation method and device
CN106648787A (en) Resource updating method and terminal
CN105404521A (en) Incremental upgrading method and relevant device
CN111131352B (en) Theme switching method and device
JP2009530702A (en) Data storage management method and device
CN103106091A (en) Start-up system and method of operating system based on removable storage media
CN103177077B (en) The storage of a kind of APK file and output intent
US11775288B2 (en) Method and apparatus for generating difference between old and new versions of data for updating software
US20110267628A1 (en) Information processing apparatus and computer program product
CN108475201A (en) A kind of data capture method in virtual machine start-up course and cloud computing system
CN109325012A (en) A method of modification virtual machine image subregion
CN106021373A (en) File updating method and device
CN102360299A (en) Software system resetting method, server and client
CN102707907B (en) Device and printer having frame
KR102204047B1 (en) Apparatus and method for managing application storage area of mobile terminal
CN107577506B (en) Data preloading method and system
US7340738B2 (en) Time optimized replacement of a software application
CN109213504A (en) A kind of stackable file system and its loading method and upgrade method
US20150089486A1 (en) Method of Firmware Upgrade
CN110597759B (en) Method and storage medium for optimizing atlas resources in LayaIDE
CN107643959A (en) Image file treating method and apparatus
CN101387968B (en) Method and apparatus for resolving multi graphic identification and verifying dynamic link library collision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20190212