LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 08-20-2013, 06:25 PM   #1
newbiez
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
Angry 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.
 
Old 08-21-2013, 12:13 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
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
 
1 members found this post helpful.
Old 08-21-2013, 12:45 PM   #3
newbiez
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
dyasny, thank you for your kind reply.

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?

Thanks a bunch.
 
Old 08-21-2013, 03:14 PM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by newbiez View Post
- 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
 
1 members found this post helpful.
Old 08-30-2013, 10:06 PM   #5
newbiez
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
dyasny, thank you! I will try what you suggested.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I issue a "power off" through using virsh? PeterSteele Linux - Virtualization and Cloud 4 09-16-2012 02:33 AM
[SOLVED] Scripting Help: Using "File1" as list of objects to search for in "File2" Asharru Programming 10 09-05-2010 06:53 PM
"Multicolumn" or "tiles", or even "list" icon view on desktop, in any DE? the dsc Linux - Desktop 3 02-20-2010 09:25 AM
"list dynamic dependency" of an executable using command other than "ldd" Amrita@3086 Solaris / OpenSolaris 3 04-04-2007 04:56 AM
Do not have "Wireless Connection" listed in "Devices" Jason267 Linux - Newbie 8 07-24-2002 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration