📜 ⬆️ ⬇️

Installing and configuring CentOS Linux 5.5 under Hyper-V

Let's continue the series of articles on the launch of Unix and Linux systems under Hyper-V R2. Today we will see how to install and configure CentOS 5.5 running our virtualization system. Why exactly CentOS? Quite simply, it is the most popular among RedHat fans of similar distributions.

For those who are too lazy to read, I can say that CentOS works very well under Hyper-V and is ready for use in a production environment. By the way, everything I write below can be applied with the same success for RHEL.

Well, let's get started?

')
Create a virtual machine. And add to it the network adapter Legacy. It is useful for us to update CentOS and to install the components of the integration of Hyper-V.

Centos_hyperv_network_settings

Run the OS installation. In order for the testing script to be the most realistic, we will use dynamic hard disks VHD. Please note that the guest system works fine with disks up to 2 TB. The use of dynamic disks automatically expanding when necessary will help us more realistic to calculate the average performance of disk operations.

Centos_2TB_VHD_Disk

Also in the installation process, you can configure the network interface Legacy. Centos_legacy_network_dhcp_settings

After that, the OS installation is performed, as well as on ordinary physical equipment. After the installation is completed and the first reboot, we enter the guest system and check the network operation. Centos_legacy_network

Centos_legacy_network_test

Now we have a network adapter with a speed of 100 Mbps. For many tasks this is enough, but you want higher speeds? Soon we will come to this.

Please note that even without integration services with Hyper-V, the system is able to work with several virtual processors. The maximum number of virtual processors 4.

Centos_SMP_Hyperv

As you can see, the basic functionality works quite normally. Now let's get started installing the Hyper-V integration services. What will it give us?



Before installing Hyper-V integration services, update the guest OS through a graphical interface or using the commands:

# yum update
# reboot


Centos_system_update

After a reboot, it would be nice to make a snapshot (snapshot) using Hyper-V, if something goes wrong, we can always roll back.

Now install the kernel headers and developer tools

# yum install kernel-devel
# yum groupinstall "development tools"


Download integration services for Hyper-V unpack them and connect the ISO to the guest CentOS.

We assemble and install core modules for synthetic devices.

# mkdir /opt/linux_is
# cp -R /media/CDROM/* /opt/linux_is
# cd /opt/linux_is
# make
# make install


Check that the modules are loaded using the command

# lsmod | grep vsc

Centos_hyperv_integration_services

Turn off the guest OS using poweroff. Remove the Legacy network adapter from it and add a synthetic adapter. We start OS and we configure the new network adapter seth0.

Centos_hyperv_synthetic_device_netwok

Now you can test the speed of the synthetic network adapter using iperf.

Centos_synthetic_network_speed

As you can see, the speed on the network interface seth0 is on average 492.5 Mbit / s. Pretty good result for a virtual machine.

Unfortunately, Hyper-V can only boot the guest OS from IDE disks, so it is recommended that only the / boot partition be located on them. For all other partitions, it is recommended to use SCSI disks as hard disks. In this case, we can achieve a much higher speed.

Centos_scsi_disk

Centos_scsi_disk_benchmark

If you need to do so, by connecting via RDP to the Hyper-V console, you can control the CentOS using the mouse in graphical mode, we install the driver of the synthetic mouse device.

Download them from the Citrix Satori project page, attach the ISO file to the virtual machine, copy the sources, and install the compiled driver.

# mkdir /opt/mouse_is
# cp -R /media/CDROM/* /opt/mouse_is
# cd /opt/mouse_is
# ./setup.pl inputdriver


At this installation of all components of the integration can be considered complete.

Let's take a look at how CentOS feels like in real big production environments. For this, I gave him the resources that were available on the test server - 44 GB of RAM and 4 processors. Unfortunately, I did not have more resources. It would be interesting to see how CentOS feels if you give it 2TB of RAM.

Centos_45gb_memory_4_cpu Centos_45gb_memory_4_cpu_1

Then, over several days, using scripts running in several threads, I created dd files up to 2TB in size and downloaded them via ftp and scp to another server. Any problems and failures were not found.

Therefore, I conclude that CentOS can be used as a virtual system under Hyper-V for projects with a rather heavy load.

Source: https://habr.com/ru/post/113993/


All Articles