RHCA CL220 CloudForms 3.1 配置虛擬機
4provisioning virtual machines
目錄
Provisioning via Native Clone
理論
實驗
Defining ISO Image Type
理論
實驗
Provisioning via Customization Templates
理論
實驗
Provisioning via PXE
理論
實驗
4 provisioning virtual machines
第4章主要是講如何在CFME創建虛擬機,主要有3種方式:native clone/iso/pxe。
主要是2個web界面的內容:
infractructure>virtual machine/PXE創建虛擬機操作界面。
service>request創建虛擬機進度等信息。
Provisioning via Native Clone
理論
1. 概述
基礎設施可以發布資源和管理它們的生命周期。
資源包含:虛擬機/存儲空間/或者其它基礎設施可管理的資源。
通過CFME配置虛擬機有三種方式:template(native clone)/ISO/PXE
2. 如何配置虛擬機?
配置虛擬機有8大選項
request:指虛擬機的管理員信息,例如郵箱,姓名等。
purpose:虛擬機屬於哪個tag,例如一個catelogies可能是一個項目,然後tag是這個項目的標記,指虛擬機屬於哪個項目。
catelog:虛擬機的基本信息,例如多少臺虛擬機,虛擬機是通過哪種方式創建的(模板/ISO/PXE),虛擬機的名字等。
environment:指虛擬機創建在哪,例如哪個集群,運行在哪臺主機,存放在哪個存儲域上等。
hareware:指虛擬機的硬件信息,例如CPU個數,內存多大等。
network:虛擬機所在的網絡。
customize:指定制虛擬機的密碼,IP,DNS等。
schedule:指虛擬機在什麽時候創建,什麽時候開機等。
點提交後會自動跳轉到services>request
實驗
1. 下載rhel的ova模板
2. 將rhel的ova導入到rhevm
3. 在RHEV平臺創建rhev模板
4. 在CFME通過模板配置VM
5. 監控配置信息,配置進度等
6. 檢驗VM是否配置成功
Defining ISO Image Type
理論
1. 概述
另一種配置虛擬機的方式是ISO。
但通過官方的ISO需要手動安裝,無法自動安裝,這裏您需要自定義isolinux中的ks文件,然後生成一個自定義的ISO,使其可以自動安裝。
自定義ISO:
https://jingyan.baidu.com/article/c1a3101eef3ee6de656debb8.html
2. CFME如何配置ISO
首先需要配置ISO datastore。
導航:infrastructure>PXE>ISO datastore添加一個現有的provider(例如RHEV)中的iso。
添加完後需要點刷新”relationship”,才會出現RHEV平臺中的ISO。
接著需要edit它的iso type,這裏我選的rhel6。
iso type可以通過左邊導航的上級選項”system image type”來添加。
3. 通過自定義ISO配置虛擬機
紅帽給的自定義ISO有問題:卡在這裏了
這個自定義ISO會自己創建一個3G的磁盤(和上面的template一樣)。
這裏使用的ISO是rhel-server-6.5-x86_64-custom.iso,其實這只一個引導盤,裏面的KS文件沒啥用。本單元主要是為下個單元做準備。
如果您需要通過自定義ISO配置虛擬機,也可以自己創建自定義的ISO與KS文件。
實驗
1. 下載自定義的ISO
2. 上傳ISO到RHEV平臺
3. 在CFME創建ISO datastore
4. 創建system image type
5. 將剛剛創建的system image type和ISO datastore中的ISO關聯
Provisioning via Customization Templates
理論
1. 概述
在一些企業可能需要一個定制化的虛擬機。
這時您可以通過”自定義模板”來配置虛擬機:
windows:syspre file
linux: ks file
2. 制作自定義光盤
如何做一個定制化的iso,使系統自動根據我們預定義好的參數來安裝系統呢?
這裏需要用到ks文件,並在引導光盤時自動加載ks文件的效果。通過光盤引導系統時會加載光盤中isolinux中的isolinux.cfg,從而得到引導列表,那麽可以在讀取某個引導列表中的選項時自動讀取ks文件,這裏只需將ks文件的路徑加到引導項中就可以實現自動安裝。
下面在F0安裝kickstart工具,然後制作一個最小化安裝的自定義centos7光盤,達到不用人為選擇安裝項,自動安裝定制化系統的效果。
官方centos小最化的鏡像:CentOS-7-x86_64-Minimal-1611.iso
步驟:
yum install -y system-config-kickstart #安裝ks文件制作工具
system-config-kickstart #打開圖形化的ks文件制作工具,制作好後將ks另存為ks.cfg
mkdir /mnt/iso #光盤的掛載目錄
mount /dev/sr0 /mnt/iso/ #將光盤掛載
mkdir hrr #新建一個目錄,用於放從光盤拷貝過來的文件
cp -arp /mnt/iso/* hrr/ #將光盤的文件全部拷貝到新目錄中
vim isolinux.cfg #在isolinux.cfg中定義ks文件路徑,這裏ks.cfg放在hrr目錄中
cat isolinux.cfg #以下是isolinux.cfg的內容
default vesamenu.c32
timeout 600
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title CentOS Linux 7
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label linux
menu label ^Install CentOS Linux 7
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks.cfg quiet
label check
menu label Test this ^media & install CentOS Linux 7
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
menu separator # insert an empty line
# utilities submenu
menu begin ^Troubleshooting
menu title Troubleshooting
label vesa
menu indent count 5
menu label Install CentOS Linux 7 in ^basic graphics mode
text help
Try this option out if you‘re having trouble installing
CentOS Linux 7.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet
label rescue
menu indent count 5
menu label ^Rescue a CentOS Linux system
text help
If the system will not boot, this lets you access files
and edit config files to try to get it booting again.
endtext
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet
label memtest
menu label Run a ^memory test
text help
If your system is having issues, a problem with your
system‘s memory may be the cause. Use this utility to
see if the memory is working correctly.
endtext
kernel memtest
menu separator # insert an empty line
label local
menu label Boot from ^local drive
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
menu label Return to ^main menu
menu exit
menu end
cat ks.cfg #以下是ks.cfg的內容
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard ‘us‘# Reboot after installation
reboot
# Root password
rootpw --iscrypted $6$bzcFPd2HU1t8WiqW$OPm1BKzNNaIPL0HZqTYWzSHk.SMmEO2kWEvujOnza68sdcSlw9kjK1J9OPXmrg.phIcX2Vpo0vGdtkTCjKkmb/
#密碼是redhat
# System timezone
timezone America/New_York
# System language
lang en_US
# Firewall configuration
firewall --disabled
# Network information
network --bootproto=dhcp --device=eth0
# System authorization information
auth --useshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use text mode install
text
firstboot --disable
# SELinux configuration
selinux --disabled
# System bootloader configuration
bootloader --append="biosdevname=0" --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part swap --size=512
part /boot --size=256
part / --grow --size=2072
%post
echo "setterm -blank 0 -powersave off -powerdown 0 > /dev/tty1 < /dev/tty1" >> /etc/rc.d/rc.local
%end
%packages
@Core
libcap
openssh
openssh-clients
openssh-server
%end
# mkisofs -o new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /root/hrr/ #制作定制光盤為啟動盤,這裏使用mkisofs來生成
#-o 指生成的iso文件名
#-b指定哪個文件為光盤光盤自引導啟動的文件(目錄內以.bin結尾的文件)
#-c將boot.cat文件的配置信息顯示出來(目錄內以.cat結尾的文件)
#-no-emul-boot不模仿boot這種引導格式(光盤內沒有MBR不能進行boot格式的啟動)
#-boot-load-size 4 指Set numbers of load sectors
#-boot-info-table 指Patch boot image with info table
#-R指-rational-rock
#-j指-joliet
#-v 顯示進度
#-T 表示需要生成光盤的目錄絕對路徑
[root@foundation0 ~]# mkisofs -o new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /root/hrr/
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage 1.1.11 (Linux)
Scanning /root/hrr/
Scanning /root/hrr/EFI
Scanning /root/hrr/EFI/BOOT
Scanning /root/hrr/EFI/BOOT/fonts
Excluded: /root/hrr/EFI/BOOT/fonts/TRANS.TBL
Excluded: /root/hrr/EFI/BOOT/TRANS.TBL
Excluded: /root/hrr/EFI/TRANS.TBL
Scanning /root/hrr/images
Scanning /root/hrr/images/pxeboot
Excluded: /root/hrr/images/pxeboot/TRANS.TBL
Excluded: /root/hrr/images/TRANS.TBL
Scanning /root/hrr/isolinux
Excluded by match: /root/hrr/isolinux/boot.cat
Excluded: /root/hrr/isolinux/TRANS.TBL
Scanning /root/hrr/LiveOS
Excluded: /root/hrr/LiveOS/TRANS.TBL
Scanning /root/hrr/Packages
Excluded: /root/hrr/Packages/TRANS.TBL
Scanning /root/hrr/repodata
Excluded: /root/hrr/repodata/TRANS.TBL
Excluded: /root/hrr/TRANS.TBL
Using RPM_G000.;1 for /RPM-GPG-KEY-CentOS-Testing-7 (RPM-GPG-KEY-CentOS-7)
Using SYSTE000.RPM;1 for /root/hrr/Packages/systemd-219-30.el7.x86_64.rpm (systemd-libs-219-30.el7.x86_64.rpm)
Using SYSTE001.RPM;1 for /root/hrr/Packages/systemd-libs-219-30.el7.x86_64.rpm (systemd-sysv-219-30.el7.x86_64.rpm)
Using SELIN000.RPM;1 for /root/hrr/Packages/selinux-policy-3.13.1-102.el7.noarch.rpm (selinux-policy-targeted-3.13.1-102.el7.noarch.rpm)
Using PYTHO000.RPM;1 for /root/hrr/Packages/python-backports-1.0-8.el7.x86_64.rpm (python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch.rpm)
Using PYTHO001.RPM;1 for /root/hrr/Packages/python-perf-3.10.0-514.el7.x86_64.rpm (python-pycurl-7.19.0-19.el7.x86_64.rpm)
Using PYTHO002.RPM;1 for /root/hrr/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm (python-pyudev-0.15-7.el7_2.1.noarch.rpm)
Using PYTHO003.RPM;1 for /root/hrr/Packages/python-setuptools-0.9.8-4.el7.noarch.rpm (python-slip-0.4.0-2.el7.noarch.rpm)
Using PYTHO004.RPM;1 for /root/hrr/Packages/python-slip-0.4.0-2.el7.noarch.rpm (python-slip-dbus-0.4.0-2.el7.noarch.rpm)
Using PLYMO000.RPM;1 for /root/hrr/Packages/plymouth-0.8.9-0.26.20140113.el7.centos.x86_64.rpm (plymouth-core-libs-0.8.9-0.26.20140113.el7.centos.x86_64.rpm)
Using PLYMO001.RPM;1 for /root/hrr/Packages/plymouth-core-libs-0.8.9-0.26.20140113.el7.centos.x86_64.rpm (plymouth-scripts-0.8.9-0.26.20140113.el7.centos.x86_64.rpm)
Using PCIUT000.RPM;1 for /root/hrr/Packages/pciutils-3.5.1-1.el7.x86_64.rpm (pciutils-libs-3.5.1-1.el7.x86_64.rpm)
Using P11_K000.RPM;1 for /root/hrr/Packages/p11-kit-0.20.7-3.el7.x86_64.rpm (p11-kit-trust-0.20.7-3.el7.x86_64.rpm)
Using OPENS000.RPM;1 for /root/hrr/Packages/openscap-1.2.10-2.el7.x86_64.rpm (openscap-scanner-1.2.10-2.el7.x86_64.rpm)
Using OPENS001.RPM;1 for /root/hrr/Packages/openssh-6.6.1p1-31.el7.x86_64.rpm (openssh-clients-6.6.1p1-31.el7.x86_64.rpm)
Using OPENS002.RPM;1 for /root/hrr/Packages/openssh-clients-6.6.1p1-31.el7.x86_64.rpm (openssh-server-6.6.1p1-31.el7.x86_64.rpm)
Using OPENS003.RPM;1 for /root/hrr/Packages/openssl-1.0.1e-60.el7.x86_64.rpm (openssl-libs-1.0.1e-60.el7.x86_64.rpm)
Using NSS_S000.RPM;1 for /root/hrr/Packages/nss-softokn-3.16.2.3-14.4.el7.x86_64.rpm (nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64.rpm)
Using NETWO000.RPM;1 for /root/hrr/Packages/NetworkManager-1.4.0-12.el7.x86_64.rpm (NetworkManager-adsl-1.4.0-12.el7.x86_64.rpm)
Using NETWO001.RPM;1 for /root/hrr/Packages/NetworkManager-adsl-1.4.0-12.el7.x86_64.rpm (NetworkManager-bluetooth-1.4.0-12.el7.x86_64.rpm)
Using NETWO002.RPM;1 for /root/hrr/Packages/NetworkManager-bluetooth-1.4.0-12.el7.x86_64.rpm (NetworkManager-config-server-1.4.0-12.el7.x86_64.rpm)
Using NETWO003.RPM;1 for /root/hrr/Packages/NetworkManager-config-server-1.4.0-12.el7.x86_64.rpm (NetworkManager-glib-1.4.0-12.el7.x86_64.rpm)
Using NETWO004.RPM;1 for /root/hrr/Packages/NetworkManager-glib-1.4.0-12.el7.x86_64.rpm (NetworkManager-libnm-1.4.0-12.el7.x86_64.rpm)
Using NETWO005.RPM;1 for /root/hrr/Packages/NetworkManager-libnm-1.4.0-12.el7.x86_64.rpm (NetworkManager-team-1.4.0-12.el7.x86_64.rpm)
Using NETWO006.RPM;1 for /root/hrr/Packages/NetworkManager-team-1.4.0-12.el7.x86_64.rpm (NetworkManager-tui-1.4.0-12.el7.x86_64.rpm)
Using NETWO007.RPM;1 for /root/hrr/Packages/NetworkManager-tui-1.4.0-12.el7.x86_64.rpm (NetworkManager-wifi-1.4.0-12.el7.x86_64.rpm)
Using NETWO008.RPM;1 for /root/hrr/Packages/NetworkManager-wifi-1.4.0-12.el7.x86_64.rpm (NetworkManager-wwan-1.4.0-12.el7.x86_64.rpm)
Using NCURS000.RPM;1 for /root/hrr/Packages/ncurses-5.9-13.20130511.el7.x86_64.rpm (ncurses-base-5.9-13.20130511.el7.noarch.rpm)
Using NCURS001.RPM;1 for /root/hrr/Packages/ncurses-base-5.9-13.20130511.el7.noarch.rpm (ncurses-libs-5.9-13.20130511.el7.x86_64.rpm)
Using LIBSE000.RPM;1 for /root/hrr/Packages/libselinux-2.5-6.el7.x86_64.rpm (libselinux-python-2.5-6.el7.x86_64.rpm)
Using LIBSE001.RPM;1 for /root/hrr/Packages/libselinux-python-2.5-6.el7.x86_64.rpm (libselinux-utils-2.5-6.el7.x86_64.rpm)
Using KERNE000.RPM;1 for /root/hrr/Packages/kernel-tools-3.10.0-514.el7.x86_64.rpm (kernel-tools-libs-3.10.0-514.el7.x86_64.rpm)
Using IWL60000.RPM;1 for /root/hrr/Packages/iwl6000g2a-firmware-17.168.5.3-49.el7.noarch.rpm (iwl6000g2b-firmware-17.168.5.2-49.el7.noarch.rpm)
Using ISCSI000.RPM;1 for /root/hrr/Packages/iscsi-initiator-utils-6.2.0.873-35.el7.x86_64.rpm (iscsi-initiator-utils-iscsiuio-6.2.0.873-35.el7.x86_64.rpm)
Using GETTE000.RPM;1 for /root/hrr/Packages/gettext-0.18.2.1-4.el7.x86_64.rpm (gettext-libs-0.18.2.1-4.el7.x86_64.rpm)
Using FIREW000.RPM;1 for /root/hrr/Packages/firewalld-0.4.3.2-8.el7.noarch.rpm (firewalld-filesystem-0.4.3.2-8.el7.noarch.rpm)
Using FIPSC000.RPM;1 for /root/hrr/Packages/fipscheck-1.4.1-5.el7.x86_64.rpm (fipscheck-lib-1.4.1-5.el7.x86_64.rpm)
Using ELFUT000.RPM;1 for /root/hrr/Packages/elfutils-libelf-0.166-2.el7.x86_64.rpm (elfutils-libs-0.166-2.el7.x86_64.rpm)
Using E2FSP000.RPM;1 for /root/hrr/Packages/e2fsprogs-1.42.9-9.el7.x86_64.rpm (e2fsprogs-libs-1.42.9-9.el7.x86_64.rpm)
Using DEVIC000.RPM;1 for /root/hrr/Packages/device-mapper-1.02.135-1.el7.x86_64.rpm (device-mapper-event-1.02.135-1.el7.x86_64.rpm)
Using DEVIC001.RPM;1 for /root/hrr/Packages/device-mapper-event-1.02.135-1.el7.x86_64.rpm (device-mapper-event-libs-1.02.135-1.el7.x86_64.rpm)
Using DEVIC002.RPM;1 for /root/hrr/Packages/device-mapper-event-libs-1.02.135-1.el7.x86_64.rpm (device-mapper-libs-1.02.135-1.el7.x86_64.rpm)
Using DEVIC003.RPM;1 for /root/hrr/Packages/device-mapper-libs-1.02.135-1.el7.x86_64.rpm (device-mapper-multipath-0.4.9-99.el7.x86_64.rpm)
Using DEVIC004.RPM;1 for /root/hrr/Packages/device-mapper-multipath-0.4.9-99.el7.x86_64.rpm (device-mapper-multipath-libs-0.4.9-99.el7.x86_64.rpm)
Using DEVIC005.RPM;1 for /root/hrr/Packages/device-mapper-multipath-libs-0.4.9-99.el7.x86_64.rpm (device-mapper-persistent-data-0.6.3-1.el7.x86_64.rpm)
Using CRYPT000.RPM;1 for /root/hrr/Packages/cryptsetup-1.7.2-1.el7.x86_64.rpm (cryptsetup-libs-1.7.2-1.el7.x86_64.rpm)
Using CRACK000.RPM;1 for /root/hrr/Packages/cracklib-2.9.0-11.el7.x86_64.rpm (cracklib-dicts-2.9.0-11.el7.x86_64.rpm)
Writing: Initial Padblock Start Block 0
Done with: Initial Padblock Block(s) 16
Writing: Primary Volume Descriptor Start Block 16
Done with: Primary Volume Descriptor Block(s) 1
Writing: Eltorito Volume Descriptor Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor Block(s) 1
Writing: Joliet Volume Descriptor Start Block 18
Done with: Joliet Volume Descriptor Block(s) 1
Writing: End Volume Descriptor Start Block 19
Done with: End Volume Descriptor Block(s) 1
Writing: Version block Start Block 20
Done with: Version block Block(s) 1
Writing: Path table Start Block 21
Done with: Path table Block(s) 4
Writing: Joliet path table Start Block 25
Done with: Joliet path table Block(s) 4
Writing: Directory tree Start Block 29
Done with: Directory tree Block(s) 39
Writing: Joliet directory tree Start Block 68
Done with: Joliet directory tree Block(s) 28
Writing: Directory tree cleanup Start Block 96
Done with: Directory tree cleanup Block(s) 0
Writing: Extension record Start Block 96
Done with: Extension record Block(s) 1
Writing: The File(s) Start Block 97
1.44% done, estimate finish Sun Feb 7 18:59:19 2016
2.88% done, estimate finish Sun Feb 7 18:59:19 2016
4.31% done, estimate finish Sun Feb 7 18:59:19 2016
5.75% done, estimate finish Sun Feb 7 18:59:19 2016
7.19% done, estimate finish Sun Feb 7 18:59:19 2016
8.63% done, estimate finish Sun Feb 7 18:59:19 2016
10.07% done, estimate finish Sun Feb 7 18:59:19 2016
11.50% done, estimate finish Sun Feb 7 18:59:27 2016
12.94% done, estimate finish Sun Feb 7 18:59:26 2016
14.38% done, estimate finish Sun Feb 7 18:59:25 2016
15.82% done, estimate finish Sun Feb 7 18:59:25 2016
17.26% done, estimate finish Sun Feb 7 18:59:24 2016
18.70% done, estimate finish Sun Feb 7 18:59:24 2016
20.13% done, estimate finish Sun Feb 7 18:59:23 2016
21.57% done, estimate finish Sun Feb 7 18:59:23 2016
23.01% done, estimate finish Sun Feb 7 18:59:23 2016
24.45% done, estimate finish Sun Feb 7 18:59:23 2016
25.88% done, estimate finish Sun Feb 7 18:59:22 2016
27.32% done, estimate finish Sun Feb 7 18:59:22 2016
28.76% done, estimate finish Sun Feb 7 18:59:22 2016
30.20% done, estimate finish Sun Feb 7 18:59:22 2016
31.63% done, estimate finish Sun Feb 7 18:59:25 2016
33.07% done, estimate finish Sun Feb 7 18:59:25 2016
34.51% done, estimate finish Sun Feb 7 18:59:24 2016
35.95% done, estimate finish Sun Feb 7 18:59:24 2016
37.38% done, estimate finish Sun Feb 7 18:59:24 2016
38.82% done, estimate finish Sun Feb 7 18:59:26 2016
40.26% done, estimate finish Sun Feb 7 18:59:26 2016
41.70% done, estimate finish Sun Feb 7 18:59:26 2016
43.14% done, estimate finish Sun Feb 7 18:59:25 2016
44.58% done, estimate finish Sun Feb 7 18:59:25 2016
46.01% done, estimate finish Sun Feb 7 18:59:25 2016
47.45% done, estimate finish Sun Feb 7 18:59:25 2016
48.89% done, estimate finish Sun Feb 7 18:59:25 2016
50.33% done, estimate finish Sun Feb 7 18:59:24 2016
51.76% done, estimate finish Sun Feb 7 18:59:26 2016
53.20% done, estimate finish Sun Feb 7 18:59:26 2016
54.64% done, estimate finish Sun Feb 7 18:59:26 2016
56.08% done, estimate finish Sun Feb 7 18:59:26 2016
57.51% done, estimate finish Sun Feb 7 18:59:25 2016
58.95% done, estimate finish Sun Feb 7 18:59:25 2016
60.39% done, estimate finish Sun Feb 7 18:59:25 2016
61.83% done, estimate finish Sun Feb 7 18:59:25 2016
63.27% done, estimate finish Sun Feb 7 18:59:25 2016
64.70% done, estimate finish Sun Feb 7 18:59:25 2016
66.14% done, estimate finish Sun Feb 7 18:59:26 2016
67.58% done, estimate finish Sun Feb 7 18:59:26 2016
69.01% done, estimate finish Sun Feb 7 18:59:26 2016
70.45% done, estimate finish Sun Feb 7 18:59:26 2016
71.89% done, estimate finish Sun Feb 7 18:59:25 2016
73.33% done, estimate finish Sun Feb 7 18:59:25 2016
74.77% done, estimate finish Sun Feb 7 18:59:25 2016
76.21% done, estimate finish Sun Feb 7 18:59:25 2016
77.64% done, estimate finish Sun Feb 7 18:59:25 2016
79.08% done, estimate finish Sun Feb 7 18:59:26 2016
80.52% done, estimate finish Sun Feb 7 18:59:26 2016
81.95% done, estimate finish Sun Feb 7 18:59:26 2016
83.40% done, estimate finish Sun Feb 7 18:59:26 2016
84.83% done, estimate finish Sun Feb 7 18:59:27 2016
86.27% done, estimate finish Sun Feb 7 18:59:27 2016
87.71% done, estimate finish Sun Feb 7 18:59:26 2016
89.15% done, estimate finish Sun Feb 7 18:59:26 2016
90.58% done, estimate finish Sun Feb 7 18:59:26 2016
92.02% done, estimate finish Sun Feb 7 18:59:26 2016
93.46% done, estimate finish Sun Feb 7 18:59:27 2016
94.89% done, estimate finish Sun Feb 7 18:59:27 2016
96.33% done, estimate finish Sun Feb 7 18:59:27 2016
97.77% done, estimate finish Sun Feb 7 18:59:27 2016
99.21% done, estimate finish Sun Feb 7 18:59:27 2016
Total translation table size: 97959
Total rockridge attributes bytes: 43580
Total directory bytes: 75776
Path table size(bytes): 140
Done with: The File(s) Block(s) 347512
Writing: Ending Padblock Start Block 347609
Done with: Ending Padblock Block(s) 150
Max brk space used 80000
347759 extents written (679 MB)
通過vmware測試:這裏密碼是1
default more是第一個
CFME安裝:只選ISO方式,不選自定義的template否則虛擬機加載不到光盤。
按ALT+TAB可以切換不同的界面,第一個是安裝,第二是命令行,第三是日誌,第四是日誌,第五是日誌,第六又開始從第一循環。
3. 設置自定義模板
導航:infrastructure>PXE>customization template
4. 通過自定義模板與ISO配置虛擬機
這裏在創建虛擬機時,有把ISO選上的,但它沒有加載到,需要人工來設置。
先在CFME暫停虛擬機,然後到RHEV平臺把虛擬機關機並把光盤掛載上並run once.
光盤中的isolinux.cfg的內容:
光盤中的ks文件的內容:
從這裏得出:
L紅帽給的自定義光盤中的isolinux有寫:ks文件在floppy中,但系統沒找到ks文件。
L然後在CFME定義的KS文件並沒有生效,現在需要自己寫classroom上的ks文件地址,但這又有問題來了,classroom中的ks文件中的passworld等是引用CFME的customize定義的變量,這裏只是引用classroom的KS,於是這個KS文件需要自己修改密碼,否則不知道root密碼。
解決方法:
將其他地址的ks文件中的root加密代碼復制到,我們需要引用的ks文件的root密碼上,這樣就知道root密碼是啥了。(我這裏復制的是rhevm中的.cfg文件,root密碼是redhat)
實驗
1. 創建自定義模板
2. 通過ISO配置VM(customize那選custom template)
3. 監控配置VM信息/進度
4. 當cfme的監控進度為waiting時將vm暫停,到RHEV平臺將VM關機,掛光盤給vm並設置為run once
5. 檢驗VM是否配置成功
Provisioning via PXE
理論
1. 概述
另一種配置虛擬機的方式是PXE,引導是通過網絡來啟動的,也就是引導盤不在RHEV平臺,而是在一臺遠端PXE服務器上。
2. 什麽是pex
PXE(preboot execute environment,預啟動執行環境)是由Intel公司開發的最新技術,工作於Client/Server的網絡模式,支持工作站通過網絡從遠端服務器下載映像,並由此支持通過網絡啟動操作系統,在啟動過程中,終端要求服務器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)協議下載一個啟動軟件包到本機內存中執行,由這個啟動軟件包完成終端(客戶端)基本軟件設置,從而引導預先安裝在服務器中的終端操作系統。PXE可以引導多種操作系統,如:Windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux系列系統等。
3. 在cfme配置PXE
導航:infrastructure>PXE>PXE server
CFME3.1 depot倉庫支持的文件系統是samba/nfs
實驗
無
本文出自 “Yolo” 博客,請務必保留此出處http://4708948.blog.51cto.com/4698948/1977243
RHCA CL220 CloudForms 3.1 配置虛擬機