Hyper-v allows you to quickly create multiple VMS using different Disks

Source: Internet
Author: User

Three options are available when creating a Hyper-v disk.

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201304/26/6772097_1366979999U23G.png "" 456 "height =" 345 "/>

These are fixed-size Dynamic Scaling and difference (differencing)

Where

Fixed sizeHyper-v creates a file that sets the size value when it is created.

The advantage is that it is relatively fast and it is not easy to generate physical disk fragments.

Disadvantages: it takes a long time to create a new disk because the system needs to fill the virtual disk)

Recommended for actual production environment

Dynamic ScalingIt only occupies a small amount of space (about 4 MB) when it is created. When it is used, it increases with the increase of the occupied space.

The advantage is that the space occupied by the Virtual Disk increases with the increase in usage, which effectively improves the hard disk utilization.

The disadvantage is that the speed is slow, and because of the dynamic growth, fragments may be generated on the physical disk.

Recommended for experimental environments

DifferenceThis requires a parent disk to connect to the parent disk, and the data of the parent disk is referenced by the disk to save the changed data relative to the parent disk.

Its structure is similar

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201304/26/6772097_1366980000axqn.png "" 372 "height =" 308 "/>

We recommend that you store the same data as a parent disk when many data items are the same, and then create a differential disk to reference the data of that parent disk.

 

Many times, when using a virtual machine, we need to create a new virtual machine and then install the system in it.

However, the current Windows 7/8 or other systems of a system are approximately 10 Gb in size. If multiple virtual machines are required, this is a very objective hard disk usage.

Then we can use the differential disk method to first install a system, then initialize and encapsulate it into a parent disk, and create n New Differential disks, in this way, you can quickly create n VMS.

 

 

After talking about a bunch of basic things

The following describes how to use a differential disk to quickly create a virtual machine.

First, create a parent disk and install the system in it (this document uses ws2012 as an example)

Install the system first (do not elaborate on this ?) Enter the system, and then make some basic configurations for the system. For example, some people in ws2012 do not like to switch out of the Server Manager and cancel

Then, you can install common things such as winrar or. net 3.5.

Then use sysprep for system Encapsulation

Press win + x in ws2012, and then a or another method is used to open the command line prompt as the administrator.

Enter sysprep \ sysprep

Then select (for more information about sysprep, refer to the official Microsoft document http://technet.microsoft.com/zh-cn/library/cc766049 (v = ws.10). aspx)

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201304/26/6772097_1366980001JcMf.png "" 611 "height =" 381 "/>

After confirmation, wait for a moment and wait until the system clears the information, it will automatically shut down and the parent disk has been created.

(Although you can use different Disks without sysprep, the SID of multiple virtual machines created with different disks is the same, if you want to perform an experiment such as a domain, the problem will occur, and sysprep can clear the information.

Then, the next boot will initialize the computer as after the computer is reloaded, such as scanning the hardware to create a new sid)

After a parent disk is created, follow the steps above to create a differential Disk

Open the hyper-v manager and create a new disk.

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/014J63247-3.png "" 244 "height =" 58 "/>

Then jump out of the Wizard. After two steps, select the difference in the disk type

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201304/26/6772097_1366980003nqjy.png "" 444 "height =" 332 "/>

Specify the storage location and name of the new differential disk.

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/014J63057-5.png "" 476 "height =" 319 "/>

Specify the location of the parent disk after the next step, that is, the location of the disk with the operating system just created

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/014JA102-6.png "" 496 "height =" 379 "/>

 

A differential disk has been created.

The differential disk fully references all data of the parent disk. It is exactly the same as directly using the parent disk at the beginning.

Then, the differential disk stores the different configurations relative to the parent disk. For example, the parent disk does not contain qq, but you have installed qq on the System of the disk, the differential disk stores qq data.

Create a VM using a differential Disk

New-Virtual Machine

In the step of connecting to the virtual disk, select the new differential disk.

650) this. width = 650; "title =" image "style =" border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/014JB0G-7.png "" 565 "height =" 397 "/>

 

Each time you need a new system, you must first create a new differential disk and reference the encapsulated parent disk. Then you can use this differential virtual disk when creating a new virtual machine.

Precautions for using differential Disks

1. because the parent disk of the differential disk has only one file, when multiple virtual machines use the differential disk, everyone uses this parent disk. The hard disk io issue needs to be considered, therefore, it is recommended that the parent disk be placed in a relatively high-speed location, such as ssd (even if the difference is not passed, it seems to be a rather tangled problem)

2. Once the parent disk is encapsulated, do not start it directly using the parent disk. Otherwise, the parent disk encapsulation will be damaged and the reference of all differential disks will become invalid.

 

Ps: the snapshot of a VM actually uses the principle of a different disk.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.