virsh , Virtual Shell Supporting tagline
Virsh , short for Virtual Shell, is use for managing VMs (Virtual Machine).
http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaai%2Fxen%2Frhel%2Fliaaixenvirshshutdown.htm
usage :
virsh [command][args]
we can use two mode of virsh , Direct Model
and Interactive Model
.
Direct Model
like virsh create vm_name
, it should need parameters or variable.
virsh
with nothing, comes Interactive Model
, it looks like IRB
.
Commands :
help
: show help .
quit
: stop “Interactive Model”, comes back to shell.
connect
: connect to a VM, virsh connect winking_vm
.
create
: create a new VM
destroy
: delete a VM
start
: start defined VM
define
: defined a VM from XML
undefine
: remove defined VM
dumpxml
: move setting of VM
list
: list all the VMs
reboot
: reboot vm
save
: save status of vm
restore
: turn back to the status of VM
suspend
: Pause the work of VM
resume
: make VM work again
dump
: move kernel of VM
shutdown
: shutdown VM
setmem
: change Memory’s amount of VM
setmaxmen
: schange VM’s max memory
setvcups
: set the number of virtual cpus
check Domain info
domid
: check the number of VM
domname
: check the name of VM
domuuid
: check UUID
domstate
: check status
dominfo
: check inf
for example :
virsh domname 3
save the status of VM , Dump
virsh dumpxml Domain
Domain
is the one we want to dump.
for example :
root@linux ~# virsh dumpxml system1 ?①
root@linux ~# ls ②
anaconda-ks.cfg Desktop/ install.log install.log.syslog
root@linux ~# virsh dumpxml system1 > system1.virsh.xml ?③
root@linux ~# ls
anaconda-ks.cfg Desktop/ install.log
install.log.syslog system1.virsh.xml ?④
① setting of system1 ② there’s some files under this folder ③ change setting of system1 to system1.vrish.xml. ④ backup for setting of system1.
blog comments powered by Disqus