Original address: https://www.linuxidc.com/Linux/2017-03/141972.htm
VMware Virtualization Technology is one of the most mature architectures in the cloud, the IaaS (Infrastructure as a Service), where the technology used is xen,kvm,lxd and so on.
Why Virtualization Technology? At present, many large-scale internet companies and game companies have adopted XEN,KVM and other virtualization technology, the advantage of using these virtualization technology is when the server down, the maintenance of the operation of the operator only need to switch services running on the virtual machine to another physical machine. Without the use of virtualization technology, OPS must find a physical machine configuration service before the service goes offline to enable switching. Therefore, virtualization technology can realize real-time switching and migration of services. In addition, advanced functions, such as automation operations and the implementation of elastic operations, can only be achieved through the operation of virtual machines, while the physical machines run in a way that is not operational.
IBM and Intel are also constantly developing new features of the CPU to provide better and more convenient virtualization technology for hardware manufacturing.
So how does creating a virtual machine work? What is the process of creating a virtual machine? To put it simply, creating a virtual machine is virtual machines on a single computer, and the VMs are independent of each other and look like separate computers. We know that the most core hardware components of a host are CPU (central processing unit), MEMORY,I/O devices, which are connected by the motherboard. Therefore, strictly speaking, the creation of virtual machines is a software way to virtual out each has a separate CPU, Memory, I/O device platform . We refer to the host as hosts and call each virtual machine guest.
The problem is, suppose our computer CPU only one, so the bottom can achieve the operation of only one CPU, then how the software to ensure that each virtual machine has a separate CPU? How is memory and I/O implemented?
For the CPU, because the CPU works as a tick (time-sharing), it can divide the running time into multiple time periods and allocate these time periods to each virtual machine.
For memory, the first thing to do is to understand how the data is read. Memory is the address of the storage unit, read by the CPU by addressing the location of the memory of a cell storage space to obtain data. Therefore, virtual memory is artificially divided into multiple segments of the memory, respectively, allocated to each virtual machine, each virtual machine can only use the memory within its own address range , the remaining memory is allocated to the host.
The virtualization of I/O is rather difficult. For example, the input device keyboard is not possible for multiple virtual machines as well as the host, so it can only be used like "tick", keyboard or mouse control between the virtual machine and the host switch is through " capture " to achieve.
In addition, the network card virtualization is through the software, for each virtual machine virtual out network cards, these network cards will eventually correspond to the physical network card.
OK, the idea of creating a virtual machine is probably over, so what about the steps to create a virtual machine? There are two major steps, one is virtual out of a physical machine, and the other is to install the OS for this physical machine.
virtual out of a physical machine refers to the virtual hardware part of the meaning , according to the above mentioned, mainly virtual out CPU, Memory, I/O (Disk,ethercard, etc.). For example, specify how many cpu,cpu have several cores, how much memory, how many hard disks are, what format these hard drives are, how many network cards are available, and what format they are. After this step, the physical machine is virtual, but we know that if there is no software running on these hardware, then the hardware is equivalent to a heap of scrap metal, so we also have to install the operating system for this physical machine .
To expand a little further, during the process of creating a virtual machine, the virtualization of the hard disk or the virtualization of the disk is implemented through a disk image file, which is used as a hard disk or disk for one or more files. So the question is, how do you use the file as a disk? This is the meaning of this software for virtualization, such as VMware Workstation. This software can be virtual out of the hard disk controller through an interface, the controller can use the file as a disk, and not only can specify the size of the hard disk file, but also support the sparse format (sparse). What is sparse format? For example, when we created the virtual machine, we specified that the VM's hard disk was 20G, but actually the hard disk file we saw on our computer just showed 20k, resulting in the size of the virtual machine's hard disk being inconsistent with the size of the space occupied on the host, which is sparse format (sparse). And this 20k will continue to grow with our needs and our virtual machines, such as from 20k to 4G, to 10G, and so on.
The following is an example of creating a virtual machine in VMware Workstation Pro:
(1) First open the software and click Create virtual Machine .
(2) In order to meet individual needs, it is recommended to choose Custom (Advanced).
(3) The hardware compatibility is backwards compatible, you can choose a compatible version, here is the default option.
(4) Select Install OS later.
(5) The meaning of the operating system chosen here is that because of the different OS requirements for the hardware and some configurations , it is possible to select the matching client operating system at the virtual physical machine so that the hardware can be optimized more specifically .
(6) Select 64 bits if the host supports hardware virtualization.
(7) Here the virtual machine name is the label of the virtual machine, can be set arbitrarily, but generally set to the operating system version name for easy identification.
The location is where the disk image files are created.
(8) Specify how many CPUs, how many cores a CPU. Note that multiplying the two cannot exceed the number of physical machine cores.
(9) Specify the memory of the virtual machine, regardless of the host memory, it is recommended to specify 512MB or 1024MB.
(10) Specify the network type, where nat mode is selected.
(11) Default.
(12) Note that the FAT32 partition cannot hold a single file larger than 4G. Note: It is not recommended to select "Allocate all disk space now", otherwise the sparse format is not supported.
(13) Specify the disk image file name.
。
(14) The hardware settings can be re-adjusted after the physical machine is created.
(15) For unwanted hardware can be removed, the required hardware can be added, or edit the hardware settings.
(16) If the CPU supports hardware virtualization , you can select this option.
(17) Click on, press the combination of "Ctrl+alt+insert" can be restarted, power on F2 key to enter the BIOS interface.
Finally, there is only one step left to install the system!
VMware Virtualization Technology creates virtual machines