1)安裝epel源和cobbler
<code>[root@cobbler ~]</code><code># yum -y install http://mirrors.163.com/centos/7/extras/x86_64/Packages/epel-release-7-9.noarch.rpm</code>
<code>[root@cobbler ~]</code><code># yum install cobbler cobbler-web dhcp tftp-server pykickstart httpd xinetd -y</code>
<code>[root@cobbler ~]</code><code># systemctl start xinetd.service</code>
<code>[root@cobbler ~]</code><code># systemctl enable xinetd.service</code>
<code>[root@cobbler ~]</code><code># systemctl start httpd</code>
<code>[root@cobbler ~]</code><code># systemctl enable httpd</code>
<code>Created </code><code>symlink</code> <code>from </code><code>/etc/systemd/system/multi-user</code><code>.target.wants</code><code>/httpd</code><code>.service to </code><code>/usr/lib/systemd/system/httpd</code><code>.service.</code>
<code>[root@cobbler ~]</code><code># systemctl start cobblerd.service</code>
<code>[root@cobbler ~]</code><code># systemctl enable cobblerd.service</code>
<code>Created </code><code>symlink</code> <code>from </code><code>/etc/systemd/system/multi-user</code><code>.target.wants</code><code>/cobblerd</code><code>.service to </code><code>/usr/lib/systemd/system/cobblerd</code><code>.service.</code>
2)配置cobbler
<code>檢查cobbler:</code>
<code>[root@cobbler ~]</code><code># cobbler check</code>
<code>The following are potential configuration items that you may want to fix:</code>
<code>1 : The </code><code>'server'</code> <code>field </code><code>in</code> <code>/etc/cobbler/settings</code> <code>must be </code><code>set</code> <code>to something other than localhost, or kickstarting features will not work. This should be a resolvable </code><code>hostname</code> <code>or IP </code><code>for</code> <code>the boot server as reachable by all machines that will use it.</code>
<code>2 : For PXE to be functional, the </code><code>'next_server'</code> <code>field </code><code>in</code> <code>/etc/cobbler/settings</code> <code>must be </code><code>set</code> <code>to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.</code>
<code>3 : change </code><code>'disable'</code> <code>to </code><code>'no'</code> <code>in</code> <code>/etc/xinetd</code><code>.d</code><code>/tftp</code>
<code>4 : some network boot-loaders are missing from </code><code>/var/lib/cobbler/loaders</code><code>, you may run </code><code>'cobbler get-loaders'</code> <code>to download them, or, </code><code>if</code> <code>you only want to handle x86</code><code>/x86_64</code> <code>netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files </code><code>in</code> <code>this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The </code><code>'cobbler get-loaders'</code> <code>command</code> <code>is the easiest way to resolve these requirements.</code>
<code>5 : </code><code>enable</code> <code>and start rsyncd.service with systemctl</code>
<code>6 : debmirror package is not installed, it will be required to manage debian deployments and repositories</code>
<code>7 : The default password used by the sample templates </code><code>for</code> <code>newly installed machines (default_password_crypted </code><code>in</code> <code>/etc/cobbler/settings</code><code>) is still </code><code>set</code> <code>to </code><code>'cobbler'</code> <code>and should be changed, try: </code><code>"openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'"</code> <code>to generate new one</code>
<code>8 : fencing tools were not found, and are required to use the (optional) power management features. </code><code>install</code> <code>cman or fence-agents to use them</code>
<code>Restart cobblerd and </code><code>then</code> <code>run </code><code>'cobbler sync'</code> <code>to apply changes.</code>
修改cobbler的配置檔案:
<code>[root@cobbler ~]</code><code># vim /etc/cobbler/settings</code>
<code># if you do not set this correctly, this will be manifested in TFTP open timeouts.</code>
<code>将“next_server: 127.0.0.1”修改為“next_server: 10.10.10.222”</code>
<code>将“server: 127.0.0.1”修改為“server: 10.10.10.222”</code>
<code># set to 1 to enable Cobbler's DHCP management features.</code>
<code># the choice of DHCP management engine is in /etc/cobbler/modules.conf</code>
<code>将“manage_dhcp: 0”修改為“manage_dhcp: 1”</code>
修改cobbler預設的密碼:
<code>将“default_password_crypted: </code><code>"$1$mF86/UHC$WvcIcX2t6crBz2onWxyac."</code><code>”修改為“default_password_crypted: </code><code>"$1$wanwan$K9lP0CajD0pbFaxI0if84/"</code><code>”</code>
<code>随機生成一個密碼:</code>
<code>[root@cobbler ~]</code><code># openssl passwd -1 -salt 'wanwan' 'redhat12345'</code>
<code>$1$wanwan$K9lP0CajD0pbFaxI0if84/</code>
<code>[root@cobbler ~]</code><code># vim /etc/xinetd.d/tftp</code>
<code>将“disable = </code><code>yes</code><code>”修改為“disable = no”</code>
重新開機rsync服務:
<code>[root@cobbler ~]</code><code># systemctl start rsyncd.service</code>
<code>[root@cobbler ~]</code><code># systemctl enable rsyncd.service</code>
<code>Created </code><code>symlink</code> <code>from </code><code>/etc/systemd/system/multi-user</code><code>.target.wants</code><code>/rsyncd</code><code>.service to </code><code>/usr/lib/systemd/system/rsyncd</code><code>.service.</code>
下載下傳cobbler相關的包:
<code>[root@cobbler ~]</code><code># cobbler get-loaders</code>
<code>task started: 2017-03-20_110931_get_loaders</code>
<code>task started (</code><code>id</code><code>=Download Bootloader Content, </code><code>time</code><code>=Mon Mar 20 11:09:31 2017)</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/README</code> <code>to </code><code>/var/lib/cobbler/loaders/README</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/COPYING</code><code>.elilo to </code><code>/var/lib/cobbler/loaders/COPYING</code><code>.elilo</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/COPYING</code><code>.yaboot to </code><code>/var/lib/cobbler/loaders/COPYING</code><code>.yaboot</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/COPYING</code><code>.syslinux to </code><code>/var/lib/cobbler/loaders/COPYING</code><code>.syslinux</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/elilo-3</code><code>.8-ia64.efi to </code><code>/var/lib/cobbler/loaders/elilo-ia64</code><code>.efi</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/yaboot-1</code><code>.3.17 to </code><code>/var/lib/cobbler/loaders/yaboot</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/pxelinux</code><code>.0-3.86 to </code><code>/var/lib/cobbler/loaders/pxelinux</code><code>.0</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/menu</code><code>.c32-3.86 to </code><code>/var/lib/cobbler/loaders/menu</code><code>.c32</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/grub-0</code><code>.97-x86.efi to </code><code>/var/lib/cobbler/loaders/grub-x86</code><code>.efi</code>
<code>downloading https:</code><code>//cobbler</code><code>.github.io</code><code>/loaders/grub-0</code><code>.97-x86_64.efi to </code><code>/var/lib/cobbler/loaders/grub-x86_64</code><code>.efi</code>
<code>*** TASK COMPLETE ***</code>
<code>[root@cobbler ~]</code><code># systemctl restart cobblerd.service </code>
<code>1 : debmirror package is not installed, it will be required to manage debian deployments and repositories</code>
<code>2 : fencing tools were not found, and are required to use the (optional) power management features. </code><code>install</code> <code>cman or fence-agents to use them</code>
<code>[root@cobbler ~]</code><code># cd /etc/cobbler/</code>
<code>[root@cobbler cobbler]</code><code># ls</code>
<code>auth.conf dhcp.template ldap power </code><code>rsync</code><code>.template </code><code>users</code><code>.conf zone_templates</code>
<code>cheetah_macros dnsmasq.template modules.conf pxe secondary.template </code><code>users</code><code>.digest</code>
<code>cobbler_bash import_rsync_whitelist mongodb.conf reporting settings version</code>
<code>completions iso named.template </code><code>rsync</code><code>.exclude tftpd.template zone.template</code>
3)配置服務
<code>[root@cobbler cobbler]</code><code># vim dhcp.template </code>
<code>subnet 10.10.10.0 netmask 255.255.255.0 {</code>
<code> </code><code>option routers 10.10.10.2;</code>
<code> </code><code>option domain-name-servers 10.10.10.2;</code>
<code> </code><code>option subnet-mask 255.255.255.0;</code>
<code> </code><code>range dynamic-bootp 10.10.10.100 10.10.10.200;</code>
<code> </code><code>default-lease-</code><code>time</code> <code>21600;</code>
<code> </code><code>max-lease-</code><code>time</code> <code>43200;</code>
<code> </code><code>next-server $next_server;</code>
<code> </code><code>class </code><code>"pxeclients"</code> <code>{</code>
<code> </code><code>match </code><code>if</code> <code>substring (option vendor-class-identifier, 0, 9) = </code><code>"PXEClient"</code><code>;</code>
<code> </code><code>if</code> <code>option pxe-system-</code><code>type</code> <code>= 00:02 {</code>
<code> </code><code>filename </code><code>"ia64/elilo.efi"</code><code>;</code>
<code> </code><code>} </code><code>else</code> <code>if</code> <code>option pxe-system-</code><code>type</code> <code>= 00:06 {</code>
<code> </code><code>filename </code><code>"grub/grub-x86.efi"</code><code>;</code>
<code> </code><code>} </code><code>else</code> <code>if</code> <code>option pxe-system-</code><code>type</code> <code>= 00:07 {</code>
<code> </code><code>filename </code><code>"grub/grub-x86_64.efi"</code><code>;</code>
<code> </code><code>} </code><code>else</code> <code>{</code>
<code> </code><code>filename </code><code>"pxelinux.0"</code><code>;</code>
<code> </code><code>}</code>
<code> </code><code>}</code>
<code>}</code>
<code>備注:主要修改網段、DNS、網關等資訊</code>
<code>[root@cobbler cobbler]</code><code># cobbler sync</code>
<code>通過cobbler管理的dhcp的配置檔案</code>
<code>[root@cobbler cobbler]</code><code># egrep -v '^#|^$' /etc/dhcp/dhcpd.conf </code>
<code>ddns-update-style interim;</code>
<code>allow booting;</code>
<code>allow bootp;</code>
<code>ignore client-updates;</code>
<code>set</code> <code>vendorclass = option vendor-class-identifier;</code>
<code>option pxe-system-</code><code>type</code> <code>code 93 = unsigned integer 16;</code>
<code> </code><code>next-server 10.10.10.222;</code>
<code>group {</code>
挂載并導入資料:
<code>[root@cobbler ~]</code><code># mount /dev/cdrom /mnt</code>
<code>mount</code><code>: </code><code>/dev/sr0</code> <code>is write-protected, mounting </code><code>read</code><code>-only</code>
<code>[root@cobbler ~]</code><code># df -h</code>
<code>Filesystem Size Used Avail Use% Mounted on</code>
<code>/dev/mapper/cl-root</code> <code>50G 9.8G 41G 20% /</code>
<code>devtmpfs 1.9G 0 1.9G 0% </code><code>/dev</code>
<code>tmpfs 1.9G 144K 1.9G 1% </code><code>/dev/shm</code>
<code>tmpfs 1.9G 9.0M 1.9G 1% </code><code>/run</code>
<code>tmpfs 1.9G 0 1.9G 0% </code><code>/sys/fs/cgroup</code>
<code>/dev/mapper/cl-home</code> <code>46G 36M 46G 1% </code><code>/home</code>
<code>/dev/sda1</code> <code>1014M 175M 840M 18% </code><code>/boot</code>
<code>tmpfs 378M 12K 378M 1% </code><code>/run/user/0</code>
<code>/dev/sr0</code> <code>4.1G 4.1G 0 100% </code><code>/mnt</code>
<code>[root@cobbler ~]</code><code># cobbler import --path=/mnt --name=CentOS-7.3 --arch=x86_64</code>
<code>task started: 2017-03-20_113200_import</code>
<code>task started (</code><code>id</code><code>=Media </code><code>import</code><code>, </code><code>time</code><code>=Mon Mar 20 11:32:00 2017)</code>
<code>Found a candidate signature: breed=redhat, version=rhel6</code>
<code>Found a candidate signature: breed=redhat, version=rhel7</code>
<code>Found a matching signature: breed=redhat, version=rhel7</code>
<code>Adding distros from path </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64:</code>
<code>creating new distro: CentOS-7.3-x86_64</code>
<code>trying </code><code>symlink</code><code>: </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64 -> </code><code>/var/www/cobbler/links/CentOS-7</code><code>.3-x86_64</code>
<code>creating new profile: CentOS-7.3-x86_64</code>
<code>associating repos</code>
<code>checking </code><code>for</code> <code>rsync</code> <code>repo(s)</code>
<code>checking </code><code>for</code> <code>rhn repo(s)</code>
<code>checking </code><code>for</code> <code>yum repo(s)</code>
<code>starting descent into </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64 </code><code>for</code> <code>CentOS-7.3-x86_64</code>
<code>processing repo at : </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code>
<code>need to process repo</code><code>/comps</code><code>: </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code>
<code>looking </code><code>for</code> <code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/repodata/</code><code>*comps*.xml</code>
<code>Keeping repodata as-is :</code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/repodata</code>
說明:cobbler導入的鏡像放在:/var/www/cobbler/ks_mirror
<code>[root@cobbler ks_mirror]</code><code># pwd</code>
<code>/var/www/cobbler/ks_mirror</code>
<code>[root@cobbler ks_mirror]</code><code># ls</code>
<code>CentOS-7.3-x86_64 config</code>
預設kickstart檔案存放位置:/var/lib/cobbler/kickstarts/
<code>[root@cobbler ~]</code><code># cd /var/lib/cobbler/kickstarts/</code>
<code>[root@cobbler kickstarts]</code><code># ll</code>
<code>total 52</code>
<code>-rw-r--r-- 1 root root 115 Nov 17 03:09 default.ks</code>
<code>-rw-r--r-- 1 root root 22 Nov 17 03:09 esxi4-ks.cfg</code>
<code>-rw-r--r-- 1 root root 22 Nov 17 03:09 esxi5-ks.cfg</code>
<code>drwxr-xr-x 2 root root 56 Mar 20 10:39 install_profiles</code>
<code>-rw-r--r-- 1 root root 1424 Nov 17 03:09 legacy.ks</code>
<code>-rw-r--r-- 1 root root 292 Nov 17 03:09 pxerescue.ks</code>
<code>-rw-r--r-- 1 root root 2916 Nov 17 03:09 sample_autoyast.xml</code>
<code>-rw-r--r-- 1 root root 1825 Nov 17 03:09 sample_end.ks</code>
<code>-rw-r--r-- 1 root root 0 Nov 17 03:09 sample_esx4.ks</code>
<code>-rw-r--r-- 1 root root 324 Nov 17 03:09 sample_esxi4.ks</code>
<code>-rw-r--r-- 1 root root 386 Nov 17 03:09 sample_esxi5.ks</code>
<code>-rw-r--r-- 1 root root 1784 Nov 17 03:09 sample.ks</code>
<code>-rw-r--r-- 1 root root 3419 Nov 17 03:09 sample_old.seed</code>
<code>-rw-r--r-- 1 root root 5879 Nov 17 03:09 sample.seed</code>
<code>[root@cobbler ~]</code><code># cobbler list</code>
<code>distros:</code>
<code> </code><code>CentOS-7.3-x86_64</code>
<code>profiles:</code>
<code>systems:</code>
<code>repos:</code>
<code>images:</code>
<code>mgmtclasses:</code>
<code>packages:</code>
<code>files:</code>
<code>[root@cobbler ~]</code><code># cobbler profile report</code>
<code>Name : CentOS-7.3-x86_64</code>
<code>TFTP Boot Files : {}</code>
<code>Comment : </code>
<code>DHCP Tag : default</code>
<code>Distribution : CentOS-7.3-x86_64</code>
<code>Enable gPXE? : 0</code>
<code>Enable PXE Menu? : 1</code>
<code>Fetchable Files : {}</code>
<code>Kernel Options : {}</code>
<code>Kernel Options (Post Install) : {}</code>
<code>Kickstart : </code><code>/var/lib/cobbler/kickstarts/sample_end</code><code>.ks</code>
<code>Kickstart Metadata : {}</code>
<code>Management Classes : []</code>
<code>Management Parameters : <<inherit>></code>
<code>Name Servers : []</code>
<code>Name Servers Search Path : []</code>
<code>Owners : [</code><code>'admin'</code><code>]</code>
<code>Parent Profile : </code>
<code>Internal proxy : </code>
<code>Red Hat Management Key : <<inherit>></code>
<code>Red Hat Management Server : <<inherit>></code>
<code>Repos : []</code>
<code>Server Override : <<inherit>></code>
<code>Template Files : {}</code>
<code>Virt Auto Boot : 1</code>
<code>Virt Bridge : xenbr0</code>
<code>Virt CPUs : 1</code>
<code>Virt Disk Driver Type : raw</code>
<code>Virt File Size(GB) : 5</code>
<code>Virt Path : </code>
<code>Virt RAM (MB) : 512</code>
<code>Virt Type : kvm</code>
檢視cobbler profile的幫助:
<code>[root@cobbler ~]</code><code># cobbler profile edit --help</code>
<code>Usage: cobbler [options]</code>
<code>Options:</code>
<code> </code><code>-h, --help show this help message and </code><code>exit</code>
<code> </code><code>--name=NAME Name (Ex: F10-i386-webserver)</code>
<code> </code><code>--uid=UID </code>
<code> </code><code>--owners=OWNERS Owners (Owners list </code><code>for</code> <code>authz_ownership (space</code>
<code> </code><code>delimited))</code>
<code> </code><code>--distro=DISTRO Distribution (Parent distribution)</code>
<code> </code><code>--parent=PARENT Parent Profile</code>
<code> </code><code>--</code><code>enable</code><code>-gpxe=ENABLE_GPXE</code>
<code> </code><code>Enable gPXE? (Use gPXE instead of PXELINUX </code><code>for</code>
<code> </code><code>advanced booting options)</code>
<code> </code><code>--</code><code>enable</code><code>-menu=ENABLE_MENU</code>
<code> </code><code>Enable PXE Menu? (Show this profile </code><code>in</code> <code>the PXE menu?)</code>
<code> </code><code>--kickstart=KICKSTART</code>
<code> </code><code>Kickstart (Path to kickstart template)</code>
<code> </code><code>--kopts=KERNEL_OPTIONS</code>
<code> </code><code>Kernel Options (Ex: selinux=permissive)</code>
<code> </code><code>--kopts-post=KERNEL_OPTIONS_POST</code>
<code> </code><code>Kernel Options (Post Install) (Ex: clocksource=pit</code>
<code> </code><code>noapic)</code>
<code> </code><code>--ksmeta=KS_META Kickstart Metadata (Ex: dog=fang agent=86)</code>
<code> </code><code>--proxy=PROXY Internal proxy (Internal proxy URL)</code>
<code> </code><code>--repos=REPOS Repos (Repos to auto-assign to this profile)</code>
<code> </code><code>--comment=COMMENT Comment (Free form text description)</code>
<code> </code><code>--virt-auto-boot=VIRT_AUTO_BOOT</code>
<code> </code><code>Virt Auto Boot (Auto boot this VM?)</code>
<code> </code><code>--virt-cpus=VIRT_CPUS</code>
<code> </code><code>Virt CPUs (integer)</code>
<code> </code><code>--virt-</code><code>file</code><code>-size=VIRT_FILE_SIZE</code>
<code> </code><code>Virt File Size(GB)</code>
<code> </code><code>--virt-disk-driver=VIRT_DISK_DRIVER</code>
<code> </code><code>Virt Disk Driver Type (The on-disk </code><code>format</code> <code>for</code> <code>the</code>
<code> </code><code>virtualization disk)</code>
<code> </code><code>--virt-</code><code>ram</code><code>=VIRT_RAM Virt RAM (MB)</code>
<code> </code><code>--depth=DEPTH </code>
<code> </code><code>--virt-</code><code>type</code><code>=VIRT_TYPE</code>
<code> </code><code>Virt Type (Virtualization technology to use) (valid</code>
<code> </code><code>options: xenpv,xenfv,qemu,kvm,vmware,openvz,SETTINGS:d</code>
<code> </code><code>efault_virt_type)</code>
<code> </code><code>--virt-path=VIRT_PATH</code>
<code> </code><code>Virt Path (Ex: </code><code>/directory</code> <code>OR VolGroup00)</code>
<code> </code><code>--virt-bridge=VIRT_BRIDGE</code>
<code> </code><code>Virt Bridge</code>
<code> </code><code>--dhcp-tag=DHCP_TAG DHCP Tag (See manpage or leave blank)</code>
<code> </code><code>--server=SERVER Server Override (See manpage or leave blank)</code>
<code> </code><code>--ctime=CTIME </code>
<code> </code><code>--mtime=MTIME </code>
<code> </code><code>--name-servers=NAME_SERVERS</code>
<code> </code><code>Name Servers (space delimited)</code>
<code> </code><code>--name-servers-search=NAME_SERVERS_SEARCH</code>
<code> </code><code>Name Servers Search Path (space delimited)</code>
<code> </code><code>--mgmt-classes=MGMT_CLASSES</code>
<code> </code><code>Management Classes (For external configuration</code>
<code> </code><code>management)</code>
<code> </code><code>--mgmt-parameters=MGMT_PARAMETERS</code>
<code> </code><code>Management Parameters (Parameters </code><code>which</code> <code>will be handed</code>
<code> </code><code>to your management application (Must be valid YAML</code>
<code> </code><code>dictionary))</code>
<code> </code><code>--boot-files=BOOT_FILES</code>
<code> </code><code>TFTP Boot Files (Files copied into tftpboot beyond the</code>
<code> </code><code>kernel</code><code>/initrd</code><code>)</code>
<code> </code><code>--fetchable-files=FETCHABLE_FILES</code>
<code> </code><code>Fetchable Files (Templates </code><code>for</code> <code>tftp or wget</code><code>/curl</code><code>)</code>
<code> </code><code>--template-files=TEMPLATE_FILES</code>
<code> </code><code>Template Files (File mappings </code><code>for</code> <code>built-</code><code>in</code> <code>config</code>
<code> </code><code>--redhat-management-key=REDHAT_MANAGEMENT_KEY</code>
<code> </code><code>Red Hat Management Key (Registration key </code><code>for</code> <code>RHN,</code>
<code> </code><code>Spacewalk, or Satellite)</code>
<code> </code><code>--redhat-management-server=REDHAT_MANAGEMENT_SERVER</code>
<code> </code><code>Red Hat Management Server (Address of Spacewalk or</code>
<code> </code><code>Satellite Server)</code>
<code> </code><code>--template-remote-kickstarts=TEMPLATE_REMOTE_KICKSTARTS</code>
<code> </code><code>--clobber allow add to overwrite existing objects</code>
<code> </code><code>--</code><code>in</code><code>-place edit items </code><code>in</code> <code>kopts or ksmeta without clearing the</code>
<code> </code><code>other items</code>
修改kickstart檔案:
<code>[root@cobbler ~]</code><code># cobbler profile edit --name=CentOS-7.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7.3-x86_64.cfg</code>
修改核心參數:
<code>[root@cobbler ~]</code><code># cobbler profile edit --name=CentOS-7.3-x86_64 --kopts='net.ifnames=0 biosdevname=0'</code>
<code>Kernel Options : {</code><code>'biosdevname'</code><code>: </code><code>'0'</code><code>, </code><code>'net.ifnames'</code><code>: </code><code>'0'</code><code>}</code>
<code>Kickstart : </code><code>/var/lib/cobbler/kickstarts/CentOS-7</code><code>.3-x86_64.cfg</code>
<code>[root@cobbler ~]</code><code># cobbler sync</code>
<code>task started: 2017-03-20_135014_sync</code>
<code>task started (</code><code>id</code><code>=Sync, </code><code>time</code><code>=Mon Mar 20 13:50:14 2017)</code>
<code>running pre-</code><code>sync</code> <code>triggers</code>
<code>cleaning trees</code>
<code>removing: </code><code>/var/www/cobbler/images/CentOS-7</code><code>.3-x86_64</code>
<code>removing: </code><code>/var/lib/tftpboot/pxelinux</code><code>.cfg</code><code>/default</code>
<code>removing: </code><code>/var/lib/tftpboot/grub/images</code>
<code>removing: </code><code>/var/lib/tftpboot/grub/grub-x86</code><code>.efi</code>
<code>removing: </code><code>/var/lib/tftpboot/grub/grub-x86_64</code><code>.efi</code>
<code>removing: </code><code>/var/lib/tftpboot/grub/efidefault</code>
<code>removing: </code><code>/var/lib/tftpboot/images/CentOS-7</code><code>.3-x86_64</code>
<code>removing: </code><code>/var/lib/tftpboot/s390x/profile_list</code>
<code>copying bootloaders</code>
<code>trying hardlink </code><code>/var/lib/cobbler/loaders/pxelinux</code><code>.0 -> </code><code>/var/lib/tftpboot/pxelinux</code><code>.0</code>
<code>copying: </code><code>/var/lib/cobbler/loaders/pxelinux</code><code>.0 -> </code><code>/var/lib/tftpboot/pxelinux</code><code>.0</code>
<code>trying hardlink </code><code>/var/lib/cobbler/loaders/menu</code><code>.c32 -> </code><code>/var/lib/tftpboot/menu</code><code>.c32</code>
<code>copying: </code><code>/var/lib/cobbler/loaders/menu</code><code>.c32 -> </code><code>/var/lib/tftpboot/menu</code><code>.c32</code>
<code>trying hardlink </code><code>/var/lib/cobbler/loaders/grub-x86</code><code>.efi -> </code><code>/var/lib/tftpboot/grub/grub-x86</code><code>.efi</code>
<code>trying hardlink </code><code>/var/lib/cobbler/loaders/grub-x86_64</code><code>.efi -> </code><code>/var/lib/tftpboot/grub/grub-x86_64</code><code>.efi</code>
<code>copying distros to tftpboot</code>
<code>copying files </code><code>for</code> <code>distro: CentOS-7.3-x86_64</code>
<code>trying hardlink </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/images/pxeboot/vmlinuz</code> <code>-> </code><code>/var/lib/tftpboot/images/CentOS-7</code><code>.3-x86_64</code><code>/vmlinuz</code>
<code>trying hardlink </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/images/pxeboot/initrd</code><code>.img -> </code><code>/var/lib/tftpboot/images/CentOS-7</code><code>.3-x86_64</code><code>/initrd</code><code>.img</code>
<code>copying images</code>
<code>generating PXE configuration files</code>
<code>generating PXE menu structure</code>
<code>trying hardlink </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/images/pxeboot/vmlinuz</code> <code>-> </code><code>/var/www/cobbler/images/CentOS-7</code><code>.3-x86_64</code><code>/vmlinuz</code>
<code>trying hardlink </code><code>/var/www/cobbler/ks_mirror/CentOS-7</code><code>.3-x86_64</code><code>/images/pxeboot/initrd</code><code>.img -> </code><code>/var/www/cobbler/images/CentOS-7</code><code>.3-x86_64</code><code>/initrd</code><code>.img</code>
<code>Writing template files </code><code>for</code> <code>CentOS-7.3-x86_64</code>
<code>rendering DHCP files</code>
<code>generating </code><code>/etc/dhcp/dhcpd</code><code>.conf</code>
<code>rendering TFTPD files</code>
<code>generating </code><code>/etc/xinetd</code><code>.d</code><code>/tftp</code>
<code>processing boot_files </code><code>for</code> <code>distro: CentOS-7.3-x86_64</code>
<code>cleaning link caches</code>
<code>running post-</code><code>sync</code> <code>triggers</code>
<code>running python triggers from </code><code>/var/lib/cobbler/triggers/sync/post/</code><code>*</code>
<code>running python trigger cobbler.modules.sync_post_restart_services</code>
<code>running: dhcpd -t -q</code>
<code>received on stdout: </code>
<code>received on stderr: </code>
<code>running: service dhcpd restart</code>
<code>received on stderr: Redirecting to </code><code>/bin/systemctl</code> <code>restart dhcpd.service</code>
<code>running shell triggers from </code><code>/var/lib/cobbler/triggers/sync/post/</code><code>*</code>
<code>running python triggers from </code><code>/var/lib/cobbler/triggers/change/</code><code>*</code>
<code>running python trigger cobbler.modules.scm_track</code>
<code>running shell triggers from </code><code>/var/lib/cobbler/triggers/change/</code><code>*</code>
用戶端設定從網卡啟動:
<a href="https://s2.51cto.com/wyfs02/M00/8E/F1/wKioL1jPlXLylrqtAAAQs8PG3PU011.png" target="_blank"></a>
安裝完的CentOS6:
<a href="https://s5.51cto.com/wyfs02/M02/8E/F3/wKiom1jPlg7DFL4GAAAOop-fueA038.png" target="_blank"></a>
cobbler的圖形化管理界面(預設使用者名cobbler,預設密碼cobbler):
<a href="https://s1.51cto.com/wyfs02/M01/8E/F1/wKioL1jPlnbCojAEAACQ127zi2Y817.png" target="_blank"></a>
<a href="https://s1.51cto.com/wyfs02/M00/8E/F3/wKiom1jPl8-TrTaWAAEMsLM3-2I161.png" target="_blank"></a>
<a href="https://s1.51cto.com/wyfs02/M00/8E/F1/wKioL1jPl8_jogJVAAE1xsqClbQ493.png" target="_blank"></a>
<a href="https://s3.51cto.com/wyfs02/M01/8E/F3/wKiom1jPl9DTx_UtAAHP9AnMWss509.png" target="_blank"></a>
<a href="https://s5.51cto.com/wyfs02/M01/8E/F1/wKioL1jPl9Hik92VAADC_Do_Cos171.png" target="_blank"></a>
補充下,如果重新開機cobbler後發現dhcpd服務不能正常使用,很有可能是因為沒設定自動啟動
<code> </code><code>[root@cobbler ~]</code><code># systemctl start dhcpd.service</code>
<code> </code><code>[root@cobbler ~]</code><code># systemctl enable dhcpd.serviceCreated symlink from /etc/systemd/system/multi-user.target.wants/dhcpd.service to /usr/lib/systemd/system/dhcpd.service.</code>
本文轉自 冰凍vs西瓜 51CTO部落格,原文連結:http://blog.51cto.com/molewan/1908475,如需轉載請自行聯系原作者