Build KVM server platform, network and storage, public and private key building based on CentOS 6.5

Source: Internet
Author: User

1. What is Virtualization
Virtualize a computer into multiple logical computers with virtualization technology. Each logical computer can have a different operating system that is independent of each other and does not interfere with each other.
2. What virtual machine
A software platform that runs operating systems and applications like a physical machine
3. The current mainstream virtualization products
Vmware
Micosoft
Citrix

RedHat

4.KVM Network Settings
Nat Mode (default)
KVM Virtual machine NIC Select NAT, gateway to the host's intranet 192.168.1.1, it can directly access the extranet.
Routing mode (host turns on routing forwarding)
Host hosts act as routers, the guest host gateway points to the IP of the host host connected to the network card, the packet can be sent to the external network, but if the external host responds to the packet, it must have a route to the guest host network.
Isolation mode
All hosts connected to the isolated mode switch can communicate with each other, but cannot access the external network
Bridging mode
The guest host and host hosts are connected on the same switch, so long as the IP address is in the same network segment, the guest host and all hosts on the host network can communicate directly

Experiment (I.)

Experimental purpose: Build a KVM server platform based on CentOS 6.5

Lab Environment:
KVM Virtualization server, real machine or high provisioning virtual machine (memory >4g)
Host Name: FXHLJ
Partitioning Example:
/boot 200MB, SWAP 8GB,/100GB,
/data 30GB (Logical volume/data/vg_data/lv_data)
Operating system: CentOS 6.5 ==> shut down Iptables firewall, turn off selinux mechanism, go to graphical desktop
==> Close NetworkManager Service

To experiment with installing KVM virtualization conditions:
First CPU to support virtualization (Intel is Vmx,amd is SVM)
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/6F/wKiom1XP-nfAUxtoAABZcu2j76E087.jpg "title=" Qq20150816104844.jpg "alt=" wkiom1xp-nfauxtoaabzcu2j76e087.jpg "/> Ensure that VT is turned on in the BIOS
Intel (R) Virtualization Tech [Enabled]

Installing KVM virtualization-related software, enabling services

1. See if Yum is available

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6F/wKiom1XP_dGSF0apAAAp8OxhZmU113.jpg "title=" Qq20150816110310.jpg "alt=" Wkiom1xp_dgsf0apaaap8oxhzmu113.jpg "/>

2. View the package group (the language is modified in English)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/6F/wKiom1XP_gbQqyhWAAA-T4q7i5o921.jpg "title=" Qq20150816110402.jpg "alt=" Wkiom1xp_gbqqyhwaaa-t4q7i5o921.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/6C/wKioL1XQAHPwKS7pAABc9KtS-rE386.jpg "title=" Qq20150816110544.jpg "alt=" Wkiol1xqahpwks7paabc9kts-re386.jpg "/>

3. Install the package group

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6C/wKioL1XQAnjiQcGwAAC-r2fWC14872.jpg "title=" Qq20150816111421.jpg "alt=" Wkiol1xqanjiqcgwaac-r2fwc14872.jpg "/>

4. Start the service

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6F/wKiom1XQAKTTPoXoAABOCSFNaUg779.jpg "title=" Qq20150816111513.jpg "alt=" Wkiom1xqakttpoxoaabocsfnaug779.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6C/wKioL1XQAsuRiiIvAABGkf8gaCw016.jpg "title=" Qq20150816111545.jpg "alt=" Wkiol1xqasuriiivaabgkf8gacw016.jpg "/>

5. Invoking the graphical interface

Operate on a live machine (the following interface appears after you enter this command)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6C/wKioL1XQBJnBKwVlAAAvagIcnhQ978.jpg "title=" Qq20150816112254.jpg "alt=" Wkiol1xqbjnbkwvlaaavagicnhq978.jpg "/>


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6F/wKiom1XQAjmDbLRBAAD6UhYDrDU503.jpg "title=" Qq20150816112156.jpg "alt=" Wkiom1xqajmdblrbaad6uhydrdu503.jpg "/>


Experiment (II)

Experimental purpose: Configuration of host network and storage

Add VIRBR1 Isolation Interface

1. "Virtual System Manager"--"edit"-"Connection Details"
。。。。 Click the "+" sign .... Network1 .... 192.168.4.0/24
Do not enable KVM-brought DHCP
!!!! Avoid conflicts with VMware Workstation virtual network adapters

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6C/wKioL1XQFg3Bn2afAAEACN70uoU223.jpg "title=" Qq20150816123751.jpg "alt=" Wkiol1xqfg3bn2afaaeacn70uou223.jpg "/>

The following interface appears (click Virtual Network) and click on the + sign below

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/6F/wKiom1XQFEGh2-pnAAFkT27Dx4k942.jpg "title=" Qq20150816123845.jpg "alt=" Wkiom1xqfegh2-pnaafkt27dx4k942.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/70/wKiom1XQFKHjCVYlAAFg7wsEXLI085.jpg "title=" Qq20150816124022.jpg "alt=" Wkiom1xqfkhjcvylaafg7wsexli085.jpg "/>

Click Forward

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/6C/wKioL1XQFvrgiAJIAAFA3yn8cPw186.jpg "title=" Qq20150816124140.jpg "alt=" Wkiol1xqfvrgiajiaafa3yn8cpw186.jpg "/>

Add Network Name NETWORK1 Press forward

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/70/wKiom1XQFUGwk4YoAAD4yMidCac294.jpg "title=" Qq20150816124239.jpg "alt=" Wkiom1xqfugwk4yoaad4ymidcac294.jpg "/>

Select the virtual network for the 1 segment, the primary and your PXE environment in a network segment, if not a network segment is not installed, press forward.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/9D/wKiom1XUbuSx1GnGAAFufh9hJP0518.jpg "title=" Qq20150819195239.jpg "alt=" Wkiom1xubusx1gngaafufh9hjp0518.jpg "/>

By default, do not turn on DHCP to avoid the impact of VMware Workstation virtual network cards

Press forward to create an isolated network

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/99/wKioL1XUcWWRcyUOAAEXAHtrVWQ936.jpg "title=" Qq20150819195615.jpg "alt=" Wkiol1xucwwrcyuoaaexahtrvwq936.jpg "/>

Click Done.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/99/wKioL1XUcZvhvyCJAAEMRg6Dvbs089.jpg "title=" Qq20150819195723.jpg "alt=" Wkiol1xuczvhvycjaaemrg6dvbs089.jpg "/>


View the network information you created.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/6C/wKioL1XQGa6CYVPVAAC7H-Yyiz4027.jpg "title=" Qq20150816125313.jpg "alt=" Wkiol1xqga6cyvpvaac7h-yyiz4027.jpg "/>

2. Confirm the newly added virtual network card
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/70/wKiom1XQGyLyKQpZAAAt8j7HG6M677.jpg "title=" Qq20150816130813.jpg "alt=" Wkiom1xqgylykqpzaaat8j7hg6m677.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/99/wKioL1XUcnaCp7BmAAJk5dsiqeA468.jpg "title=" Qq20150819200101.jpg "alt=" Wkiol1xucnacp7bmaajk5dsiqea468.jpg "/>

3. Establish Bridge adapter Br0 (the default bridge is not, you need to build it manually)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/6C/wKioL1XQH7nzMZPsAACMGsZHsog141.jpg "title=" Qq20150816131910.jpg "alt=" Wkiol1xqh7nzmzpsaacmgszhsog141.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/6E/wKioL1XQOW3ifbI-AAElQzDOwLE844.jpg "title=" Qq20150816150849.jpg "alt=" Wkiol1xqow3ifbi-aaelqzdowle844.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/71/wKiom1XQN5fin7FTAAEizLqPZs4023.jpg "title=" Qq20150816150940.jpg "alt=" Wkiom1xqn5fin7ftaaeizlqpzs4023.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/9D/wKiom1XUcLLQnBF4AAKxo9z9zaE321.jpg "title=" Qq20150819200215.jpg "alt=" Wkiom1xucllqnbf4aakxo9z9zae321.jpg "/>


4. Prepare the virtual machine disk (to prepare storage space for the virtual machine).

Requirements: 1. Create a new 28GB partition on the KVM server

2. Format it and mount it as/data

3. Create a 10GB virtual disk file using DD

To view disk partition conditions

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/85/wKioL1XTJCzTQ0zmAAA0flkQPsA000.jpg "title=" Qq20150818201448.jpg "alt=" Wkiol1xtjcztq0zmaaa0flkqpsa000.jpg "/>

Partitioning a disk

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/89/wKiom1XTImqjV58zAABCOuGy_zI989.jpg "title=" Qq20150818201555.jpg "alt=" Wkiom1xtimqjv58zaabcougy_zi989.jpg "/>

Create a logical partition of 28G

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/85/wKioL1XTJ1TCK_JcAABHb976u_U356.jpg "title=" Qq20150818202819.jpg "alt=" Wkiol1xtj1tck_jcaabhb976u_u356.jpg "/>

Create the/data directory, mount the logical partition to the directory, and mount it automatically as it is powered on.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/85/wKioL1XTKC7yYniJAAAxcSikxss043.jpg "title=" Qq20150818203155.jpg "alt=" Wkiol1xtkc7yynijaaaxcsikxss043.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/89/wKiom1XTJm-TGm0WAACuOMf76io240.jpg "title=" Qq20150818203313.jpg "alt=" Wkiom1xtjm-tgm0waacuomf76io240.jpg "/>

Under/data/, create a directory that is images to hold the virtual machine, and create a file in the images directory to hold the first virtual machine in 10G.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/87/wKioL1XTQ67heTUkAADXb8biVSc429.jpg "title=" Qq20150818222913.jpg "alt=" Wkiol1xtq67hetukaadxb8bivsc429.jpg "/>

Experiment (III)

Experimental Purpose: Install the operating system for the virtual machine and PXE install the operating system.

Open Virtual System Manager

New Virtual machine

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/87/wKioL1XTRMjz-nARAAGeqkA8urE613.jpg "title=" Qq20150818223320.jpg "alt=" Wkiol1xtrmjz-naraageqka8ure613.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/8A/wKiom1XTQtqSrdWCAADveIa4xIc386.jpg "title=" Qq20150818223429.jpg "alt=" Wkiom1xtqtqsrdwcaadveia4xic386.jpg "/>

Since the virtual machine I use has only 1G of memory, choose 512M memory.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/87/wKioL1XTRSShUkwnAADVasBwq04594.jpg "title=" Qq20150818223501.jpg "alt=" Wkiol1xtrsshukwnaadvasbwq04594.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/8A/wKiom1XTQ1GCVv5sAAEJ1wQgCiE568.jpg "title=" Qq20150818223626.jpg "alt=" Wkiom1xtq1gcvv5saaej1wqgcie568.jpg "/>

Select the isolated network and click Done.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/9D/wKiom1XUcS6T9zxfAAGIVWQCevU870.jpg "title=" Qq20150819200416.jpg "alt=" Wkiom1xucs6t9zxfaagivwqcevu870.jpg "/>

The error that occurs when you install the PXE system, the solution (DHCP gets no IP address), starts the DHCP service from a new start.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/99/wKioL1XUc-7gE2i_AAD_1wJ7w20592.jpg "title=" Qq20150819200720.jpg "alt=" Wkiol1xuc-7ge2i_aad_1wj7w20592.jpg "/>

Display error cannot load TFTP file, change network to virtual isolated network, adjust the contents of KS file, such as partition information, can be resolved.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/9D/wKiom1XUczrjeq-rAAFQiguYdIY146.jpg "title=" Qq20150819201036.jpg "alt=" Wkiom1xuczrjeq-raafqiguydiy146.jpg "/>

Finally, you can install the system directly by having your own Edit menu.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/9D/wKiom1XUdAqCTXsKAAKMDOVSJFI758.jpg "title=" Qq20150819201223.jpg "alt=" Wkiom1xudaqctxskaakmdovsjfi758.jpg "/>


Select Install the system and load the boot file and kernel files (as shown).

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/99/wKioL1XUeDygkCkbAABN_k-B8xk891.jpg "title=" Qq20150819202459.jpg "alt=" Wkiol1xuedygkckbaabn_k-b8xk891.jpg "/>

When the PXE environment is installed, the required kernel files and boot files are automatically checked.

Note : (1. Be careful to check the contents of your KS files, especially if the hard drive and your virtual If inconsistencies change the hard drive size of the KS file and you give the virtual machine the hard drive to consistent. 2 to check the contents of the/var/lib/tftpboot/pxelinux.cfg/default file KS file is the KS file you need).


Experiment (IV)

Experimental purpose: The host OS ssh Guest OS does not need to enter a password
Management machine (private key)--KVM Server (public key)

1. Create the SSH key pair on the physical machine and deploy the public key file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/E8/wKiom1XaoIjiss7XAAESPph4rO4054.jpg "title=" Qq20150824124402.png "alt=" Wkiom1xaoijiss7xaaespph4ro4054.jpg "/>

2. Upload the generated public key to the virtual machine. 192.168.1.30 as a virtual machine

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/E8/wKiom1XaoPzj3N8OAABpgwxs-f4154.jpg "title=" Qq20150824124605.png "alt=" Wkiom1xaopzj3n8oaabpgwxs-f4154.jpg "/>

3. Testing

Make an alias on the physical Machine goa= "ssh-x [email protected]"

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/E4/wKioL1Xao2-C2n97AAEMtOtmS0k967.jpg "title=" Qq20150824124756.png "alt=" Wkiol1xao2-c2n97aaemtotms0k967.jpg "/>

Direct physical machine with Goa direct access to the virtual machine

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/E8/wKiom1XaoaqSO_hiAAE2C17l3PQ283.jpg "title=" Qq20150824124915.png "alt=" Wkiom1xaoaqso_hiaae2c17l3pq283.jpg "/>
















This article is from the "Down to earth" blog, make sure to keep this source http://343614597.blog.51cto.com/7056394/1687587

Build KVM server platform, network and storage, public and private key building based on CentOS 6.5

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.