Foreman 구성 I
페이지 정보
작성자 꿈꾸는여행자 작성일 25-04-09 10:41 조회 1,618 댓글 0본문
안녕하세요.
꿈꾸는여행자입니다.
이번에는 Foreman을 주제로 다루고자 합니다.
기본 Forman 구성 후 활용 방안에 대해서 확장해 나가 보겠습니다.
> 다음
1. Foreman 구성
- VM - RockyLinux 9.5 구성
목차
I. Overview
1. 구성도
II. Rocky Linux 9.5
1. Installing Rocky Linux 9
1.1. OS Installation Prerequisites
1.2. Verifying the Installer ISO File
1.3. The Installation
1.3.1. Use KVM Virtualization
1.3.1.1. Create a disk of Virtual Machine
1.3.1.2. Create a new virtual machine
1.3.2. Create KVM VM from Qcow2 with Command
1.3.2.1. Copy qcow2 file
1.3.2.2. Create VM
2. Configure
2.1. Network
2.1.1. IP
상세 내역은 아래와 같습니다.
감사합니다.
> 아래
I. Overview
1. 구성도
https://foreman.lds.internal:31183
________________
II. Rocky Linux 9.5
1. Installing Rocky Linux 9
https://docs.rockylinux.org/guides/installation/
https://docs.rockylinux.org/guides/8_6_installation/
1.1. OS Installation Prerequisites
* The latest ISO image for the version of Rocky Linux that we will be using for this installation can be downloaded from here:
* https://www.rockylinux.org/download/
* To download the ISO directly from the command line on an existing Linux based system use the wget command:
cd /data/libvirt/images/ISO
wget \
https://dl.rockylinux.org/vault/rocky/9.5/isos/x86_64/Rocky-9.5-x86_64-dvd.iso
1.2. Verifying the Installer ISO File
First download the file that contains the official checksums for the available ISOs. While still in the folder that contains the downloaded Rocky Linux ISO download the checksum file for the ISO, type:
cd /data/libvirt/images/ISO
wget \
https://dl.rockylinux.org/vault/rocky/9.5/isos/x86_64/Rocky-9.5-x86_64-dvd.iso.CHECKSUM
cp \
Rocky-9.5-x86_64-dvd.iso.CHECKSUM \
CHECKSUM
* Use the sha256sum utility to verify the integrity of the ISO file against corruption and/or tampering.
sha256sum -c CHECKSUM --ignore-missing
[root@host ISO]# sha256sum -c Rocky-9.5-x86_64-dvd.iso.CHECKSUM --ignore-missing
Rocky-9.5-x86_64-dvd.iso: OK
[root@host ISO]#
1.3. The Installation
1.3.1. Use KVM Virtualization
* On Host
1.3.1.1. Create a disk of Virtual Machine
* qemu-img 명령어 사용
* 필요한 용량을 사용하기 위해 qemu-img 사용하여 qcow2 파일 생성
cd /var/lib/libvirt/images
cd /data/libvirt/images/pool/
qemu-img create -f qcow2 rocky-linux-9.5.qcow2 100G
chown qemu:qemu rocky-linux-9.5.qcow2
[root@host ~]# cd /data/libvirt/images/pool/
[root@host pool]# qemu-img create -f qcow2 rocky-linux-9.5.qcow2 100G
Formatting 'rocky-linux-9.5.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=107374182400 lazy_refcounts=off refcount_bits=16
[root@host pool]# chown qemu:qemu rocky-linux-9.5.qcow2
[root@host pool]#
1.3.1.2. Create a new virtual machine
* Execute virt-manager
virt-manager
[root@host ~]# virt-manager
[root@host ~]#
* Create VM
* virt-install 명령어를 사용 빠른 VM 생성 진행
* Create VM Info
* --graphics vnc
* vnc 사용 및 자동 port 할당
* --disk /data/libvirt/images/pool/rocky-linux-9.5.qcow2
* 기존 생성한 Disk 사용
* --network network:default
* 사용할 network
virt-install --os-variant list
virt-install \
-n rocky95 \
--description "Rocky Linux 9.5" \
--os-variant=rocky9 \
--ram=8192 \
--vcpus=4 \
--graphics vnc \
--disk /data/libvirt/images/pool/rocky-linux-9.5.qcow2 \
--network network:default \
--cdrom=/data/libvirt/images/ISO/Rocky-9.5-x86_64-dvd.iso \
--noautoconsole
[root@host pool]# virt-install \
-n rocky95 \
--description "Rocky Linux 9.5" \
--os-variant=rocky9 \
--ram=8192 \
--vcpus=4 \
--graphics vnc \
--disk /data/libvirt/images/pool/rocky-linux-9.5.qcow2 \
--network network:default \
--cdrom=/data/libvirt/images/ISO/Rocky-9.5-x86_64-dvd.iso \
--noautoconsole
Starting install...
Creating domain... | 00:00:00
Domain is still running. Installation may be in progress.
You can reconnect to the console to complete the installation process.
[root@host pool]#
* Rocky Linux 설치
* 기본 Rocky Linux 설치 내역을 참고 하여 설치 진행
* 설치 완료
1.3.2. Create KVM VM from Qcow2 with Command
* Rocky Linux 9.5 설치된 Image를 골드 이미지 형태로 사용
1.3.2.1. Copy qcow2 file
* Copy and Set permission file
cp \
/data/libvirt/images/pool/rocky-linux-9.5.qcow2 \
/data/libvirt/images/pool/foreman-rocky9.5.qcow2
chown qemu:qemu /data/libvirt/images/pool/foreman-rocky9.5.qcow2
[root@host ~]# cp \
/data/libvirt/images/pool/rocky-linux-9.5.qcow2 \
/data/libvirt/images/pool/foreman-rocky9.5.qcow2
[root@host ~]# chown qemu:qemu /data/libvirt/images/pool/foreman-rocky9.5.qcow2
[root@host ~]#
1.3.2.2. Create VM
* Create VM by copied qcow2 file
virt-install \
--import \
-n foreman-rocky95 \
--description "foreman rocky 9.5" \
--os-variant=rocky9 \
--ram=24576 \
--vcpus=4 \
--graphics vnc \
--disk /data/libvirt/images/pool/foreman-rocky9.5.qcow2 \
--network network:default \
--noautoconsole
[root@host ~]# virt-install \
--import \
-n foreman-rocky95 \
--description "foreman rocky 9.5" \
--os-variant=rocky9 \
--ram=24576 \
--vcpus=4 \
--graphics vnc \
--disk /data/libvirt/images/pool/foreman-rocky9.5.qcow2 \
--network network:default \
--noautoconsole
Starting install...
Creating domain... | 00:00:00
Domain creation completed.
[root@host ~]#
________________
2. Configure
2.1. Network
2.1.1. IP
Rocky Linux에서 `nmcli` 명령어를 사용하여 IP 설정합니다.
* 네트워크 디바이스 이름 확인:
nmcli dev
[root@localhost ~]# nmcli dev
DEVICE TYPE STATE CONNECTION
enp1s0 ethernet connected enp1s0
virbr0 bridge connected (externally) virbr0
lo loopback unmanaged --
[root@localhost ~]#
* 네트워크 정보 설정:
nmcli con mod enp1s0 \
ipv4.addresses 192.168.50.79/24 \
ipv4.gateway 192.168.50.1 \
ipv4.dns 8.8.8.8 \
ipv4.method manual \
connection.autoconnect yes
[root@localhost ~]# nmcli con mod enp1s0 \
ipv4.addresses 192.168.50.79/24 \
ipv4.gateway 192.168.50.1 \
ipv4.dns 8.8.8.8 \
ipv4.method manual \
connection.autoconnect yes
[root@localhost ~]#
* 네트워크 활성화:
nmcli con up enp1s0
[root@localhost ~]# nmcli con up enp1s0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
[root@localhost ~]#
댓글목록 0
등록된 댓글이 없습니다.
