Application example of using RHCI to build redhat training environment

Source: Internet
Author: User
Tags local time locale python script


Before the operation, the face to find a large U disk (according to what to configure the practice of the environment) make U disk boot installation tools, I am here to prepare a 128G u disk. In addition, we need to download the following packages from the relevant network of Red Hat:



* RHCIFOUNDATION-RHEL7-*.ICMF (manifest file)
* Rhel-7.x-*-server-x86_64-dvd1.iso (RHEL 7.x DVD)
* FOUNDATION-CONFIG-7.X-*.RPM (student/instructor rpm)
* FOUNDATION0-CONFIG-7.X-*.RPM (instructor rpm)
* REDHAT-SURVEY-7*.RPM (survey rpm)
* RHCI-FOUNDATION-7.X-*.ISO (RHCI CD-ROM ISO)
* rht-usb-7.x-*.py (USB creator script)
* Classroomsetup-7.x-*.txt (Day instructions)
* Classprep-7.x-*.txt (This document)




First, U disk boot installation of the production



1. Document Preparation



First find a Linux host, all need to install the program needs of the virtual machine files, ISO files, ICMF files and so on to collect, and save to a directory, as follows:



I will keep all of them in the/content directory, and then insert a U disk (do not mount), Fdisk-l view can identify the line.



2, Format the U disk for EXT4



Format the U disk in EXT4 format with the following command:



# PARTPROBE/DEV/SDB
# MKFS.EXT4/DEV/SDB1



Above this step notice, you u disk display partition name is what write what, a lot of U disk identify is/DEV/SDB4, here on MKFS.EXT4/DEV/SDB4.



Create the/root/.icrm/config.yml file and write the following in the file:



---

Repository:/root/.icrm/repository
Repository:/content

Notice, don't forget the horizontal line above.




3, RHT-USB format u disk



Use the Rht-usb Python script format USB disk that is downloaded above, as follows:


[Root@foundation0 content]# rht-usb-xxxx.py USBFORMAT/DEV/SDB1



The following XXXX is the version of your download. During the execution there will be confirm reformatting/dev/sdb1, press Y to confirm.



Second, environmental installation



The first is the RHCI-related mirroring and configuration, or the rht-usb.py script (where I renamed the script Rht-usb, followed by this), as follows:


# RHT-USB Usbadd RHCIFOUNDATION-RHEL71-3.R31619-ILT-7-EN_US.ICMF



Where ICMF is a configuration file that is used to find other packages and files associated with the course during installation. This file can be opened directly through the text view commands such as VIM, I will only take a part of the file for you to look at:


[Root@foundation0 manifests]# pwd
/content/manifests
[Root@foundation0 manifests]# more RHCIFOUNDATION-RHEL71-3.R31619-ILT-7-EN_US.ICMF
---
Manifest Version:1
Curriculum:
Name:rhcifoundation
release:3.r31619
DESCRIPTION:RHCI Foundation Hypervisor Layer Files
Technology:rhel71
Modality: [ILT]
Generation:7
Locale: [en_US]
Publish date:2015-06-02 16:05:38-04:00
Publisher:rlocke
Artifacts:
-Filename:rhel-server-7.1-x86_64-dvd.iso
Type:content
Content Type:iso
Target Directory:rhel7.1/x86_64/isos
Final Name:rhel7.1/x86_64/dvd
Usage: [Classroom]
checksum:370662c78e36528bbaf3f2b901c29d6f
-filename:foundation-config-7.1-3.r31619.noarch.rpm
Type:content
Content Type:file
Target Directory:rhel7.1/x86_64/extras/packages
Usage: [Classroom]
Checksum:190355331d12cf245e83b90abfcca9a5
........................ Omitted



Once the write is complete, we then write the same way through the ICMF file to the files required by the other courses, as follows:


# RHT-USB Usbadd RH442-RHEL70-2.R29766-ILT-7-EN_US.ICMF
For example, I have the following relevant Red Hat curriculum environment, will be the following corresponding ICMF all according to the above method to execute again:




After all the written, U disk production was completed.



Third, the host installs the deployment



In the need to install the environment of the server or PC plug U disk, choose U disk boot--here can actually be able to rhci-foundation-xx.iso file boot installation.



Foundation0 Install



After the boot, we enter "F0 Course code return" to start installing the course's environment. The installation process is similar to the Redhat OS installation and requires only the time zone and partition items to be selected to complete the installation.



As the above installation we have only deployed one of the courses of the environment, to the U disk all the courses on the environment to deploy to a host, you can, after the installation is completed into the system to install additional courses.




Note that the U disk inserted in the host, do not mount, mount the installation course will be an error. To install which door, support the implementation of RHT-USB COURSEUSB course code on the line.



Fourth. Rht-related directives



The foundation0 that we installed above is the teacher machine, is also a student machine. Other hosts within the local area network can install the corresponding student training machine via PXE. At the same time, Red Hat itself in order to facilitate the practice, difficult to pass, and so on, also provides a set of RHT related instructions, very convenient, as follows:



1, rht-verify-f0



This command verifies that there is a problem with the Foundation0 installation:


[Root@foundation0 ~]# rht-verify-f0
Hardware (compare to hardware Requirements for course)
CPU Cores:4 CPU flags:nx LM vmx ept vpid
Total ram:16g Total disk:968g
Virtualization Enabled
Confirm hardware requirements ....... Pass
Test for required hostname ......... Pass
Test for required packages ......... Pass
Slave Interfaces of Br0:enp3s0 Vnet0
Warning:br0 slave (ENP3S0) speed detected is 100mb/s
Warning:none of br0 slaves are GigE
Slave Interfaces of Br1:vnet1
Confirm Current network Settings ..... Pass
Test for active services and sockets ... Pass
Warning:only Foundation manifest found
Cl220-cf31-1.r30561-ilt-7-en_us.icmf
Cl280-ose21-1.r27797-ilt-7-en_us.icmf
Do280-ose30-1.r34582-ilt-7-en_us.icmf
Rh236-rhstor30-4.r34927-ilt-7-en_us.icmf
Rh254-rhel70-2.r31095-ilt-7-en_us.icmf
Rh270-rhel71-1.r30566-ilt-7-en_us.icmf
Rh318-rhev35-1.r31286-ilt-7-en_us.icmf
Rh436-rhel71-2.r34386-ilt-7-en_us.icmf
Rh442-rhel70-2.r29766-ilt-7-en_us.icmf
Rhcifoundation-rhel71-3.r31619-ilt-7-en_us.icmf
Confirm existence of the manifests ..... Pass
Keyboard--vckeymap=us--xlayouts= ' US '
Lang en_US. UTF-8
TimeZone Asia/shanghai--ISUTC
Confirm locale Settings ........... ... Pass
Current local time:tue APR 22:31:59 CST 2016
Correct as needed the local time .... Pass
Foundation0-ose-3.0-1.r34582.x86_64
Foundation0-rhstor-3.0-1.r30734.x86_64
Foundation0-rh442-7.0-1.r29766.x86_64
Foundation0-atomic-7.1-1.r30566.x86_64
Foundation0-rhev-3.5-1.r31286.x86_64
Foundation0-rhelha-7.1-1.r34386.x86_64
Foundation0-cfme-3.1-1.r30535.x86_64
Test for Course packages ........... Pass
Rht_venue=ilt
Rht_enrollment=0
Rht_role=foundation
rht_course=rh270
rht_title= "Managing containers with Red Hat Enterprise Linux Atomic Host"
rht_vms= "Workstation ServerA serverb ServerC serverd"
Rht_maxstations=20
rht_vm0= "Classroom"
Rht_hvms= ""
Rht_vmtree=atomic7.1/x86_64
Confirm course settings ........... ... Pass
SUMMARY: [pass=10] [warning=2] [fail=0] * * *



2, Rht-setcourse


Use this command to easily switch between multiple environments, as follows:


[Root@foundation0 ~]# Rht-setcourse rh270
Course set to rh270


The above will be the practice environment cut to docker this course.



3, Rht-pushcourse



Push the practice environment to the learning machine (actually push the corresponding virtual machines)



[Root@foundation0 ~]# Rht-pushcourse 7
Preparing to push to foundation7.ilt.example.com ...



The top is for the number 7th machine push.



4, Rht-vmctl



When you practice, the student will often put things wrong in the practice environment of the machine, and you can reset the practice environment through this command.


[Root@foundation0 ~]# rht-vmctl fullreset ServerA
[Root@foundation0 ~]# rht-vmctl Fullreset All


You can reset one of them, or you can reset all of them. The principle is that from the teacher machine wget qcow2 virtual machine files, the practice environment is based on the bottom of the KVM virtual machine.


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.