VM's name/uuid/id is not listed/shown when doing "virsh list --all"
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
VM's name/uuid/id is not listed/shown when doing "virsh list --all"
Hi,
As I follow some tutorials of QEMU and KVM, I ended up creating 2 VM images though I forgot what commands I used for each one of them. I loaded those with the same barebone Debian distribution. They are booted fine -- one using the "qemu -hda debian.img" and the other using "virsh start Debian71". But when doing "virsh list --all" the prior does not show, whether the vm is up/on or down/shut-off, but the later shown in the list.
My questions:
1 - when you create a disk image using "dd" and then use the qemu to boot the image and cdrom to install the linux distribution, does it have name, uuid, or id associated with it so it can be read by virsh?
2 - if the answer is no for the above question, how do you add name,uuid,and/or id to the above vm so it can be managed by libvert (virsh and virt-??? command set).
3 - when listing VMs --- virsh list --all, what file(s)/directory(is) does virsh look so it knows all the VMs -- or does the VMs embed metadata information in the .img itself?
4 - there are many different ways to create VMs -- dd, qemu, qemu-kvm, kvm, virt-image, etc,etc ... which one is the one that will be used going forward and is there compatibility matrix so old way can be migrated to the new way.
Please forgive my lack of knowledge but really appreciate your guidance.
virsh is a libvirt command, it will only list VMs that have been created and are managed by libvirt.
those commands are virsh define, virt-install and so on. If you simply run a VM with the KVM command line, you're using KVM directly, bypassing libvirt, and so libvirt will not know of this VM and will not report it in virsh list or any other libvirt command
Quote:
1 - when you create a disk image using "dd" and then use the qemu to boot the image and cdrom to install the linux distribution, does it have name, uuid, or id associated with it so it can be read by virsh?
no.
Quote:
2 - if the answer is no for the above question, how do you add name,uuid,and/or id to the above vm so it can be managed by libvert (virsh and virt-??? command set).
create a VM in libvirt from scratch, if you want, you can define it to use an existing disk image
Quote:
3 - when listing VMs --- virsh list --all, what file(s)/directory(is) does virsh look so it knows all the VMs -- or does the VMs embed metadata information in the .img itself?
no, libvirt maintains its own status, vm metadata and other data.
Quote:
4 - there are many different ways to create VMs -- dd, qemu, qemu-kvm, kvm, virt-image, etc,etc ... which one is the one that will be used going forward and is there compatibility matrix so old way can be migrated to the new way.
qemu and kvm are the base layer, where qemu and kvm are used to run a VM directly. libvirt uses those commands under the hood as well, but it also incorporates a lot of additional features around VM management. I would recommend you stick to the libvirt command set, i.e. virsh, virt-* and the virt-manager GUI, and when ready to move to a higher level of VM management start looking at oVirt and RHEV. This doesn't mean you shouldn't even try to understand what the actual underlying commands are doing when they get a call from libvirt
As such, there is no "old" or "new" way, all ways are the same, but libvirt simply provides an additional management layer above qemu, kvm, qemu-img and a bunch of other direct commands, and makes life very very easy
I do like to experience Linux virtualization from the bottom up so I took the qemu/kvm route at the first place. As a Virtualization newbie, I am wondering if you(or anyone) know of site(s) that is/are dedicated to exploring VM management using just the basic command-line-interface that came with qemu/kvm? It would be quite educational to the beginner such as myself to see how to things work at the base level for the the higher level command-set that are stated above(libvert, oVirt, RHEV) using just the basic commands. To start, such examples like:
- listing all the (online/offline) VMs in a particular host or hosts
- (online/offline) VMs migration from one host to another.
- manipulating (online/offline) VM's RAM, Storage, etc.
Aside from the higher level vm management you mention above (libvirt, oVirt, and RHEV), are there any other popular vm management frameworks that are used by many for managing small/medium/large production environment?
- listing all the (online/offline) VMs in a particular host or hosts
only through something like ps -ef |grep qemu, if you run a VM directly through qemu-kvm, there will be no central system accounting for all the VMs
Quote:
- (online/offline) VMs migration from one host to another.
use the QEMU monitor command set for this, it's also per-VM, no central management on a host or cluster level, unless you move on to libvirt or higher
Quote:
- manipulating (online/offline) VM's RAM, Storage, etc.
RAM is also through qemu monitor and KSM, storage is partially qemu and partially qemu-img.
read the linux-kvm and the qemu official sites for details
Quote:
Aside from the higher level vm management you mention above (libvirt, oVirt, and RHEV), are there any other popular vm management frameworks that are used by many for managing small/medium/large production environment?
there are plenty, libvirt is host level management, clusters are not so trivial, and oVirt/RHEV use libvirt on hosts while managing clusters of servers running VMs.
Other systems to menation are proxmox, openstack (even higher instrumentation layer set for building clouds) and so on. linux-kvm.org has a nice management software list
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.