Quantcast
Channel: KVM – ID's blog
Viewing all articles
Browse latest Browse all 6

KVM manage virtual machines with virsh

$
0
0

Virsh is the main interface for managing virsh guest domains. The program can be used to create, pause, and shutdown domains.

Some of this commands may be helpful if you have no chance to run virt-manager.

Show guest information:

Show a list of all running guests: virsh list
Show a list of all available guests: virsh list –all
Show a guest’s info: virsh dominfo GUEST_NAME

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@hexa-core ~]# virsh list
 Id Name                 State
----------------------------------
  9 Webserver            running
 10 Squid                running
 11 Windows_XP           running
 13 Windows_Server_2003  running
 14 MySQL                running
 15 Windows_Server_2008_R2 running
 20 Munin                running
 23 Nagios               running
 27 Windows_7            running
 33 Corosync_01          running
 34 Corosync_02          running
 39 Fedora               running
 41 Fedora2              running
1
2
3
4
5
6
7
8
9
10
11
12
[root@hexa-core ~]# virsh dominfo MySQL
Id:             14
Name:           MySQL
UUID:           59c35554-e61a-c10f-dc2c-2a1e74f9371d
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       127875.7s
Max memory:     2097152 kB
Used memory:    2097152 kB
Persistent:     yes
Autostart:      disable

Start and stop guest:

Start a guest: virsh start GUEST_NAME
Shutdown a guest (gently): virsh shutdown GUEST_NAME
virsh shutdown GUEST_ID
Shutdown a guest (wild – you are a maniac): virsh destroy GUEST_NAME
Suspend a guest: virsh suspend GUEST_NAME
Resume a suspended guest: virsh resume GUEST_NAME


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images