Linux 运维自动化之Cobbler的管理与使用详解(2)

三、导入要安装的镜像文件
1.镜像文件
CentOS-5.5-x86_64-bin-DVD-1of2.iso

CentOS-6.4-x86_64-bin-DVD1.iso

注,这里我们主要演示两个系统。一个是CentOS 5.5,另一个是CentOS6.4。这两个系统是现在比较常用的两个,重点给大家演示一下怎么导入系统。(在上篇博客中我们已经安装好Cobbler,并修改好相关配置,但是没有导入任何系统,不清楚的博友可以先参考一下上一篇博客:  。下面我们就来具体演示一下!)


2.导入CentOS 5.5镜像
(1).选择CentOS 5.5镜像

Linux 运维自动化之Cobbler的管理与使用详解

(2).选择 “使用ISO映像文件”

Linux 运维自动化之Cobbler的管理与使用详解

(3).选择 “CentOS-5.5-x86_64-bin-DVD-1of2.iso”,并确定。

Linux 运维自动化之Cobbler的管理与使用详解

(4).挂载镜像
[root@node2 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@node2 ~]# cd /mnt/
[root@node2 mnt]# ls
CentOS  RELEASE-NOTES-cs    RELEASE-NOTES-en_US    RELEASE-NOTES-ja    RELEASE-NOTES-ro
EULA  RELEASE-NOTES-cs.html RELEASE-NOTES-en_US.html RELEASE-NOTES-ja.html  RELEASE-NOTES-ro.html
GPL    RELEASE-NOTES-de    RELEASE-NOTES-es    RELEASE-NOTES-nl    repodata
images  RELEASE-NOTES-de.html RELEASE-NOTES-es.html  RELEASE-NOTES-nl.html  RPM-GPG-KEY-beta
isolinux RELEASE-NOTES-en    RELEASE-NOTES-fr    RELEASE-NOTES-pt_BR    RPM-GPG-KEY-CentOS-5
NOTES  RELEASE-NOTES-en.html RELEASE-NOTES-fr.html  RELEASE-NOTES-pt_BR.html TRANS.TBL
(5).使用cobbler import命令导入镜像
[root@node2 mnt]# cobbler import --help
Usage: cobbler [options]
Options:
 -h, --help      show this help message and exit
 --arch=ARCH      OS architecture being imported
 --breed=BREED    the breed being imported
 --os-version=OS_VERSION
            the version being imported
 --path=PATH      local path or rsync location
 --name=NAME      name, ex 'RHEL-5'
 --available-as=AVAILABLE_AS
            tree is here, don't mirror
 --kickstart=KICKSTART_FILE
            assign this kickstart file
 --rsync-flags=RSYNC_FLAGS
            pass additional flags to rsync

注,主要有以下几个参数--path 指定导入镜像的路径,--name 指定导入镜像的名称,--arch 指定导入镜像的架构(32位还是64位)。还有需要说明的是这里导入的时间相对较长大概在5-10分钟左右,请大家耐心等待。下面是具体的导入过程,
[root@node2 ~]# cobbler import --path=/mnt/ --name=CentOS-5.5 --arch=x86_64
task started: 2013-11-11_154941_import
task started (id=Media import, time=Mon Nov 11 15:49:41 2013)
Found a candidate signature: breed=RedHat, version=rhel5
Found a matching signature: breed=redhat, version=rhel5
Adding distros from path /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64:
creating new distro: CentOS-5.5-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64 -> /var/www/cobbler/links/CentOS-5.5-x86_64
creating new profile: CentOS-5.5-x86_64
creating new distro: CentOS-5.5-xen-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64 -> /var/www/cobbler/links/CentOS-5.5-xen-x86_64
creating new profile: CentOS-5.5-xen-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64 for CentOS-5.5-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64
looking for /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/repodata/*comps*.xml
running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/repodata/comps.xml /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64
received on stdout: Spawning worker 0 with 3392 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
received on stderr:
starting descent into /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64 for CentOS-5.5-xen-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64
looking for /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/repodata/*comps*.xml
*** TASK COMPLETE ***

注,从上面显示信息所知,cobbler会将镜像中的拷贝到本地一份,放在/var/www/cobbler/ks_mirrors下的CentOS-5.5-x86_64目录下。同时会创建一个名字为CentOS-5.5-x86_64的一个发布版本,以及一个名字为CentOS-5.5-x86_64的profile文件。下面我们来具体查看一下,
[root@node2 cobbler]# cobbler list
distros:
  CentOS-5.5-x86_64
  CentOS-5.5-xen-x86_64
profiles:
  CentOS-5.5-x86_64
  CentOS-5.5-xen-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:

(6).cobbler report 查看一下详细信息
[root@node2 ks_mirror]# cobbler report
distros:
==========
Name              : CentOS-5.5-x86_64
Architecture          : x86_64
TFTP Boot Files        : {}
Breed            : redhat
Comment            :
Fetchable Files        : {}
Initrd            : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/images/pxeboot/initrd.img
Kernel            : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/images/pxeboot/vmlinuz
Kernel Options        : {}
Kernel Options (Post Install) : {}
Kickstart Metadata      : {'tree': 'http://@@http_server@@/cblr/links/CentOS-5.5-x86_64'}
Management Classes      : []
OS Version          : rhel5
Owners            : ['admin']
Red Hat Management Key    : <<inherit>>
Red Hat Management Server  : <<inherit>>
Template Files        : {}
Name              : CentOS-5.5-xen-x86_64
Architecture          : x86_64
TFTP Boot Files        : {}
Breed            : redhat
Comment            :
Fetchable Files        : {}
Initrd            : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/images/xen/initrd.img
Kernel            : /var/www/cobbler/ks_mirror/CentOS-5.5-x86_64/images/xen/vmlinuz
Kernel Options        : {}
Kernel Options (Post Install) : {}
Kickstart Metadata      : {'tree': 'http://@@http_server@@/cblr/links/CentOS-5.5-xen-x86_64'}
Management Classes      : []
OS Version          : rhel5
Owners            : ['admin']
Red Hat Management Key    : <<inherit>>
Red Hat Management Server  : <<inherit>>
Template Files        : {}
profiles:
==========
Name              : CentOS-5.5-x86_64
TFTP Boot Files        : {}
Comment            :
DHCP Tag            : default
Distribution          : CentOS-5.5-x86_64
Enable gPXE?          : 0
Enable PXE Menu?        : 1
Fetchable Files        : {}
Kernel Options        : {}
Kernel Options (Post Install) : {}
Kickstart          : /var/lib/cobbler/kickstarts/sample.ks
Kickstart Metadata      : {}
Management Classes      : []
Management Parameters    : <<inherit>>
Name Servers          : []
Name Servers Search Path    : []
Owners            : ['admin']
Parent Profile        :
Proxy            :
Red Hat Management Key    : <<inherit>>
Red Hat Management Server  : <<inherit>>
Repos            : []
Server Override        : <<inherit>>
Template Files        : {}
Virt Auto Boot        : 1
Virt Bridge          : xenbr0
Virt CPUs          : 1
Virt Disk Driver Type    : raw
Virt File Size(GB)      : 5
Virt Path          :
Virt RAM (MB)        : 512
Virt Type          : kvm
Name              : CentOS-5.5-xen-x86_64
TFTP Boot Files        : {}
Comment            :
DHCP Tag            : default
Distribution          : CentOS-5.5-xen-x86_64
Enable gPXE?          : 0
Enable PXE Menu?        : 1
Fetchable Files        : {}
Kernel Options        : {}
Kernel Options (Post Install) : {}
Kickstart          : /var/lib/cobbler/kickstarts/sample.ks
Kickstart Metadata      : {}
Management Classes      : []
Management Parameters    : <<inherit>>
Name Servers          : []
Name Servers Search Path    : []
Owners            : ['admin']
Parent Profile        :
Proxy            :
Red Hat Management Key    : <<inherit>>
Red Hat Management Server  : <<inherit>>
Repos            : []
Server Override        : <<inherit>>
Template Files        : {}
Virt Auto Boot        : 1
Virt Bridge          : xenbr0
Virt CPUs          : 1
Virt Disk Driver Type    : raw
Virt File Size(GB)      : 5
Virt Path          :
Virt RAM (MB)        : 512
Virt Type          : xenpv
systems:
==========
repos:
==========
images:
==========
mgmtclasses:
==========
packages:
==========
files:
==========

好了,到这里我们的CentOS5.5的镜像文件就导入完成了,同样的CentOS 6.4导入方法与CentOS5.5是一样的,在下面我们会为大家具体演示。下面我们为大家演示一下,用客户端安装操作系统!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/18951.html