본문 바로가기

가상화

xenserver centos7 template image 만들기

1. centos7을 minimal 로 설치한다.

 

2. 패키지를 업데이트 한다.

    yum update

 

3. selinux 비 활성화
    sestatus

    sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
    reboot

 

4. xen client 설치

    mkdir /mnt/xs-tools
    mount /dev/cdrom /mnt/xs-tools
    cd /mnt/xs-tools/Linux
    ./install.sh

 

5. 배포판 버전 확인
    cat /etc/redhat-release

 

6. 방화벽 해제
    systemctl stop firewalld.service
    systemctl disable firewalld.service

 

7. 각종 불필요한 로그 서비스 종료

    service rsyslog stop
    service auditd stop

 

8. 커널 정리

    yum install yum-utils -y
    rpm -q kernel
    package-cleanup --oldkernels --count=1
    yum clean all

 

9. 불필요한 파일 제거
    rm -rf /var/tmp/*
    rm -f /etc/ssh/*key*
    rm -f ~root/.bash_history
    unset HISTFILE
    rm -rf ~root/.ssh/
    rm -f ~root/anaconda-ks.cfg

10 NIC UUID 제거
    vi /etc/sysconfig/network-scripts/ifcfg-eth0
    UUID 정보를 삭제한다.

 

11. 종료

     shutdown -h now