RHCA CL220 The KVM deployment of the real-combat series (i) cloudforms

Source: Internet
Author: User
Tags openvswitch

1. Overview

Red Hat has launched a hybrid cloud cloudforms solution, Redhat's mission is to achieve a centralized management platform through Cloudforms's ability to manage all infrastructure facilities such as Rhev,vmware and the Cloud (AWS and OpenStack). Cloudforms by engine engines, Vmdb virtual database and so on, which engine as the core function of cloudforms, responsible for the daily management of Cloudforms.

CloudForms engine, abbreviated as CFME, is a well-established virtual machine that can be deployed quickly to CloudForms environments by deploying the virtual machine. Because it is a virtual machine, depending on the environment, can be deployed on the non-virtualized platform, and based on the virtual platform is not available, from the virtual machine, such as VMware Platform, Rhev platform, OpenStack platform. This article takes the deployment of KVM as an example to describe the deployment of cloudforms Egine.


2. Deploy cloudforms via KVM

    1. Create and modify configuration files for a virtual machine

[Email protected]_10_16_2_9 ~]# cp/etc/libvirt/qemu/centos-5.9.xml/etc/libvirt/qemu/cfme.xml

Modify the following content:

A, name <name>cfme</name>

B, UUID <uuid>ba845a90-8670-4b89-9451-3a111372950c</uuid> generate a new number via Uuidgen

C, Memory <memory unit= ' KiB ' >4194304</memory>

D, CPU <vcpu placement= ' static ' >4</vcpu>

E, boot sequence <boot dev= ' HD '/>

F, Disk File

<disk type= ' file '  device= ' disk ' >                                                       #磁盘类型为file     <driver name= ' qemu '  type= ' qcow2 '  cache= ' None '/>                                 # Drive type and format     <source file= '/var/lib/libvirt/images/cfme.qcow2 '/>                               #磁盘文件路径, extracting from Cloudforms for     <target  dev= ' Vda '  bus= ' virtio'/>                                                  #磁盘名字和总线类型为virtio      <address type= ' PCI '  domain= ' 0x0000 '  bus= ' 0x00 '  slot= ' 0x04 '  function= ' 0x0 '/ >    @@@ Note that to remove @@@, the bus address will conflict </disk><disk type= ' file '  device= ' disk ' >    <driver name= ' qemu '  type= ' qcow2 '  cache= ' None '/>     <source file= '/var/lib/libvirt/images/cfme_vdb.qcow2 '/>     # The disk is located on the path, subsequent creation     <target dev= ' VDB '  bus= ' virtio '/>                               #磁盘为vdb </disk> 

G, network card

<interface type= ' network ' > <mac address= ' 52:54:00:00:00:0c '/> #mac地址 <source network= ' Br-eth0 ' /> #桥接网卡, @@ Note @@@ Here is the OvS Bridge, if the KVM Bridge, please modify the br0 <virtualport type= ' Openvswitch ' ></virtualport>    ; #由于使用openvswitch网桥, need to add, br0 do not <model type= ' Virtio '/></interface>

H, VNC

<graphics type= ' vnc ' port= '-1 ' autoport= ' yes ' listen= ' 0.0.0.0 ' > #用于VNC连接 to prevent no graphical interface <listen type= ' address ' address= ' 0.0.0.0 '/></graphics>

After the

has been modified, the contents of the virtual machine's configuration file are as follows:

Cat /etc/libvirt/qemu/cfme.xml    <domain type= ' KVM ' >  <name >cfme</name>  <uuid>ba845a90-8670-4b89-9451-3a111372950c</uuid>  < memory unit= ' KiB ' >4194304</memory>  <currentmemory unit= ' KiB ' >4194304</ currentmemory>  <vcpu placement= ' Static ' >4</vcpu>  <os>     <type arch= ' x86_64 '  machine= ' rhel6.5.0 ' >hvm</type>     <boot dev= ' HD '/>  </os>  <features>     <acpi/>    <apic/>    <pae/>  </ Features>  <clock offset= ' UTC '/>  <on_poweroff>destroy</on_poweroff >  <on_reboot>restart</on_reboot>  <on_crash>restart</on_crash>   <devices>    <emulator>/usr/libexec/qemu-kvm</emulator>    < Disk type= ' file '  device= ' disk ' >      <driver name= ' QEMU '  type= ' Qcow2 '  cache= ' None '/>      <source file= '/var/lib/ Libvirt/images/cfme.qcow2 '/>      <target dev= ' VDA '  bus= ' virtio ' />    </disk>    <disk type= ' file '  device= ' disk ' >      <driver name= ' qemu '  type= ' qcow2 '  cache= ' None '/>       <source file= '/var/lib/libvirt/images/cfme_vdb.qcow2 '/>       <target dev= ' vdb '  bus= ' virtio '/>    </ Disk>    <controller type= ' USB '  index= ' 0 ' >       <address tYpe= ' PCI '  domain= ' 0x0000 '  bus= ' 0x00 '  slot= ' 0x01 '  function= ' 0x2 '/>     </controller>    <controller type= ' IDE '  index= ' 0 ' >       <address type= ' PCI '  domain= ' 0x0000 '  bus= ' 0x00 '  slot= ' 0x01 '  function= ' 0x1 '/>    </controller>    <interface  type= ' network ' >      <mac address= ' 52:54:00:00:00:0c '/>       <source network= ' Br-eth0 '/>       <virtualport type= ' Openvswitch ' ></virtualport>      <model  type= ' Virtio '/>    </interface>    <serial type = ' pty ' >      <target port= ' 0 '/>    </serial >    < Console type= ' pty ' >      <target type= ' serial '  port= ' 0 '/ >    </console>    <input type= ' tablet '  bus= ' usb '/>    <input type= ' mouse '  bus= ' PS2 '/>    < Graphics type= ' VNC '  port= '-1 '  autoport= ' yes '  listen= ' 0.0.0.0 ' >       <listen type= ' address '  address= ' 0.0.0.0 '/>    </graphics >    <video>      <model type= ' Cirrus '  vram= ' 9216 '  heads= ' 1 '/>      <address type= ' PCI '   domain= ' 0x0000 '  bus= ' 0x00 '  slot= ' 0x02 '  function= ' 0x0 '/>    </video >    <memballoon model= ' Virtio ' >      < Address type= ' PCI '  domain= '0x0000 '  bus= ' 0x00 '  slot= ' 0x05 '  function= ' 0x0 '/>    </memballoon>   </devices></domain>

2. Get the cloudforms virtual machine

In order to make it easy for everyone to use, I have placed the connection path in the network disk: Network address: Http://pan.baidu.com/s/1hrrmtec

3. Unzip the CFME virtual machine

[[email protected] cfme]# tar -xvf cfme-rhevm-5.3-47.x86_64.rhevm master/master/ vms/master/vms/e6b971c2-14bf-43e3-ad38-36d9702afb54/master/vms/e6b971c2-14bf-43e3-ad38-36d9702afb54/ e6b971c2-14bf-43e3-ad38-36d9702afb54.ovfimages/images/a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/images/ a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/143fbb49-1441-4a1a-beaf-f9c6433f3566.metaimages/ a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/143fbb49-1441-4a1a-beaf-f9c6433f3566              #CloudForms的磁盘镜像文件 That's the file # Copy the Cfme file to the KVM virtual machine directory and change the name [[email protected]  cfme]# ll -h images/a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/ 143fbb49-1441-4a1a-beaf-f9c6433f3566-rwxr-xr-x 1 root root 2.0g jan  9   2015 images/a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/143fbb49-1441-4a1a-beaf-f9c6433f3566[[email  protected] cfme]# mv images/a2dd2ac4-7a94-4c90-9c86-6a45477cbbb9/143fbb49-1441-4a1a-beaf-f9c6433f3566 /var/lib/libvirt/images/cfme# Create a Backing file connection based on a disk image file,backing  File is similar to a soft link under Linux, is a read-only file, the incremental write content, will be saved to the new file, this article is cfme.qcow2 [[email protected] cfme]# qemu-img  create -f qcow2 -b /var/lib/libvirt/images/cfme /var/lib/libvirt/images/ cfme.qcow2formatting  '/var/lib/libvirt/images/cfme.qcow2 ', fmt=qcow2 size=42949672960  Backing_file= '/var/lib/libvirt/images/cfme '  encryption=off cluster_size=65536 [[email  protected] cfme]# qemu-img info /var/lib/libvirt/images/cfme.qcow2image: /var/lib/ libvirt/images/cfme.qcow2file format: qcow2virtual size: 40g  (42949672960 bytes) disk size: 200kcluster_size: 65536backing file: /var/lib/libvirt/images/cfme          #基于该文件, built Bakcing-file, enables fast clone# to build another disk [[email protected]  cfme]# qemu-img create -f qcow2 /var/lib/libvirt/images/cfme_vdb.qcow2 10g          #名字和路径, need to be consistent with the configuration file formatting  '/var/lib/libvirt/images/cfme_vdb.qcow2 ',  fmt=qcow2 size= 10737418240 encryption=off cluster_size=65536 [[email protected] cfme]# qemu-img  info  /var/lib/libvirt/images/cfme_vdb.qcow2image: /var/lib/libvirt/images/cfme_ vdb.qcow2file format: qcow2virtual size: 10g  (10737418240 bytes)           #10G的空间disk  size: 140kcluster_size: 65536

4. Start the virtual machine and get the port number for VNC

[[email protected] ~]# virsh create /etc/libvirt/qemu/cfme.xml          #加载到KVM域内Domain  cfme created from /etc/libvirt/qemu/cfme.xml [[email protected] ~]# virshwelcome to virsh, the virtualization  Interactive terminal. type:   ' Help '  for help with commands        ' Quit '  to quitvirsh # list --all Id    Name                             state---------------------------------------------------- 6      cfme                            runningvirsh #  Vncdisplay cfme                                   # View VNC's port number, which is 5900:0[[email protected] ~]# ifconfig br-eth0   link encap: ethernet  hwaddr 00:e0:81:df:9c:db             inet addr:10.16.0.60  Bcast:10.16.1.255  Mask:255.255.254.0          #KVM母机的ip地址, use this address and the VNC port to connect to the virtual machine            inet6 addr: fe80::5849:18ff:fee2:5c4e/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500   Metric:1          RX packets:351184814  Errors:0 dropped:0 overruns:0 frame:0          tx packets:234038352  errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           rx  bytes:54255684244  (50.5 gib)   TX bytes:56112174185  (52.2 gib)

5. Connect to the CFME virtual machine using a VNC client

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7A/17/wKioL1aiBk2CyexwAABjBLbCoOI245.png "title=" QQ picture 20160122181933.png "alt=" Wkiol1aibk2cyexwaabjblbcooi245.png "/>

The configuration is successful, the interface is as follows, the default USERNAME:ADMIN,PASSWORD:SMARTVM

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7A/18/wKiom1aiBp_gudIJAAEGolNdLgQ540.jpg "title=" QQ picture 20160122183615.jpg "alt=" Wkiom1aibp_gudijaaegolndlgq540.jpg "/>


5. Cloudforms Initialization

Using ADMIN:SMARTVM to log in to the system, you can initialize the operation, the initialization operation includes the following:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7A/18/wKioL1aiB-3Qa0g4AAK4e1EPNj8145.jpg "title=" QQ picture 20160122184210.jpg "alt=" Wkiol1aib-3qa0g4aak4e1epnj8145.jpg "/>

Select 8, configure the database, execute 1 Build key, select internal internal, set the database area to 0, after execution, display the following

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7A/18/wKioL1aiCQnjIhHgAAHLc7akxDs571.jpg "title=" QQ picture 20160122184657.jpg "alt=" Wkiol1aicqnjihhgaahlc7akxds571.jpg "/>

View status information for Cloudforms

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7A/18/wKioL1aiCV6gB5n5AAK-WKIAiiU598.jpg "title=" QQ picture 20160122184830.jpg "alt=" Wkiol1aicv6gb5n5aak-wkiaiiu598.jpg "/>

6. Login Cloudforms

Enter https://10.16.1.197 can login to cloudforms, because it is HTTPS, need to confirm the certificate, confirm the certificate, will go to cloudforms management interface

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7A/18/wKioL1aiCfWAGeaLAALbEz3AvXQ759.jpg "title=" QQ picture 20160122185055.jpg "alt=" Wkiol1aicfwagealaalbez3avxq759.jpg "/>

Enter ADMIN:SMARTVM can login, after landing page content

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7A/18/wKioL1aiDEnxNygkAAEzptXj2SM028.png "title=" QQ picture 20160122190051.png "alt=" Wkiol1aidenxnygkaaezptxj2sm028.png "/>


Complete!!!

This article is from the "Happy Laboratory" blog, reproduced please contact the author!

RHCA CL220 The KVM deployment of the real-combat series (i) cloudforms

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.