系统/yum源缺少edk2相关包 [root@localhost ~]# cat /etc/anolis-release Anolis OS release 8.4 [root@localhost ~]# uname -r 4.19.190-3.an8.loongarch64 [root@localhost ~]# yum search edk2 上次元数据过期检查:2:56:01 前,执行于 2021年12月29日 星期三 12时02分02秒。 未找到匹配项。 例如: <loader readonly='yes' secure='no' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader> <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/an8u2-gui_VARS.fd</nvram>
目前是要测试虚拟机BIOS吗?EDK2暂时没有,龙芯可以提供UEFI镜像 loongarch_bios.bin 和loongarch_vars.bin,供使用。
使用方式如下: libvirt版本6.0 virt-manager 2.2.1 <os> <type arch="loongarch64" machine="loongson7a_v1.0">hvm</type> <loader readonly="yes" type="pflash">/usr/share/qemu-kvm/loongarch_bios.bin</loader> <nvram>/var/lib/libvirt/qemu/nvram/debian10_VARS.fd</nvram> <boot dev="hd"/> </os> 其中/var/lib/libvirt/qemu/nvram/debian10_VARS.fd是由loongarch_vars.fd文件复制得到的, 后面虚拟机的读写操作对象为/var/lib/libvirt/qemu/nvram/debian10_VARS.fd 命令行方式启动: 以下说明的是qemu 4.2版本 通过bios方式启动 /usr/bin/qemu-system-loongarch64 \ -name guest=debiantesting,debug-threads=on \ -machine loongson7a_v1.0,accel=kvm,usb=off,dump-guest-core=off \ -cpu Loongson-3A5000 -bios /usr/share/qemu-kvm/loongarch_bios.bin -m 2048 \ -overcommit mem-lock=off -smp 2,sockets=2,cores=1,threads=1 \ 通过pflash方式启动示例一: /usr/bin/qemu-system-loongarch64 \ -name guest=mate,debug-threads=on \ -blockdev '{"driver":"file","filename":"/usr/share/qemu-kvm/loongarch_bios.bin","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/mate_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \ -machine loongson7a_v1.0,accel=kvm,usb=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \ -cpu Loongson-3A5000 \ -m 4096 通过pflash方式启动示例二: /usr/bin/qemu-system-loongarch64 \ -name guest=debiantesting,debug-threads=on \ -machine loongson7a_v1.0,accel=kvm,usb=off,dump-guest-core=off \ -cpu Loongson-3A5000 -m 1024 \ -drive if=pflash,format=raw,unit=0,file=/usr/share/qemu-kvm/loongarch_bios.bin \ -drive if=pflash,format=raw,unit=1,file=/usr/share/qemu-kvm/loongarch_vars.bin //这里最好使用loongarch_vars.bin复制得到的文件 如果对应文件是创建虚拟机的xml模板(opstack中创建虚拟机需要该模板)时,可以按照如下格式使用,libvirt会自动复制loongarch_vars.bin到一个新的临时文件用来保存变量,而不改变原始文件本身。 以下使用的libvit版本为libvirt 6.0 <os> <type arch="loongarch64" machine="loongson7a_v1.0">hvm</type> <loader readonly="yes" type="pflash">/usr/share/qemu-kvm/loongarch_bios.bin</loader> <boot dev="hd"/> </os>
是machine type不支持 IDE或者virtio吗。 还是需要龙芯独有的虚拟化包? virt-install 安装 [root@localhost ~]# virt-install --name=gzxtest04 --ram 4096 --vcpus=8 --autostart --hvm --disk path=/root/loong.qcow2,size=20,format=qcow2 --cdrom /root/anolis-8-loongarch64-dvd1-20211230.0.iso --graphics vnc,listen=0.0.0.0,port=5907 --network bridge=virbr0,,model=e1000 --force --connect qemu:///system 开始安装...... ERROR 不支持的配置:IDE controllers are unsupported for this QEMU binary or machine type 域安装失败,您可以运行下列命令重启您的域: 'virsh start virsh --connect qemu:///system start gzxtest04' 否则请重新开始安装。 libvirt安装 [root@localhost ~]# virsh create loong.xml 错误:从 loong.xml 创建域失败 错误:不支持的配置:disk type 'virtio' of 'vdc' does not support ejectable media
另外我从桌面上,virt-manager虚拟机管理器上创建,也不能选择使用ISO来启动一个虚拟机
(In reply to wanqian from comment #3) > 是machine type不支持 IDE或者virtio吗。 > 还是需要龙芯独有的虚拟化包? > > > virt-install 安装 > [root@localhost ~]# virt-install --name=gzxtest04 --ram 4096 --vcpus=8 > --autostart --hvm --disk path=/root/loong.qcow2,size=20,format=qcow2 --cdrom > /root/anolis-8-loongarch64-dvd1-20211230.0.iso --graphics > vnc,listen=0.0.0.0,port=5907 --network bridge=virbr0,,model=e1000 --force > --connect qemu:///system > > 开始安装...... > ERROR 不支持的配置:IDE controllers are unsupported for this QEMU binary or > machine type > 域安装失败,您可以运行下列命令重启您的域: > 'virsh start virsh --connect qemu:///system start gzxtest04' > 否则请重新开始安装。 > > > libvirt安装 > [root@localhost ~]# virsh create loong.xml > 错误:从 loong.xml 创建域失败 > 错误:不支持的配置:disk type 'virtio' of 'vdc' does not support ejectable media 请查看以下软件rpm包版本是否一致 libvirt : 6.0.0-29.module_lns8+755+88436ea4 virt-manager : 2.2.1-4.2.lns8 virt-install: 2.2.1-4.2.lns8
anolis 8.4 loongarch64 yum源地址无效
(In reply to zhaotianrui from comment #6) > 我们自己搭建一个anolis 8.4 loongarch64环境,复现虚拟化问题,发现yum源地址无效下载不到虚拟化包。 [root@localhost ~]# yum makecache AnolisOS-8.4 - AppStream 0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'AppStream': - Curl error (6): Couldn't resolve host name for http://mirrors.openanolis.cn/anolis/8.4/AppStream/loongarch64/os/repodata/repomd.xml [Could not resolve host: mirrors.openanolis.cn] 错误:为 repo 'AppStream' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried [root@localhost ~]#
以下源地址,发现virt-manager软件包未添加loongarch补丁。 http://8.131.87.1/kojifiles/output/an-8-loongarch64-RC2/compose/AppStream/ 请确认该源地址是否正确。 还需确定virt-install出错环境的libvirt版本,是否为6.0.0-29.module_lns8+755+88436ea4 。
(In reply to zhaotianrui from comment #5) > (In reply to wanqian from comment #3) > > 是machine type不支持 IDE或者virtio吗。 > > 还是需要龙芯独有的虚拟化包? > > > > > > virt-install 安装 > > [root@localhost ~]# virt-install --name=gzxtest04 --ram 4096 --vcpus=8 > > --autostart --hvm --disk path=/root/loong.qcow2,size=20,format=qcow2 --cdrom > > /root/anolis-8-loongarch64-dvd1-20211230.0.iso --graphics > > vnc,listen=0.0.0.0,port=5907 --network bridge=virbr0,,model=e1000 --force > > --connect qemu:///system > > > > 开始安装...... > > ERROR 不支持的配置:IDE controllers are unsupported for this QEMU binary or > > machine type > > 域安装失败,您可以运行下列命令重启您的域: > > 'virsh start virsh --connect qemu:///system start gzxtest04' > > 否则请重新开始安装。 > > > > > > libvirt安装 > > [root@localhost ~]# virsh create loong.xml > > 错误:从 loong.xml 创建域失败 > > 错误:不支持的配置:disk type 'virtio' of 'vdc' does not support ejectable media > > 请查看以下软件rpm包版本是否一致 > libvirt : 6.0.0-29.module_lns8+755+88436ea4 > virt-manager : 2.2.1-4.2.lns8 > virt-install: 2.2.1-4.2.lns8 [root@localhost ~]# rpm -qa | grep -E '^libvirt|virt-install|virt-manager' libvirt-glib-3.0.0-1.an8.loongarch64 libvirt-daemon-driver-network-6.0.0-29.module_lns8+755+88436ea4.loongarch64 virt-manager-2.2.1-4.an8.noarch virt-manager-common-2.2.1-4.an8.noarch libvirt-bash-completion-6.0.0-29.module_lns8+755+88436ea4.loongarch64 libvirt-client-6.0.0-29.module_lns8+755+88436ea4.loongarch64 libvirt-daemon-6.0.0-29.module_lns8+755+88436ea4.loongarch64 virt-install-2.2.1-4.an8.noarch libvirt-daemon-config-network-6.0.0-29.module_lns8+755+88436ea4.loongarch64 libvirt-libs-6.0.0-29.module_lns8+755+88436ea4.loongarch64
新virt-manager已经更新到RC2
收到,有结果回复
[root@localhost ~]# virsh create loong.xml 错误:从 loong.xml 创建域失败 错误:不支持的配置:IDE controllers are unsupported for this QEMU binary or machine type [root@localhost ~]# vi loong.xml [root@localhost ~]# virsh create loong.xml 错误:从 loong.xml 创建域失败 错误:不支持的配置:disk type 'virtio' of 'vdc' does not support ejectable media 对于用libvirt xml的方式启动,这需要解决一下