missing-cn 阅读(210) 评论(0)

5、设定安装的kickstart文件

目的

测试ceph主机的安装的kickstart文件

磁盘配置

4块500G盘做了raid5,一块600G做了raid0
raid5 上做了两个vg,给ceph虚拟出两块硬盘

ks文件中part部分配置

#part
part /boot --fstype="xfs"  --size=500
part pv.01 --maxsize=307200
part pv.02 --grow
volgroup centos  pv.01
volgroup ceph    pv.02
logvol /  --fstype="xfs" --size=51200 --name=root --vgname=centos
logvol swap  --fstype="swap" --size=8192 --name=swap --vgname=centos
logvol /cdc  --vgname=centos --size=102400   --name=cdcvol --fstype=xfs

6、设置该机器的system

设置profile使用上面的ks文件

cobbler profile edit --name=CentOS_7.2_X86_64-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ceph.ks根据mac地址设置

cobbler system add --name=ceph --mac=00:22:19:69:58:27 --ip-address=192.168.1.241 --subnet=255.255.255.0 \ --gateway=192.168.1.254 --interface=em1 --static=1 --profile=CentOS_7.2_X86_64-x86_64

补充 dns设置

cobbler system edit --name=ceph --name-servers="192.168.1.230 8.8.8.8"确认

cobbler system list
   ceph
   h210
   h230
   h240

cobbler配置更新

cobbler sync

7、在241上安装koan,自动重装

先安装epel仓库

yum install -y epel-release 再安装koan

yum install -y koan

8、在241上确认koan能访问cobbler服务器上的新配置

koan --display --server=192.168.1.164  --profile=CentOS_7.2_X86_64-x86_64
- looking for Cobbler at http://192.168.1.164:80/cobbler_api
- reading URL: http://192.168.1.164/cblr/svc/op/ks/profile/CentOS_7.2_X86_64-x86_64
install_tree: http://192.168.1.164/cblr/links/CentOS_7.2_X86_64-x86_64
                name  : CentOS_7.2_X86_64-x86_64
              distro  : CentOS_7.2_X86_64-x86_64
           kickstart  : http://192.168.1.164/cblr/svc/op/ks/profile/CentOS_7.2_X86_64-x86_64
             ks_meta  : tree=http://@@http_server@@/cblr/links/CentOS_7.2_X86_64-x86_64
        install_tree  : http://192.168.1.164/cblr/links/CentOS_7.2_X86_64-x86_64
              kernel  : /var/www/cobbler/ks_mirror/CentOS_7.2_X86_64/images/pxeboot/vmlinuz
              initrd  : /var/www/cobbler/ks_mirror/CentOS_7.2_X86_64/images/pxeboot/initrd.img
      kernel_options  : ks=http://192.168.1.164/cblr/svc/op/ks/profile/CentOS_7.2_X86_64-x86_64 ksdevice=link kssendmac lang= text
               repos  :
            virt_ram  : 512
    virt_disk_driver  : raw
           virt_type  : kvm
           virt_path  :
      virt_auto_boot  : 1

9、执行重装(可以有两种profile和system)

koan --replace-self --server=192.168.1.164  --profile=CentOS_7.2_X86_64-x86_64
- looking for Cobbler at http://192.168.1.164:80/cobbler_api
- reading URL: http://192.168.1.164/cblr/svc/op/ks/profile/CentOS_7.2_X86_64-x86_64
install_tree: http://192.168.1.164/cblr/links/CentOS_7.2_X86_64-x86_64
downloading initrd initrd.img to /boot/initrd.img_koan
url=http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/initrd.img
- reading URL: http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/initrd.img
downloading kernel vmlinuz to /boot/vmlinuz_koan
url=http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/vmlinuz
- reading URL: http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/vmlinuz
- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz_koan', '--initrd', '/boot/initrd.img_koan', '--args', '"ks=http://192.168.1.164/cblr/svc/op/ks/profile/CentOS_7.2_X86_64-x86_64 ksdevice=link kssendmac lang= text "', '--copy-default', '--make-default', '--title=kick1457596394']
- ['/sbin/grubby', '--update-kernel', '/boot/vmlinuz_koan', '--remove-args=root']
- reboot to apply changes

以单独配置的system安装

koan --replace-self --server=192.168.1.164  --system=ceph
- looking for Cobbler at http://192.168.1.164:80/cobbler_api
- reading URL: http://192.168.1.164/cblr/svc/op/ks/system/ceph
install_tree: http://192.168.1.164/cblr/links/CentOS_7.2_X86_64-x86_64
downloading initrd initrd.img to /boot/initrd.img_koan
url=http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/initrd.img
- reading URL: http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/initrd.img
downloading kernel vmlinuz to /boot/vmlinuz_koan
url=http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/vmlinuz
- reading URL: http://192.168.1.164/cobbler/images/CentOS_7.2_X86_64-x86_64/vmlinuz
- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz_koan', '--initrd', '/boot/initrd.img_koan', '--args', '"ks=http://192.168.1.164/cblr/svc/op/ks/system/ceph ksdevice=link kssendmac lang= text "', '--copy-default', '--make-default', '--title=kick1457616034']
- ['/sbin/grubby', '--update-kernel', '/boot/vmlinuz_koan', '--remove-args=root']
- reboot to apply changes

10、reboot 然后喝茶等待重装完毕

11、重新划分raid

ceph可以直接使用物理磁盘,所以将调整如下

系统盘:2块500G做aid1,作为系统安装使用
osd1:1块500G
osd2:1块600G

那么ks文件分区修改如下:

part /boot --fstype="xfs"  --size=500  --ondisk=sda    ## 必须指定磁盘,否则cobbler会出错
part pv.01 --grow  --ondisk=sda                        ## 必须指定磁盘,否则cobbler会出错
volgroup centos  pv.01
logvol /  --fstype="xfs" --size=51200 --name=root --vgname=centos
logvol swap  --fstype="swap" --size=8192 --name=swap --vgname=centos