차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
rhel_cloud_qcow_이미지_설정 [2021/04/01 09:20] zzungrhel_cloud_qcow_이미지_설정 [2023/11/07 08:23] (현재) koov
줄 1: 줄 1:
- 
 <WRAP center round info 100%> <WRAP center round info 100%>
-해당 문서는 KVM 에 배포할 redhat qcow guest image 생성하는 방법을 작성한 문서 입니다. +해당 문서는 KVM 에 배포할 redhat qcow guest image 생성하는 방법을 작성한 문서 입니다. 
 + 
 +### 2021.08.02 RHEL8 관련 내용 추가  
 +참고 : RHEL 8 guest image 생성시 호스트 서버가 RHEL8 이여야 한다. url : https://access.redhat.com/solutions/4073061
 </WRAP> </WRAP>
  
줄 7: 줄 9:
 <WRAP prewrap> <WRAP prewrap>
 <code bash> <code bash>
- # 참고 url : https://access.redhat.com/solutions/894123+ # RHEL6 ~ RHEL7.5 url : https://access.redhat.com/solutions/894123 
 + # RHEL8.4 url : https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.4/x86_64/product-software
 </code> </code>
 </WRAP> </WRAP>
줄 18: 줄 21:
  # yum -y install guestfish  # yum -y install guestfish
  # systemctl start libvirtd  # systemctl start libvirtd
 +</code>
 +</WRAP>
 +
 +  * RHEL 8의 경우
 +<WRAP prewrap>
 +<code bash>
 +[root@localhost ~]# yum -y install libguestfs-tools-c libguestfs-bash-completion
 </code> </code>
 </WRAP> </WRAP>
줄 48: 줄 58:
 # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "rm -rf /etc/localtime" # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "rm -rf /etc/localtime"
 # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime" # virt-customize -a rhel-server-7.9-x86_64-kvm.qcow2 --run-command "ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime"
 +
 +## RHEL8 timezone 변경 방법
 +# virt-customize -a rhel-8.4-x86_64-kvm.qcow2 --timezone "Asia/Seoul"
  
 ## repository 추가 방법 ## repository 추가 방법
줄 54: 줄 67:
 </code> </code>
 </WRAP> </WRAP>
 +
 +
 +==== RHEL8 Guest Image 생성 안되는 현상  ====
 +<WRAP>
 +<code bash>
 +## RHEL7 기반에서 RHEL8 Guest Image 편집 시 아래와 같은 문구가 발생 하면서 편집이 안됨
 +# virt-customize -a rhel-8.4.qcow2 --root-password password:SomePassword12345!
 +virt-customize: warning: mount: mount exited with status 32: mount: wrong
 +fs type, bad option, bad superblock on /dev/sda1,
 +       missing codepage or helper program, or other error
 +
 +       In some cases useful info is found in syslog - try
 +       dmesg | tail or so. (ignored)
 +virt-customize: error: libguestfs error: is_dir: is_dir_stub: you must call
 +'mount' first to mount the root filesystem
 +
 +If reporting bugs, run virt-customize with debugging enabled and include
 +the complete output:
 +
 +  virt-customize -v -x [...]
 +  
 +  
 +## 해결 
 +RHEL7 기반 호스트 에서 RHEL8 GuestImage 생성 할 수 없다. 
 +RHEL8 기반 호스트 에서 이미지 편집을 해야 한다. 
 +또한 virt-customize 로만 편집이 가능하며, 기존에 추가적으로 이미지 생성에 사용한 guestfish 는 더이상 지원하지 않는다. 
 +
 +</code>
 +</WRAP>
 +
 +===== 오류 =====
 +
 +<WRAP prewrap>
 +<code bash>
 +[   0.0] Examining the guest ...
 +virt-customize: error: libguestfs error: could not create appliance through
 +libvirt.
 +
 +Try running qemu directly without libvirt using this environment variable:
 +export LIBGUESTFS_BACKEND=direct
 +
 +Original error from libvirt: Cannot access storage file
 +'/root/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2' (as uid:107,
 +gid:107): Permission denied [code=38 int1=13]
 +
 +If reporting bugs, run virt-customize with debugging enabled and include
 +the complete output:
 +
 +  virt-customize -v -x [...]
 +</code>
 +</WRAP>
 +위의 경우 환경변수에 ''LIBGUESTFS_BACKEND'' 가 설정되어있지 않아 발생하는 오류이다.
 +에러메시지에 나온대로 ''export LIBGUESTFS_BACKEND=direct''를 설정하면 된다.
 +
  • rhel_cloud_qcow_이미지_설정.1617268857.txt.gz
  • 마지막으로 수정됨: 2021/04/01 09:20
  • 저자 zzung