2016-12-10
Initial configuration address: Http://www.cnblogs.com/shenzhonglin/p/6126466.html Cobbler: A tool for automated network installation systems that integrates PEX, DHCP, DNS, TFTPD, sync, and other services. Can be for everyone to manage the installation of operating system Kvm:linux system with the virtualization software, self-search for information learning.
Environment Description: Cobbler: System: Centos_x866.8Network card: ETH0:VM1 (Management)10.10.100.131ech1:nat (Internet) DHCPKVM: System: Centos_x866.8Network card: ETH0:VM1 (Management)10.10.100.130ech1:nat (Internet) DHCP System Environment Readiness: (configured on two hosts) Epel source configuration: Yum-y install Wgetwget-o/etc/yum.repos.d/epel.repo http://Mirrors.aliyun.com/repo/epel-6.repoInitialize configuration: Yum-y install vim lrzsz ntp htop firewall: SELinux configuration: Service iptables stopchkconfig iptables offsed-I.'s/^selinux/selinux=disabled/'/etc/selinux/Configcrond Configuring synchronization system time: # rsync sys0*/2* * * */usr/sbin/ntpdate Time.windows.comcobbler: Installing related 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/Settingsgrep--color"Server:"/etc/cobbler/settingssed-I."s/manage_dhcp:0/manage_dhcp:1/g"/etc/cobbler/settingssed-I."s/manage_rsync:0/manage_rsync:1/g"/etc/cobbler/Settingsgrep--color'^manage_[a-za-z]\{4,\}\:'/etc/cobbler/settingssed-I."s/disable\t\t\t= yes/disable\t\t\t= no/g"/etc/xinetd.d/tftpsed-I."s/disable\t= yes/disable = no/g"/etc/xinetd.d/Rsyncgrep--color"Disable"/etc/xinetd.d/tftp/etc/xinetd.d/RSYNCCP/etc/cobbler/dhcp.template{,.bak}sed-I."s/192.168.1. [0-9]\{0,3\}/10.10.100.0/g"/etc/cobbler/DHCP.TEMPLATEDHCP Configuration instructions, here just modify the network segment for itself: After the global modification, the configuration of SED is modified individually-I.'s/@dists = "Sid"/# @dists = "Sid"/'/etc/debmirror.confsed-I.'s/@arches/# @arches;'/etc/debmirror.conf Start-up service: Service httpd startservice cobblerd StartcobblerGet-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 item 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 configuration: Service cobblerd restartcobbler Check create Image: Mount/dev/cdrom/media/Cobbler Import--path=/media--name=centos-6.8-x86_64-minimal--arch=X86_64ln-S/var/www/cobbler/links/centos-6.8-minimal-x86_64//var/www/cobbler/links/centos-6.8-x86_64cobbler 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 Sync Data: Cobbler Sync Create System: (Students note that the system is created here; The main purpose is to install the operating system without human intervention.) The Mac is a copy of the virtual machine after the KVM was created. I have been previously configured to write documents directly) Cobbler system add--profile=centos-6.8-x86_64-minimal_base--name=centos-6.8-x86_64-minimal_base--Interface=eth0--mac= the: Wu:xx: the: AF: the--ip-address=10.10.100.241--netmask=255.255.255.0--gateway=10.10.100.131--Static=1--dns-name=10.10.100.131KVM (premise: CPU support Virtualization): see if the CPU supports virtualization: Intel:vmxAMC:svmgrep-ei--color"(VMX|SVM)"/proc/Cpuinfo Configuring the NIC Bridge: use ETH0:CP here ifcfg-eth0 ifcfg-br0 configuration: [[email protected] network-scripts]# Cat ifcfg-Eth0device=Eth0onboot=Yesbridge="br0"[[Email protected] network-scripts]# Cat ifcfg-Br0device="br0"TYPE="Bridge"Onboot="Yes"Bootproto=Staticipaddr=10.10.100.130PREFIX= -DELAY=0Restart the NIC, effective installation related components: Yum-y install KVM QEMU-KVM qemu-kvm-tools libvirt && ln-sv/usr/libexec/qemu-kvm/usr/sbin/&& service Lib VIRTD Start &&chkconfig LIBVIRTD on Note: All hosts here are minimized, in order to use the management KVM convenient; this is where the Virtual Machine Manager installation component is installed on the KVM host:VirtualMachine Manager VM management Console Linux installation Yum-Y Install virt-managerxwindows Linux install yum Groupinstall"X Window System"-y here Cobbler and KVM are basically installed: and notice a little bit of KVM boot NIC bridging: Need to shut down Network administration tool: NetworkManager, this is because the tool is not installed. Operating side: Win system: Here you need to connect KVM using Virtual Machine Manager to manage KVM VMs, all need to install the Xmanage console on the win side. Internet connection: Configuration:
Create a virtual host: Copy MAC address to cobbler Create cobbler system run to implement unattended installation Some small pits:1, DHCP: Obtain an address, configure DHCP correctly, and determine the DHCP service startup. DHCP is Cobbler sync before it starts. 2, the installation system cannot find the Kickstarts file, when creating the profile, make sure the file name is correct3, Xamnage boot installation prompt SDA problem. When created, hard disk resources are not too small. OPS knows the default allocation system disk resource space
Kickstarts file included: Note: password string
# Kickstart Template forFedora8and later. # (includes%end blocks) # DoNot use with earlier distros #platform=x86, AMD64, or Intel EM64T # System Authorization Information auth--useshadow--ENABLEMD5 # System bootloader configuration bootloader--location=MBR # Partition clearing information Clearpart--all--Initlabel # Use text mode install text # Firewall configuration Firewall--service=ssh# Run The Setup Agent on first boot firstboot--Disable # system keyboard keyboard US # system language Lang en_US # Use network installation URL--url=$tree # If Any cobbler repo definitions were referencedinchThe Kickstart profile, include them. $yum _repo_stanza # Network information $SNIPPET ('Network_config') # Reboot after installation rebootnetwork--onboot Yes--device eth0--bootproto DHCP--NOIPV6ROOTPW--iscrypted $1$random-p$hwri.9fannh4ixjhdupym/Firewall--service=Sshauthconfig--enableshadow--passalgo=Sha512selinux--Disabledtimezone--UTC asia/Shanghaibootloader--LOCATION=MBR--DRIVEORDER=SDA--append="nomodeset Crashkernel=auto rhgb quiet"# The following isThe partition information you requested# Note This any partitions you deleted is not expressed# here so unless you c Lear all partitions First, This is# guaranteed to Work#clearpart--linux--drives=sdazerombr Yesclearpart--all--DRIVES=SDA--Initlabel#volgroup Volgroup--pesize=4096Pv.008002 Part/boot--FSTYPE=EXT4--size= $Part Swap--size= + Part/--FSTYPE=EXT4--grow--size=1%packages--Nobase@coreopenssh-Clientscurl%End%Pre $SNIPPET ('Log_ks_pre') $SNIPPET ('Kickstart_start') $SNIPPET ('Pre_install_network_config') # Enable Installation monitoring $SNIPPET ('Pre_anamon') %End%packages--Nobase@coreopenssh-Clients$snippet ('func_install_if_enabled') %End%Post $SNIPPET ('Log_ks_post') # Start yum configuration $yum _config_stanza # End Yum configuration $SNIPPET ('post_install_kernel_options') $SNIPPET ('Post_install_network_config') $SNIPPET ('func_register_if_enabled') $SNIPPET ('Download_config_files') $SNIPPET ('koan_environment') $SNIPPET ('Redhat_register') $SNIPPET ('Cobbler_register') # Enable Post-Install boot notification $SNIPPET ('Post_anamon') # Start final steps $SNIPPET ('Kickstart_done') # End final steps iptables-fchkconfig iptables offrm-rf/etc/security/limits.d/ --Nproc.confcat>>/etc/hosts<<EOF127.0.0.1localhost.localdomain localhost::1Localhost.localdomain Localhosteofcat>>/etc/resolv.conf<<EOF; generated by/sbin/dhclient-Scriptnameserver202.96.134.133nameserver202.96.128.68Eofyum-y install Ntpecho'*/2 * * * ntpdate time.windows.com'>/var/spool/cron/Root%end
View Code
KVM Cobbler Unattended Batch installation operating system