virt-tools.org: Listing VMs using “virsh”

Read our guide to listing out virtual machines using the command line or from shell scripts.

2 Comments

Filed under Uncategorized

2 responses to “virt-tools.org: Listing VMs using “virsh”

  1. Mike McGrath

    Is there a way to get the name of a guest from within the guest? I know how to find its UUID, but finding the name would be wonderful.

    • rich

      Mike, no there is not at the moment.

      There is a bug (#241231 — Red Hat associates only) about this, which was fixed/implemented by the vhostmd project, to enable guests to get stats and other information from the host. In theory this would allow what you want, although the default configuration does not give this information.

      Another way to provide it would be through SM-BIOS (ie. dmidecode) and as you know we already provide the UUID through this mechanism. However there are serious concerns about this: The main problem is that in a real PC, SM-BIOS never changes, and consists of lots of fixed structures exported by the BIOS at boot time. But in a virtual guest, the guest can migrate, necessitating changes to these structures which (a) could happen at any time from the point of view of the guest (and are unsynchronized) and (b) could require these structures to be moved or resized.

      The upcoming Matahari KVM guest agent may also be able to provide this information to guests.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s