[libvirt-users] 'virsh list' issue

Dear all: Afer run the command 'qemu-kvm -hda /root/free.img -m 512 -usbdevice tablet -vga qxl -spice port=5930,disable-ticketing' , and the VM starts natrually. Then I run the command 'virsh list' , it shows as follows: [root@localhost ~]# virsh list Id Name State ---------------------------------- [root@localhost ~]# there is no VM running! I am puzzled , can someone help me? Yours Sinerely! suyi

On 03/08/2012 06:15 AM, wangsuyi640 wrote:
Dear all:
Afer run the command 'qemu-kvm -hda /root/free.img -m 512 -usbdevice tablet -vga qxl -spice port=5930,disable-ticketing' , and the VM starts
there is no VM running! I am puzzled , can someone help me?
Running a VM directly via qemu-kvm makes the VM invisible to libvirt, unless you first run 'virsh qemu-attach'. There are certain restrictions for this to work, such as having a socket-based monitor on the guest. 'virsh list' can only list VMs known to libvirt. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Thanks for your help. However, how can I make the VM visible to libvirt of that kind.? Even with third party tools? Yours Sinerely! suyi -----邮件原件----- 发件人: Eric Blake [mailto:eblake@redhat.com] 发送时间: 2012年3月8日 21:21 收件人: wangsuyi640 抄送: libvirt-users@redhat.com 主题: Re: [libvirt-users] 'virsh list' issue On 03/08/2012 06:15 AM, wangsuyi640 wrote:
Dear all:
Afer run the command 'qemu-kvm -hda /root/free.img -m 512 -usbdevice tablet -vga qxl -spice port=5930,disable-ticketing' , and the VM starts
there is no VM running! I am puzzled , can someone help me?
Running a VM directly via qemu-kvm makes the VM invisible to libvirt, unless you first run 'virsh qemu-attach'. There are certain restrictions for this to work, such as having a socket-based monitor on the guest. 'virsh list' can only list VMs known to libvirt. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hi, well, you are not using the libvirt api to create the vm :) You need to use something like "virt-install" and then start the vm via "virsh start". Afaik "virsh list" only shows machines which are using libvirt. Kind regards, Felix Blanke On 3/8/12 2:15 PM, wangsuyi640 wrote:
Dear all:
Afer run the command 'qemu-kvm -hda /root/free.img -m 512 -usbdevice tablet -vga qxl -spice port=5930,disable-ticketing' , and the VM starts natrually. Then I run the command 'virsh list' , it shows as follows:
[root@localhost ~]# virsh list
Id Name State
----------------------------------
[root@localhost ~]#
there is no VM running! I am puzzled , can someone help me?
Yours Sinerely!
suyi
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On 08.03.2012 14:22, Felix Blanke wrote:
Hi,
well, you are not using the libvirt api to create the vm :) You need to use something like "virt-install" and then start the vm via "virsh start".
Afaik "virsh list" only shows machines which are using libvirt.
Yes & no. This depends on driver being used. There are several drivers that doesn't need to connect to the libvirt daemon. Virsh is then used to communicate with hypervisor directly - e.g. xenapi does this. And it is hypervisor who keeps track of domains. That means, if one would somehow create a domain behind libvirt back, virsh list would show it anyway. NB this is not recommended. However, qemu is not such hypervisor therefore your answer is correct. I just wanted to clarify :) Michal
participants (4)
-
Eric Blake
-
Felix Blanke
-
Michal Privoznik
-
wangsuyi640