kickstart를 통해 고정 IP 주소로 CentOS 7을 설치합니다.

kickstart를 통해 고정 IP 주소로 CentOS 7을 설치합니다.

kickstart파일을 사용하여 고정 IP 네트워크로 CentOS 7 게스트 가상 머신을 설치할 때 다음 오류가 발생합니다.

[3.835698] dracut-cmdline[81]: parse-kickstart ERROR: 
    'network --bootproto=static --ip=12.34.567.8aa --netmask=255.255.255.248 --gateway=12.34.567.8bb --nameserver=xx.xx.xx.xx,xx.xx.yy.yy': 
    missing --device

기본 NAT 구성을 대체하기 위해 호스트에 고정 IP가 있는 브리지 네트워크가 설정되지 않은 것이 문제인 것 같습니다. 그런데 이 오류를 해결하려면 어떤 특정 명령을 입력해야 합니까?


시작 파일:

시작 파일은 다음과 같습니다.

#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512

# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --device=eno1 --onboot=on --activate
network  --bootproto=static --ip=12.34.567.8aa --netmask=255.255.255.248 --gateway=12.34.567.8bb --nameserver=xx.xx.xx.xx,xx.xx.yy.yy
network  --hostname=localhost.localdomain
# Root password
rootpw --iscrypted someLongHashedPassword
# System timezone
timezone someTimeZone --isUtc --nontp
user --name=someUserName --password=someLongHashedPassword --iscrypted --gecos="someUserName"
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Partition clearing information.  Erases all partitions from the sda drive.
clearpart --all --initlabel --drives=sda
# Disk partitioning information
part pv.204 --fstype="lvmpv" --ondisk=sda --size=1902212
part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
part /boot --fstype="xfs" --ondisk=sda --size=500
volgroup centos --pesize=4096 pv.204
logvol /  --fstype="xfs" --grow --maxsize=51200 --size=1024 --name=root --vgname=centos
logvol /home  --fstype="xfs" --size=230400 --name=home --vgname=centos
logvol swap  --fstype="swap" --size=7808 --name=swap --vgname=centos

%packages
@base
@compat-libraries
@core
@debugging
@development
@network-file-system-client
@remote-system-management
@security-tools
@smart-card
@virtualization-hypervisor
@virtualization-platform
@virtualization-tools
@virtualization-client
kexec-tools

%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end


virt-install주문하다:

참고로 virt-install설치를 트리거하는 명령은 다음과 같습니다.

virt-install \
   --name=public-centos7 \
   --disk path=/dev/mapper/centos-fifth,size=241 \
   --graphics none --vcpus=1 --memory=2048 \
   --location /tmp/CentOS-7-x86_64-Minimal-1611.iso \
   --network bridge=virbr0 --os-type=linux --os-variant=rhel7.0 \
   --initrd-inject=/tmp/vm.ks \
   --extra-args "ks=file:/tmp/vm.ks console=ttyS0"


현재 구성:
또한 brctl show호스트 시스템에 다음이 제공됩니다.

[root@remote-host ~]# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.525400c4a345       yes             virbr0-nic
                                                        vnet0


다음에 추가--device=eno1

@thrig의 제안에 따라 킥스타트 파일의 잘못된 줄을 다음과 같이 변경했습니다.

# Network information
network  --onboot=on --activate
network  --bootproto=static --ip=12.34.567.8aa --netmask=255.255.255.248 --gateway=12.34.567.8bb --nameserver=xx.xx.xx.xx,xx.xx.yy.yy --device=eno1
network  --hostname=localhost.localdomain  

이것으로 오류가 해결된 것 같습니다. 하지만 아직 다운스트림 문제를 파악 중이기 때문에 확실하지 않습니다.

답변1

오류 메시지는 " missing --device"를 나타내므로 장치를 네트워크 구성 줄과 연결하는 것이 가장 좋습니다.

network  --bootproto=static --ip=... --device=eno1

ksdevice=eth0 net.ifnames=0 biosdevname=0이를 제어할 수 있는 다른 옵션(예: PXE 부팅에 커널 매개변수 사용)이 있지만 장치 이름이 PCI 위치에 따라 알 수 없는 이름으로 밝혀지면 문제가 될 수 있습니다. 특히,redhat "설치 가이드" 문서실제로 장치 이름을 지정해야 함을 나타냅니다.

이는 더 이상 사용되지 않는 동작으로 간주됩니다. 대부분의 경우 항상 --device=네트워크 명령당 하나씩 지정해야 합니다. 옵션이 누락된 경우 --device=동일한 킥스타트 파일에 있는 후속 네트워크 명령의 동작이 지정되지 않습니다.

관련 정보