Home  >  Article  >  Backend Development  >  Cobbler batch deployment of operating systems for automated operation and maintenance (1)_PHP tutorial

Cobbler batch deployment of operating systems for automated operation and maintenance (1)_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:57:021079browse

Automated operation and maintenance of cobbler batch deployment of operating systems (1)

Note: This article only introduces the simple installation and use of cobbler. Advanced operations will be sorted out later when there is time.
The cobbler installation system is an upgraded version of the earlier kickstart. It has the advantages of being easier to configure and it also comes with a web interface that is easier to manage. However, when installing cobbler-web, the prompt is as follows:
Error: Package: cobbler-web-2.6 .11-1.el6.noarch (epel)
Requires: Django >= 1.4
Since it is troublesome to install Django, I did not use the cobbler-web function.

Environment: centos6.4
IP: 192.168.1.105
yum source:
CentOS 5 x86_64
rpm -ivh http://dl.fedoraproject.org/pub/epel /5/x86_64/epel-release-5-4.noarch.rpm
CentOS6 x86_64:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release- 6-8.noarch.rpm
CentOS6 i386:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

Steps:
1.
<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes -y </li></ol>
2.
<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>cobbler check       检验cobbler,根据提示一步步解决问题 </li></ol>
[root@bogon yum.repos.d]# cobbler check
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 252 , in check_setup
s.ping()
File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
File "/usr/lib64/python2.6/xmlrpclib.py", line 1243, in request
headers
ProtocolError:

From the first line, we know that httpd has not been started and selinux has not been closed, so just follow the prompts.
/etc/init.d/httpd restart && setenforce 0 (or change the configuration file directly)

Then run cobbler check again, the prompt is as follows:

<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>[root@bogon yum.repos.d]# cobbler check<br /> </li><li>The following are potential configuration items that you may want to fix:<br /></li><li><br /></li><li>1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.<br /></li><li>2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.<br /></li><li>3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:<br /></li><li>https://github.com/cobbler/cobbler/wiki/Selinux<br /></li><li>4 : change 'disable' to 'no' in /etc/xinetd.d/tftp<br /></li><li>5 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.<br /></li><li>6 : change 'disable' to 'no' in /etc/xinetd.d/rsync<br /></li><li>7 : file /etc/xinetd.d/rsync does not exist<br /></li><li>8 : since iptables may be running, ensure 69, 80/443, and 25151 are unblocked<br /></li><li>9 : debmirror package is not installed, it will be required to manage debian deployments and repositories<br /></li><li>10 : ksvalidator was not found, install pykickstart<br /></li><li>11 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one<br /></li><li>12 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them<br /></li><li><br /></li><li>Restart cobblerd and then run 'cobbler sync' to apply changes. </li></ol>
Except for Chapter 9.10. 12. Except for these three, you don’t need to pay special attention to them. The others need to be modified. It is very simple to follow the prompts.

3.
Modify /etc/cobbler/dhcp.template and configure it according to the actual situation. It is not difficult.

4.
Import image
cobbler import --path=/media/CentOS_5.8_Final --name=CentOS5.8 --arch=x86_64
cobbler profile edit --name= centos5.4-i686-x86_64 --kickstart=kickstart path
After the import is completed, use
cobbler report to check it

<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>[root@bogon ~]# cobbler report<br /> </li><li>distros:<br /></li><li>==========<br /></li><li>Name : CentOS5.8-xen-x86_64<br /></li><li>Architecture : x86_64<br /></li><li>TFTP Boot Files : {}<br /></li><li>Breed : redhat<br /></li><li>Comment : <br /></li><li>Fetchable Files : {}<br /></li><li>Initrd : /var/www/cobbler/ks_mirror/CentOS5.8-x86_64/images/xen/initrd.img<br /></li><li>Kernel : /var/www/cobbler/ks_mirror/CentOS5.8-x86_64/images/xen/vmlinuz<br /></li><li>Kernel Options : {}<br /></li><li>Kernel Options (Post Install) : {}<br /></li><li>Kickstart Metadata : {'tree': 'http://@@http_server@@/cblr/links/CentOS5.8-xen-x86_64'}<br /></li><li>Management Classes : []<br /></li><li>OS Version : rhel5<br /></li><li>Owners : ['admin']<br /></li><li>Red Hat Management Key : <<inherit>><br /></li><li>Red Hat Management Server : <<inherit>><br /></li><li>Template Files : {}<br /></li><li><br /></li><li>Name : CentOS5.8-x86_64<br /></li><li>Architecture : x86_64<br /></li><li>TFTP Boot Files : {}<br /></li><li>Breed : redhat<br /></li><li>Comment : <br /></li><li>Fetchable Files : {}<br /></li><li>Initrd : /var/www/cobbler/ks_mirror/CentOS5.8-x86_64/images/pxeboot/initrd.img<br /></li><li>Kernel : /var/www/cobbler/ks_mirror/CentOS5.8-x86_64/images/pxeboot/vmlinuz<br /></li><li>Kernel Options : {}<br /></li><li>Kernel Options (Post Install) : {}<br /></li><li>Kickstart Metadata : {'tree': 'http://@@http_server@@/cblr/links/CentOS5.8-x86_64'}<br /></li><li>Management Classes : []<br /></li><li>OS Version : rhel5<br /></li><li>Owners : ['admin']<br /></li><li>Red Hat Management Key : <<inherit>><br /></li><li>Red Hat Management Server : <<inherit>><br /></li><li>Template Files : {}<br /></li><li><br /></li><li><br /></li><li>profiles:<br /></li><li>==========<br /></li><li>Name : CentOS5.8-xen-x86_64<br /></li><li>TFTP Boot Files : {}<br /></li><li>Comment : <br /></li><li>DHCP Tag : default<br /></li><li>Distribution : CentOS5.8-xen-x86_64<br /></li><li>Enable gPXE? : 0<br /></li><li>Enable PXE Menu? : 1<br /></li><li>Fetchable Files : {}<br /></li><li>Kernel Options : {}<br /></li><li>Kernel Options (Post Install) : {}<br /></li><li>Kickstart : /var/lib/cobbler/kickstarts/sample.ks              kickstart路径<br /></li><li>Kickstart Metadata : {}<br /></li><li>Management Classes : []<br /></li><li>Management Parameters : <<inherit>><br /></li><li>Name Servers : []<br /></li><li>Name Servers Search Path : []<br /></li><li>Owners : ['admin']<br /></li><li>Parent Profile : <br /></li><li>Internal proxy : <br /></li><li>Red Hat Management Key : <<inherit>><br /></li><li>Red Hat Management Server : <<inherit>><br /></li><li>Repos : []<br /></li><li>Server Override : <<inherit>><br /></li><li>Template Files : {}<br /></li><li>Virt Auto Boot : 1<br /></li><li>Virt Bridge : xenbr0<br /></li><li>Virt CPUs : 1<br /></li><li>Virt Disk Driver Type : raw<br /></li><li>Virt File Size(GB) : 5<br /></li><li>Virt Path : <br /></li><li>Virt RAM (MB) : 512<br /></li><li>Virt Type : xenpv<br /></li><li><br /></li><li>Name : CentOS5.8-x86_64<br /></li><li>TFTP Boot Files : {}<br /></li><li>Comment : <br /></li><li>DHCP Tag : default<br /></li><li>Distribution : CentOS5.8-x86_64<br /></li><li>Enable gPXE? : 0<br /></li><li>Enable PXE Menu? : 1<br /></li><li>Fetchable Files : {}<br /></li><li>Kernel Options : {}<br /></li><li>Kernel Options (Post Install) : {}<br /></li><li>Kickstart : /var/lib/cobbler/kickstarts/sample.ks<br /></li><li>Kickstart Metadata : {}<br /></li><li>Management Classes : []<br /></li><li>Management Parameters : <<inherit>><br /></li><li>Name Servers : []<br /></li><li>Name Servers Search Path : []<br /></li><li>Owners : ['admin']<br /></li><li>Parent Profile : <br /></li><li>Internal proxy : <br /></li><li>Red Hat Management Key : <<inherit>><br /></li><li>Red Hat Management Server : <<inherit>><br /></li><li>Repos : []<br /></li><li>Server Override : <<inherit>><br /></li><li>Template Files : {}<br /></li><li>Virt Auto Boot : 1<br /></li><li>Virt Bridge : xenbr0<br /></li><li>Virt CPUs : 1<br /></li><li>Virt Disk Driver Type : raw<br /></li><li>Virt File Size(GB) : 5<br /></li><li>Virt Path : <br /></li><li>Virt RAM (MB) : 512<br /></li><li>Virt Type : kvm<br /></li><li><br /></li><li><br /></li><li>systems:<br /></li><li>==========<br /></li><li><br /></li><li>repos:<br /></li><li>==========<br /></li><li><br /></li><li>images:<br /></li><li>==========<br /></li><li><br /></li><li>mgmtclasses:<br /></li><li>==========<br /></li><li><br /></li><li>packages:<br /></li><li>==========<br /></li><li><br /></li><li>files:<br /></li><li>========== </li></ol>


<ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li>[root@bogon ~]# cobbler distro list<br /> </li><li>CentOS5.8-x86_64<br /></li><li>CentOS5.8-xen-x86_64</li></ol>
5. Client usage The pxe network will be installed automatically upon startup.




Supplement:
#Rename installation option name:
cobbler profile rename --name='old name' –newname='new name '
#Remove option:
cobbler profile rename --name='old name'




















www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1110194.htmlTechArticleAutomated operation and maintenance of cobbler batch deployment of operating systems (1) Note: This article only introduces the simple installation and use of cobbler. The advanced operations will be sorted out later when I have time. The cobbler installation system is...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn