우분투 서버에 Xen 서버 VM 생성

우분투 서버에 Xen 서버 VM 생성

VM 게스트를 생성하는 데 문제가 있습니다. 실행 중인데 xl create /etc/xen/config_vyos.cfg 오류가 발생합니다.

Parsing config from /etc/xen/config_vyos.cfg
libxl: error: libxl_bootloader.c:637:bootloader_finished: bootloader failed - consult logfile /var/log/xen/bootloader.4.log
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: bootloader [2309] exited with error status 1
libxl: error: libxl_create.c:1144:domcreate_rebuild_done: cannot (re-)build domain: -3
libxl: error: libxl.c:1610:libxl__destroy_domid: non-existant domain 4
libxl: error: libxl.c:1568:domain_destroy_callback: unable to destroy guest with domid 4
libxl: error: libxl.c:1495:domain_destroy_cb: destruction of domain 4 failed

/var/log/xen/bootloader.4.log 파일:

Traceback (most recent call last):
  File "/usr/lib/xen-4.6/bin/pygrub", line 874, in <module>
    raise RuntimeError, "Unable to find partition containing kernel"
RuntimeError: Unable to find partition containing kernel

내 구성 파일:

name="pvvyos"
vcpus=1
memory=2048   

disk=['file:/home/my/vyos-1.1.7-i586-virt.iso,hdc:cdrom,w',
      'phy:/dev/mapper/xen--srv-vyos,hda1,w']
vif=['bridge=xenbr0']
extra="console=hvc0"
on_poweroff='destroy'
on_crash='restart'
on_reboot='restart'
bootloader="pygrub"

구성 파일에 추가하면 kernel = "/usr/lib/xen-4.6/boot/hvmloader" 오류가 다음으로 변경됩니다.

[Errno 2] No such file or directory
Error opening /usr/lib/xen-4.6/boot/hvmloader in guest

하지만 /usr/lib/xen-4.6/boot/hvmloader거기에는.

내가 뭘 잘못했나요?

답변1

나는 pygrub에 대한 지침을 사용했습니다.https://wiki.debian.org/PyGrub

# inside the vm:
mkdir /boot/grub
apt-get install -y linux-image-amd64
cat > /boot/grub/menu.lst << EOF

default         0
timeout         2

title           Debian GNU/Linux
root            (hd0,0)
kernel          /vmlinuz root=/dev/xvda2 ro
initrd          /initrd.img

title           Debian GNU/Linux (recovery mode)
root            (hd0,0)
kernel          /vmlinuz root=/dev/xvda2 ro single
initrd          /initrd.img

EOF

halt
# in dom0: check with 
#xl shutdown VMID

#check grub with
/usr/lib/xen-4.6/bin/pygrub /dev/vg0/vm02.freifunk-disk   

nano /etc/xen/vm02.freifunk.cfg             
# remove this line: 
#kernel      = '/boot/vmlinuz-4.3.0-1-amd64'
kernel      = '/boot/vmlinuz-3.16.0-4-amd64'
bootloader  = '/usr/lib/xen-4.6/bin/pygrub'
extra       = 'elevator=noop'
# remove this line: 
#ramdisk     = '/boot/initrd.img-4.3.0-1-amd64'
ramdisk     = '/boot/initrd.img-3.16.0-4-amd64'


xen create /etc/xen/vm02.freifunk.cfg         

관련 정보