![xen-create-image 不会创建 inird 或 initramfs 映像,并且 domU 不会以系统映像启动](https://linux22.com/image/620258/xen-create-image%20%E4%B8%8D%E4%BC%9A%E5%88%9B%E5%BB%BA%20inird%20%E6%88%96%20initramfs%20%E6%98%A0%E5%83%8F%EF%BC%8C%E5%B9%B6%E4%B8%94%20domU%20%E4%B8%8D%E4%BC%9A%E4%BB%A5%E7%B3%BB%E7%BB%9F%E6%98%A0%E5%83%8F%E5%90%AF%E5%8A%A8.png)
我有 Fedora 19 作为 Dom0。要创建镜像,我运行
# xen-create-image --hostname=debian-wheezy --memory=512Mb --dhcp --size=20Gb --swap=512Mb --dir=/xen --arch=amd64 --dist=wheezy
生成完成后,我启动虚拟机并看到:
# xl create /etc/xen/debian-wheezy.cfg
Parsing config from /etc/xen/debian-wheezy.cfg
libxl: error: libxl_dom.c:409:libxl__build_pv: xc_dom_ramdisk_file failed: No such file or directory
libxl: error: libxl_create.c:919:domcreate_rebuild_done: cannot (re-)build domain: -3
在 /etc/xen/debian-wheezy.cfg 中我有
#
# Kernel + memory size
#
kernel = '/boot/vmlinuz-3.11.2-201.fc19.x86_64'
ramdisk = '/boot/initrd.img-3.11.2-201.fc19.x86_64'
和ls -1 /boot/*201*
表演
/boot/config-3.11.2-201.fc19.x86_64
/boot/initramfs-3.11.2-201.fc19.x86_64.img
/boot/System.map-3.11.2-201.fc19.x86_64
/boot/vmlinuz-3.11.2-201.fc19.x86_64
然后,如果我修复ramdisk
.cfg 文件中的指令,/boot/initramfs-3.11.2-201.fc19.x86_64.img
虚拟机将启动,但内部操作系统将无法启动。在 xl 控制台的末尾,我得到
[ OK ] Reached target Basic System.
dracut-initqueue[130]: Warning: Could not boot.
dracut-initqueue[130]: Warning: /dev/disk/by-uuid/085883ad-73ca-45cc-8bc5-e6249f869b26 does not exist
dracut-initqueue[130]: Warning: /dev/fedora/root does not exist
dracut-initqueue[130]: Warning: /dev/fedora/swap does not exist
dracut-initqueue[130]: Warning: /dev/mapper/fedora-root does not exist
dracut-initqueue[130]: Warning: /dev/mapper/fedora-swap does not exist
dracut-initqueue[130]: Warning: /dev/xvda2 does not exist
Starting Dracut Emergency Shell...
Warning: /dev/disk/by-uuid/085883ad-73ca-45cc-8bc5-e6249f869b26 does not exist
Warning: /dev/fedora/root does not exist
Warning: /dev/fedora/swap does not exist
Warning: /dev/mapper/fedora-root does not exist
Warning: /dev/mapper/fedora-swap does not exist
Warning: /dev/xvda2 does not exist
Generating "/run/initramfs/sosreport.txt"
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/sosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.
dracut:/#
.img 文件/xen/domains/debian-wheezy
存在并列在磁盘debian-wheezy.cfg 部分
所以我该怎么做?
更新:
我发现 xl 无法挂载图像。在 debian-wheezy.cfg 中,我有以下内容:
root = '/dev/xvda2 ro'
disk = [
'file:/xen/domains/debian-wheezy/disk.img,xvda2,w',
'file:/xen/domains/debian-wheeze/swap.img,xvda1,w',
]
并且 VM 中没有 /dev/xvda* 或 /dev/sda* 或 /dev/hda* 文件。
答案1
尝试使用它virt-manager
来创建/管理您的虚拟机。