RHEL7 Sealing

가상환경이나 클라우드 환경에서 템플릿을 만들기 위해 해당 시스템을 봉인하는 방법에 대해 설명한다.

# yum install initial-setup  <------ Customer has to register system for install this latest package.
# rm -rf /etc/ssh/ssh_host_*
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="AA:BB:CC:DD:EE:FF"         <-------- remove this line
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="954bd22c-f96c-4b59-9445-b39dd86ac8ab" <-------- remove this line
# rm -rf /etc/udev/rules.d/70-persistent-*
# cat /etc/hostname
localhost.localdomain
# cd /etc
# chmod 777 machine-id
# vi machine-id
    delete machine id.
# chmod 444 machine-id
~~~
# systemctl enable initial-setup-graphical.service
or
# systemctl enable initial-setup-text.service 
or
# systemctl enable initial-setup.service
~~~
# rm /etc/iscsi/initiatorname.iscsi
# subscription-manager ungregister
# subscription-manager remove --all
# subscription-manager clean
# poweroff

참조링크