KVM Cobbler Unattended Batch installation of operating systems
Cobbler: A tool for automated network installation systems that integrates PEX, DHCP, DNS, TFTPD, sync, and other services. For everyone to manage the installation of the operating system
Kvm:linux system comes with the virtualization software, self-find information learning.
Environment Description:
Cobbler
System: Centos_x86 6.8
Card:
ETH0:VM1 (Management) 10.10.100.131
Ech1:nat (Internet) DHCP
Kvm:
System: Centos_x86 6.8
Card:
ETH0:VM1 (Management) 10.10.100.130
Ech1:nat (Internet) DHCP
System Environment Readiness: (configured on two hosts)
Epel Source Configuration:
Yum-y Install wget
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
Initialize the configuration:
Yum-y install vim Lrzsz NTP htop
Firewall: SELinux configuration:
Service Iptables Stop
Chkconfig iptables off
Sed-i ' s/^selinux/selinux=disabled/'/etc/selinux/config
Crond Configuring synchronization system Time:
# rsync SYS time
0 */2 * * */usr/sbin/ntpdate time.windows.com
Cobbler
To install the relevant cobbler components:
Yum-y Install cobbler DHCP httpd xinetd tftp-server syslinux pykickstart debmirror cman fence-agents
Configuration related options:
Sed-i "S/server:127.0.0.1/server: $ (ifconfig eth0 | Awk-f ' [:]+ ' Nr==2{print $4} ')/g "/etc/cobbler/settings
grep--color "server:"/etc/cobbler/settings
Sed-i "S/manage_dhcp:0/manage_dhcp:1/g"/etc/cobbler/settings
Sed-i "S/manage_rsync:0/manage_rsync:1/g"/etc/cobbler/settings
grep--color ' ^manage_[a-za-z]\{4,\}\: '/etc/cobbler/settings
Sed-i "s/disable\t\t\t= yes/disable\t\t\t= no/g"/etc/xinetd.d/tftp
Sed-i "s/disable\t= yes/disable = no/g"/etc/xinetd.d/rsync
grep--color "Disable"/etc/xinetd.d/tftp/etc/xinetd.d/rsync
Cp/etc/cobbler/dhcp.template{,.bak}
Sed-i "s/192.168.1. [0-9]\{0,3\}/10.10.100.0/g "/etc/cobbler/dhcp.template
DHCP configuration description, here is only modified for its own network segment: After the global modification, the configuration is modified separately
Sed-i ' s/@dists = "Sid"/# @dists = "Sid"/'/etc/debmirror.conf
Sed-i ' s/@arches/# @arches;/'/etc/debmirror.conf
Start the service:
Service httpd Start
Service Cobblerd Start
Cobbler Get-loaders
# Configure the installation of the system root initial password, where the command is more cumbersome, because all can be used directly, so do not modify. Students can modify it for what they want.
Note that the string code generated here: not only to be configured in the settings file, but also to replace the ROOTPW entry in the Kickstarts (SAMPLE_END.KS) file
Sed-i "[Email protected]$ (grep--color-o ' \$[0-9a-za-z]\{0,\}\$[0-9a-za-z]\{0,\}\/[0-9a-za-z]\{0,\}\$[0-9a-za-z]\{ 0,\}\. ' /etc/cobbler/settings) @$ (OpenSSL passwd-1-salt ' random-phrase-here ' 12345678 ') @ "/etc/cobbler/settings
Check the configuration:
Service Cobblerd Restart
Cobbler Check
To create a mirror:
mount/dev/cdrom/media/
Cobbler Import--path=/media--name=centos-6.8-x86_64-minimal--arch=x86_64
Ln-s/var/www/cobbler/links/centos-6.8-minimal-x86_64//var/www/cobbler/links/centos-6.8-x86_64
Cobbler distro Edit--name=centos-6.8-minimal-x86_64--ksmeta= "Tree=http://@@[email protected]@/cobbler/links/ Centos-6.8-x86_64 "
Create Profile:
Cobbler profile Add--name=centos-6.8-x86_64-minimal_base--distro=centos-6.8-minimal-x86_64--kickstart=/var/lib/ Cobbler/kickstarts/sample_end.ks
Synchronizing Data:
Cobbler Sync
Create System: (Students note that the system is created here; The main purpose is to install operating systems without human intervention.) The Mac is a copy of the virtual machine after the KVM was created. I have previously configured it, write the document directly)
Cobbler system Add--profile=centos-6.8-x86_64-minimal_base--name=centos-6.8-x86_64-minimal_base--interface=eth0- -mac=52:54:00:96:af:34--ip-address=10.10.100.241--netmask=255.255.255.0--gateway=10.10.100.131--static=1-- dns-name=10.10.100.131
KVM (premise: CPU support Virtualization):
To see if the CPU supports virtualization:
Intel:vmx
Amc:svm
Grep-ei--color "(VMX|SVM)"/proc/cpuinfo
To configure the NIC bridge:
Use eth0 here:
CP Ifcfg-eth0 IFCFG-BR0
Configuration:
[email protected] network-scripts]# cat Ifcfg-eth0
Device=eth0
Onboot=yes
Bridge= "Br0"
[email protected] network-scripts]# cat Ifcfg-br0
Device= "Br0"
Type= "Bridge"
onboot= "Yes"
Bootproto=static
ipaddr=10.10.100.130
Prefix=24
Delay=0
Restart the NIC to take effect
To install the relevant components:
Yum-y Install KVM QEMU-KVM qemu-kvm-tools libvirt && ln-sv/usr/libexec/qemu-kvm/usr/sbin/&& Service LIBVIRTD start && chkconfig LIBVIRTD on
Note: All hosts here are minimized, in order to use the management KVM convenient; this way, Virtual Machine Manager is installed on the KVM host.
Installation components:
Virtual Machine Manager VM Management Console Linux Installation
Yum-y Install Virt-manager
Xwindows Linux Installation
Yum groupinstall "X window System"-y
Here cobbler and KVM are basically installed: and notice a little KVM boot nic bridging: You need to close the Network management tool: NetworkManager, this is because the tool is not installed.
KVM Cobbler Unattended Batch installation operating system