tech_memo / linux / cobbler / add_new_distribution


tech_memo/linux/cobbler

概要

前提

  • cobblerサーバは構築済み
  • RHEL6.5のInstallファイル群は、/home/ptestuser/RHEL65/Installer/ に存在する
    [root@testserver18 Installer]# pwd
    /home/ptestuser/RHEL65/Installer
    [root@testserver18 Installer]# ls
    EFI      EULA_pt           README                    RELEASE-NOTES-it-IT.html  RELEASE-NOTES-ru-RU.html  RPM-GPG-KEY-redhat-release
    EULA     EULA_zh           RELEASE-NOTES-as-IN.html  RELEASE-NOTES-ja-JP.html  RELEASE-NOTES-si-LK.html  ScalableFileSystem
    EULA_de  GPL               RELEASE-NOTES-bn-IN.html  RELEASE-NOTES-kn-IN.html  RELEASE-NOTES-ta-IN.html  Server
    EULA_en  HighAvailability  RELEASE-NOTES-de-DE.html  RELEASE-NOTES-ko-KR.html  RELEASE-NOTES-te-IN.html  TRANS.TBL
    EULA_es  images            RELEASE-NOTES-en-US.html  RELEASE-NOTES-ml-IN.html  RELEASE-NOTES-zh-CN.html
    EULA_fr  isolinux          RELEASE-NOTES-es-ES.html  RELEASE-NOTES-mr-IN.html  RELEASE-NOTES-zh-TW.html
    EULA_it  LoadBalancer      RELEASE-NOTES-fr-FR.html  RELEASE-NOTES-or-IN.html  repodata
    EULA_ja  media.repo        RELEASE-NOTES-gu-IN.html  RELEASE-NOTES-pa-IN.html  ResilientStorage
    EULA_ko  Packages          RELEASE-NOTES-hi-IN.html  RELEASE-NOTES-pt-BR.html  RPM-GPG-KEY-redhat-beta
  • owner:group=root:root, permission=555

手順

サービスの起動

  • 以下のサービスを起動する
    • cobbler
    • httpd
    • xinetd
      • tftpdを起動するのが目的だが、testserver18では、現在なぜかxinetd経由でtftpdが起動しないので直接起動する
        in.tftpd -l -B 1380 -v -s /tftpboot
  • 各サービスのポートがオープンされているか確認
    [root@testserver18 ~]# netstat -nap | egrep ":80 |:69 |:443 "
    tcp        0      0 :::80                       :::*                        LISTEN      7247/httpd
    tcp        0      0 :::443                      :::*                        LISTEN      7247/httpd
    udp        0      0 0.0.0.0:69                  0.0.0.0:*                               30062/in.tftpd
    udp        0      0 :::69                       :::*                                    30062/in.tftpd

cobbler check

  • testserver18では、以下のWARNは無視可能
    [root@testserver18 ~]# cobbler check
    The following are potential configuration items that you may want to fix:
    
    1 : 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.
    2 : since iptables may be running, ensure 69, 80/443, and 25151 are unblocked
    3 : debmirror package is not installed, it will be required to manage debian deployments and repositories
    4 : 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
    5 : One or more repos referenced by profile objects is no longer defined in cobbler: CentOS5-epel, CentOS5-dag
    6 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

distributionのimport

  • cobbler importコマンドで、Installerディレクトリを指定する
    [root@testserver18 distros.d]# cobbler import --path=/home/ptestuser/RHEL65/Installer/ --name=RHEL6.5
    task started: 2014-11-21_224505_import
    task started (id=Media import, time=Fri Nov 21 22:45:05 2014)
    
    // 中略
    
    received on stderr: This option is deprecated
    
    associating kickstarts
    *** TASK COMPLETE ***
  • Installerディレクトリに、32bit版のdistributionが存在すると、32bit版も同時に作成される。削除してもよいが、今回は残しておく。
    [root@testserver18 ~]# cobbler distro list
      RHEL5.5-x86_64
      RHEL5.5-xen-x86_64
      RHEL6.1-x86_64
      RHEL6.3-x86_64
      RHEL6.5-i386
      RHEL6.5-x86_64
  • profileも同時に作成される
    [root@testserver18 ~]# cobbler profile list
      RHEL5.5-x86_64
      RHEL5.5-xen-x86_64
      RHEL6.1-x86_64
      RHEL6.3-x86_64
      RHEL6.5-i386
      RHEL6.5-x86_64

distribution parameter設定

  • BISON用に、Kernel Options(Post Install)パラメータを設定(RHEL6.3のものとをコピー)参考に色々編集
    [root@testserver18 distros.d]# cobbler distro edit --name=RHEL6.5-x86_64 --kopts-post="processor.max_cstate=1 intel_idle.max_cstate=0 transparent_hugepage=never"
  • ちなみに、OSインストール時に、VNCを立ち上げる場合は、以下のオプションを追加しておく
    --kopts="vnc=~"

kickstartファイルの作成

  • ひとまず、RHEL6.3で使用しているkickstartファイルをコピーする
    [root@testserver18 kickstarts]# pwd
    /var/lib/cobbler/kickstarts
    [root@testserver18 kickstarts]# cp -p myapp.ks myapp_rhel_65.ks

profile parameter設定

  • kickstartファイルのパスを設定
    [root@testserver18 ~]# cobbler profile edit --name=RHEL6.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/myapp_rhel65.ks

cobbler sync

  • cobbler syncをして、distributionの追加は完了

追加したdistributionを使用して、OSインストール (おまけ)

  • silverの環境で、追加したdistributionを使用してOSをインストールする。
    cobbler system add --profile=RHEL6.5-x86_64 --name=vm65a_rhel65 --interface=eth0 --static=yes --mac-address=00:0C:29:A5:FE:2B --ip-address=192.168.0.65 --subnet=255.255.255.0 --gateway=192.168.0.1 --hostname=vm65a
  • koanを使用する場合は、下記Optionも追加。
    --netboot-enabled=False
  • 初めての実行の場合は、Cobblerのインストールが失敗しても、マシンのリブートが可能なところで試すこと。実際、RHEL6.3のkickstartファイルをそのままコピーして使用したが、インストールするPackageが、RHEL5にしか存在ないものを指定しており、エラーになって止まった。