virt-install表示正在使用名称,但virsh列表-全部为空。virt-install在哪里找到这个名字?


13

virt-install表示正在使用名称,但virsh列表-全部表示均不存在。

jrwren@delays:{%22}~ $ virt-install -d -n android -r 512 --disk android.qcow2 -s 4 -c /d/cd\ images/android-x86-2.2-generic.iso --vnc --noautoconsole 
[Thu, 05 Jul 2012 16:57:19 virt-install 23170] DEBUG (cli:220) Launched with command line:
/usr/bin/virt-install -d -n android -r 512 --disk android.qcow2 -s 4 -c /d/cd images/android-x86-2.2-generic.iso --vnc --noautoconsole
[Thu, 05 Jul 2012 16:57:19 virt-install 23170] DEBUG (cli:326) Requesting libvirt URI default
[Thu, 05 Jul 2012 16:57:19 virt-install 23170] DEBUG (cli:328) Received libvirt URI qemu:///session
[Thu, 05 Jul 2012 16:57:20 virt-install 23170] DEBUG (virt-install:259) Requesting virt method 'default', hv type 'default'.
[Thu, 05 Jul 2012 16:57:20 virt-install 23170] DEBUG (virt-install:469) Received virt method 'hvm'
[Thu, 05 Jul 2012 16:57:20 virt-install 23170] DEBUG (virt-install:470) Hypervisor name is 'kvm'
[Thu, 05 Jul 2012 16:57:20 virt-install 23170] DEBUG (cli:950) --graphics compat generated: vnc
[Thu, 05 Jul 2012 16:57:20 virt-install 23170] ERROR (cli:597) Guest name 'android' is already in use.
(venv)jrwren@delays:{%22}~ $ sudo virsh -c qemu:///system list --all
 Id Name                 State
----------------------------------

virt-install在哪里找到这个名字?

编辑:我应该提到未设置LIBVIRT_DEFAULT_URI。

Answers:


13

您在每个命令中使用不同的URI。添加-c qemu:///system到您的virt-install命令,或将其更改为要使用的清单qemu:///session。要取消定义,请使用命令virsh -c qemu:///THECORRECTURI undefine android


谢谢。我对会话v。系统感到困惑。现在,我使用LIBVIRT_DEFAULT_URI = qemu:/// system滚动
Jay _silly_evarlast_ Wren

11

您必须取消定义虚拟机。如果它停止运行

[root@fed18 isos]# virt-install --hvm --name OracleLinux64-1 --ram 2048 --vcpus 1 -f /dev/virtual-machines/OracleLinux64-1 --network bridge=br0 --cdrom /isos/Oracle_Linux_Release_6_Update_4_x86_64.iso --graphics vnc,listen=0.0.0.0,port=5901 --noautoconsole 
warning: failed to set locale, defaulting to C
ERROR    Guest name 'OracleLinux64-1' is already in use.

root@fed18 ~]# virsh
setlocale: No such file or directory
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
   'quit' to quit
virsh #  undefine OracleLinux64-1
Domain OracleLinux64-1 has been undefined

virsh # quit

[root@fed18 ~]# virt-install --hvm --name OracleLinux64-1 --ram 2048 --vcpus 1 -f /dev/virtual-machines/OracleLinux64-1 --network bridge=br0 --cdrom /isos/Oracle_Linux_Release_6_Update_4_x86_64.iso --graphics vnc,listen=192.168.2.103,port=5901 --noautoconsole 
warning: failed to set locale, defaulting to C

Starting install...
Creating domain...                                                                                                                                          |    0 B  00:00:12     
Domain installation still in progress. You can reconnect to 
the console to complete the installation process.

这对我有用,所以谢谢!您知道是否可以列出所有已定义的名称吗?
Teekin '18年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.