1. 程式人生 > >virsh help domain命令內容解析

virsh help domain命令內容解析

簡介

這段時間學習熱遷移,要不斷的在qemu monitor和libvirt中調轉使用命令,故整理virsh命令,這篇是第一篇,整理virsh help domain相關內容

<span style="color:#656565"><span style="color:#333333"><code><span style="color:#ffffff">virsh </span><span style="color:#87ceeb"># help domain</span>
<span style="color:#98fb98">Domain</span> <span style="color:#98fb98">Management</span> <span style="color:#ffffff">(</span><span style="color:#ffffff">help keyword </span><span style="color:#ffa0a0">'domain'</span><span style="color:#ffffff">):</span><span style="color:#ffffff">
attach</span><span style="color:#ffffff">-</span><span style="color:#ffffff">device                  attach device </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> an XML file</span><span style="color:#ffffff">(通過</span><span style="color:#ffffff">XML</span><span style="color:#ffffff">配置給虛擬機器新增裝置)</span><span style="color:#ffffff">
attach</span><span style="color:#ffffff">-</span><span style="color:#ffffff">disk                    attach disk device</span><span style="color:#ffffff">(新增磁碟裝置)</span><span style="color:#ffffff">
attach</span><span style="color:#ffffff">-</span><span style="color:#f0e68c"><strong>interface</strong></span><span style="color:#ffffff">               attach network </span><span style="color:#f0e68c"><strong>interface</strong></span><span style="color:#ffffff">(新增網路裝置)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">autostart</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
autostart a domain</span><span style="color:#ffffff">(給虛擬機器新增自動啟動配置,當</span><span style="color:#ffffff">libvirtd</span><span style="color:#ffffff">服務被拉起的時候,自動啟動)</span><span style="color:#ffffff">
blkdeviotune                   </span><span style="color:#98fb98">Set</span> <span style="color:#f0e68c"><strong>or</strong></span><span style="color:#ffffff"> query a block device I</span><span style="color:#ffffff">/</span><span style="color:#ffffff">O tuning parameters</span><span style="color:#ffffff">.(設定或查詢磁碟</span><span style="color:#ffffff">I</span><span style="color:#ffffff">/</span><span style="color:#ffffff"> O</span><span style="color:#ffffff">引數)</span><span style="color:#ffffff">
blkiotune                      </span><span style="color:#98fb98">Get</span> <span style="color:#f0e68c"><strong>or</strong></span> <span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> blkio parameters</span><span style="color:#ffffff">(獲取或設定</span><span style="color:#ffffff">blkio</span><span style="color:#ffffff">引數)</span><span style="color:#ffffff">
blockcommit                    </span><span style="color:#98fb98">Start</span><span style="color:#ffffff"> a block commit operation</span><span style="color:#ffffff">.(將磁碟檔案的變化儲存到備份檔案中)</span><span style="color:#ffffff">
blockcopy                      </span><span style="color:#98fb98">Start</span><span style="color:#ffffff"> a block copy operation</span><span style="color:#ffffff">.(拷貝磁碟備份映象到目的地)</span><span style="color:#ffffff">
blockjob                       </span><span style="color:#98fb98">Manage</span><span style="color:#ffffff"> active block operations</span><span style="color:#ffffff">(管理</span><span style="color:#ffffff">active</span><span style="color:#ffffff">狀態的磁碟任務)</span><span style="color:#ffffff">
blockpull                      </span><span style="color:#98fb98">Populate</span><span style="color:#ffffff"> a disk </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> its backing image</span><span style="color:#ffffff">.(從</span><span style="color:#ffffff">backing file</span><span style="color:#ffffff">中拷貝資料到磁碟)</span><span style="color:#ffffff">
blockresize                    </span><span style="color:#98fb98">Resize</span><span style="color:#ffffff"> block device of domain</span><span style="color:#ffffff">.(給虛擬機器的塊裝置擴容)</span><span style="color:#ffffff">
change</span><span style="color:#ffffff">-</span><span style="color:#ffffff">media                   </span><span style="color:#98fb98">Change</span><span style="color:#ffffff"> media of CD </span><span style="color:#f0e68c"><strong>or</strong></span><span style="color:#ffffff"> floppy drive</span><span style="color:#ffffff">(更新</span><span style="color:#ffffff">cdrom</span><span style="color:#ffffff">或</span><span style="color:#ffffff">floppy</span><span style="color:#ffffff">裝置)</span><span style="color:#ffffff">
console                        connect to the guest console</span><span style="color:#ffffff">(通過控制連線虛擬機器)</span><span style="color:#ffffff">
cpu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">baseline                   compute baseline CPU</span><span style="color:#ffffff">(計算基準</span><span style="color:#ffffff">CPU</span><span style="color:#ffffff">)</span><span style="color:#ffffff">
cpu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">compare                    compare host CPU </span><span style="color:#f0e68c"><strong>with</strong></span><span style="color:#ffffff"> a CPU described </span><span style="color:#f0e68c"><strong>by</strong></span><span style="color:#ffffff"> an XML file</span><span style="color:#ffffff">(將</span><span style="color:#ffffff">XML</span><span style="color:#ffffff">中配置的</span><span style="color:#ffffff">CPU</span><span style="color:#ffffff">與</span><span style="color:#98fb98">HostCPU</span><span style="color:#ffffff">進行對比)</span><span style="color:#ffffff">
cpu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">stats                      show domain cpu statistics</span><span style="color:#ffffff">(顯示</span><span style="color:#ffffff">CPU</span><span style="color:#ffffff">統計資訊)</span><span style="color:#ffffff">
create                         create a domain </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> an XML file</span><span style="color:#ffffff">(根據</span><span style="color:#ffffff">XML</span><span style="color:#ffffff">配置建立並啟動一個非持久化虛擬機器)</span><span style="color:#ffffff">
define                         define </span><span style="color:#ffffff">(</span><span style="color:#ffffff">but don</span><span style="color:#ffa0a0">'t start) a domain from an XML file(根據XML配置建立一個虛擬機器)
desc                           show or set domain'</span><span style="color:#ffffff">s description </span><span style="color:#f0e68c"><strong>or</strong></span><span style="color:#ffffff"> title</span><span style="color:#ffffff">(顯示或設定虛擬機器的描述或者標題)</span><span style="color:#ffffff">
destroy                        destroy </span><span style="color:#ffffff">(</span><span style="color:#ffffff">stop</span><span style="color:#ffffff">)</span><span style="color:#ffffff"> a domain</span><span style="color:#ffffff">(強制刪除一個虛擬機器)</span><span style="color:#ffffff">
detach</span><span style="color:#ffffff">-</span><span style="color:#ffffff">device                  detach device </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> an XML file</span><span style="color:#ffffff">(根據</span><span style="color:#ffffff">XML</span><span style="color:#ffffff">定義刪除虛擬機器的裝置)</span><span style="color:#ffffff">
detach</span><span style="color:#ffffff">-</span><span style="color:#ffffff">disk                    detach disk device</span><span style="color:#ffffff">(刪除磁碟裝置)</span><span style="color:#ffffff">
detach</span><span style="color:#ffffff">-</span><span style="color:#f0e68c"><strong>interface</strong></span><span style="color:#ffffff">               detach network </span><span style="color:#f0e68c"><strong>interface</strong></span><span style="color:#ffffff">(刪除網路裝置)</span><span style="color:#ffffff">
domdisplay                     domain display connection URI</span><span style="color:#ffffff">(顯示虛擬機器的連線</span><span style="color:#ffffff">URI</span><span style="color:#ffffff">)</span><span style="color:#ffffff">
domfsfreeze                    </span><span style="color:#98fb98">Freeze</span><span style="color:#ffffff"> domain</span><span style="color:#ffa0a0">'s mounted filesystems.(凍結虛擬機器的掛載檔案系統)
domfsthaw                      Thaw domain'</span><span style="color:#ffffff">s mounted filesystems</span><span style="color:#ffffff">.(解凍虛擬機器的掛載檔案系統)</span><span style="color:#ffffff">
domfsinfo                      </span><span style="color:#98fb98">Get</span><span style="color:#ffffff"> information of domain</span><span style="color:#ffa0a0">'s mounted filesystems.
domfstrim                      Invoke fstrim on domain'</span><span style="color:#ffffff">s mounted filesystems</span><span style="color:#ffffff">.(在虛擬機器掛載的檔案系統上執行</span><span style="color:#ffffff">fstrim</span><span style="color:#ffffff">命令)</span><span style="color:#ffffff">
domhostname                    </span><span style="color:#f0e68c"><strong>print</strong></span><span style="color:#ffffff"> the domain</span><span style="color:#ffa0a0">'s hostname(列印虛擬機器的hostname)
domid                          convert a domain name or UUID to domain id(把虛擬機器的名字或UUID轉化為虛擬機器ID)
domif-setlink                  set link state of a virtual interface(虛擬機器裝置介面鏈路狀態設定)
domiftune                      get/set parameters of a virtual interface(獲取或者設定虛擬機器裝置介面得引數)
domjobabort                    abort active domain job(終止虛擬機器的一個處於active的任務)
**domjobinfo**  
domain job information(獲取虛擬機器的任務資訊,比如正在virsh save可以查詢操作情況)
domname                        convert a domain id or UUID to domain name(通過虛擬機器的ID或者UUID獲取虛擬機器的名字)
**dompmsuspend**  
suspend a domain gracefully using power management functions(使用電源管理功能將虛擬機器掛起,需要qga支援)
**dompmwakeup**  
wakeup a domain from pmsuspended state(喚醒使用dompmsuspend掛起的虛擬機器)
domuuid                        convert a domain name or id to domain UUID(通過虛擬機器的name或ID獲取虛擬機器的UUID)
domxml-from-native             Convert native config to domain XML(將已存在的一組QEMU引數轉成可以被libvirt使用Domain XML檔案)
domxml-to-native               Convert domain XML to native config(將已存在的libvirt使用的Domain XML檔案轉化為QEMU引數)
dump                           dump the core of a domain to a file for analysis(dump出虛擬機器的core檔案,用於分析崩潰原因)
dumpxml                        domain information in XML(獲取虛擬機器的XML配置資訊)
edit                           edit XML configuration for a domain(編輯虛擬機器的XML配置檔案)
event                          Domain Events(獲取虛擬機器事件)
**inject-nmi**  
Inject NMI to the guest(注入NMI中斷到虛擬機器內部,當硬體發生不可恢復的錯誤時使用)
iothreadinfo                   view domain IOThreads
iothreadpin                    control domain IOThread affinity
iothreadadd                    add an IOThread to the guest domain
iothreaddel                    delete an IOThread from the guest domain
send-key                       Send keycodes to the guest(往虛擬機發送鍵盤按鍵指令)
**send-process-signal**  
Send signals to processes(給程序傳送訊號,qemu不支援)
lxc-enter-namespace            LXC Guest Enter Namespace(進入LXC虛擬機器的名稱空間)

**managedsave**  
managed save of a domain state(管理儲存虛擬機器的記憶體狀態到/var/lib/libvirt/qemu/save/*.save,將虛擬機器儲存並銷燬,後續restore的時候恢復到save之前的狀態)
**managedsave-remove**  
Remove managed save of a domain(刪除虛擬機器狀態管理設定/var/lib/libvirt/qemu/save/*.save檔案)

memtune                        Get or set memory parameters(獲取或者設定記憶體引數)
metadata                       show or set domain'</span><span style="color:#ffffff">s custom XML metadata
migrate                        migrate domain to another host</span><span style="color:#ffffff">(將虛擬機器遷移到另一個節點)</span><span style="color:#ffffff">
migrate</span><span style="color:#ffffff">-</span><span style="color:#ffffff">setmaxdowntime         </span><span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> maximum tolerable downtime</span><span style="color:#ffffff">(設定停機遷移時間)</span><span style="color:#ffffff">
migrate</span><span style="color:#ffffff">-</span><span style="color:#ffffff">compcache              </span><span style="color:#f0e68c"><strong>get</strong></span><span style="color:#ffffff">/</span><span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> compression cache size</span><span style="color:#ffffff">(獲取或者設定記憶體壓縮的</span><span style="color:#ffffff">cache</span><span style="color:#ffffff">大小)</span><span style="color:#ffffff">
migrate</span><span style="color:#ffffff">-</span><span style="color:#ffffff">setspeed               </span><span style="color:#98fb98">Set</span><span style="color:#ffffff"> the maximum migration bandwidth</span><span style="color:#ffffff">(設定遷移的最大頻寬)</span><span style="color:#ffffff">
migrate</span><span style="color:#ffffff">-</span><span style="color:#ffffff">getspeed               </span><span style="color:#98fb98">Get</span><span style="color:#ffffff"> the maximum migration bandwidth</span><span style="color:#ffffff">(獲取遷移的最大頻寬)</span><span style="color:#ffffff">
numatune                       </span><span style="color:#98fb98">Get</span> <span style="color:#f0e68c"><strong>or</strong></span> <span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> numa parameters</span><span style="color:#ffffff">(獲取或者設定</span><span style="color:#ffffff">numa</span><span style="color:#ffffff">引數)</span><span style="color:#ffffff">
qemu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">attach                    QEMU </span><span style="color:#98fb98">Attach</span><span style="color:#ffffff">(</span><span style="color:#ffffff">QEMU </span><span style="color:#98fb98">Attach</span><span style="color:#ffffff">)</span><span style="color:#ffffff">
qemu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">monitor</span><span style="color:#ffffff">-</span><span style="color:#ffffff">command           QEMU </span><span style="color:#98fb98">Monitor</span> <span style="color:#98fb98">Command</span><span style="color:#ffffff">(給</span><span style="color:#ffffff">qemu monitor</span><span style="color:#ffffff">傳送命令)</span><span style="color:#ffffff">
qemu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">monitor</span><span style="color:#ffffff">-</span><span style="color:#f0e68c"><strong>event</strong></span><span style="color:#ffffff">             QEMU </span><span style="color:#98fb98">Monitor</span> <span style="color:#98fb98">Events</span><span style="color:#ffffff">(監聽</span><span style="color:#ffffff">qemu monitor</span><span style="color:#ffffff">事件)</span><span style="color:#ffffff">
qemu</span><span style="color:#ffffff">-</span><span style="color:#ffffff">agent</span><span style="color:#ffffff">-</span><span style="color:#ffffff">command             QEMU </span><span style="color:#98fb98">Guest</span> <span style="color:#98fb98">Agent</span> <span style="color:#98fb98">Command</span><span style="color:#ffffff">(給</span><span style="color:#ffffff">qemu agent</span><span style="color:#ffffff">傳送命令)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">reboot</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
reboot a domain</span><span style="color:#ffffff">(優雅重啟虛擬機器,</span><span style="color:#ffffff">acpi</span><span style="color:#ffffff">|</span><span style="color:#ffffff">agent</span><span style="color:#ffffff">(啟用的</span><span style="color:#ffffff">qga</span><span style="color:#ffffff">情況下呼叫</span><span style="color:#ffffff">qga</span><span style="color:#ffffff">進行關機)|</span><span style="color:#ffffff">initctl</span><span style="color:#ffffff">(</span><span style="color:#ffffff">upstart</span><span style="color:#ffffff">命令)|</span><span style="color:#ffffff">signal</span><span style="color:#ffffff">|</span><span style="color:#ffffff">paravirt</span><span style="color:#ffffff">(</span><span style="color:#ffffff">xen</span><span style="color:#ffffff">)),對應</span><span style="color:#ffffff">qemu</span><span style="color:#ffffff">只支援</span><span style="color:#ffffff">agent</span><span style="color:#ffffff">和</span><span style="color:#ffffff">acpi
reset                          reset a domain</span><span style="color:#ffffff">(強制重啟虛擬機器)</span>

<span style="color:#ffffff">**</span><span style="color:#ffffff">restore</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
restore a domain </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> a saved state </span><span style="color:#f0e68c"><strong>in</strong></span><span style="color:#ffffff"> a file</span><span style="color:#ffffff">(通過儲存的記憶體檔案恢復虛擬機器)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">resume</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
resume a domain</span><span style="color:#ffffff">(喚醒處於</span><span style="color:#ffffff">pause</span><span style="color:#ffffff">狀態的虛擬機器,也就是</span><span style="color:#ffffff">suspend</span><span style="color:#ffffff">的虛機)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">save</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
save a domain state to a file</span><span style="color:#ffffff">(將虛擬機器記憶體狀態儲存到一個檔案)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">save</span><span style="color:#ffffff">-</span><span style="color:#ffffff">image</span><span style="color:#ffffff">-</span><span style="color:#ffffff">define</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
redefine the XML </span><span style="color:#f0e68c"><strong>for</strong></span><span style="color:#ffffff"> a domain</span><span style="color:#ffa0a0">'s saved state file(重新整理虛擬機器配置到save虛擬機器的檔案中)
**save-image-dumpxml**  
**saved state domain**  
information in XML(dump出save虛擬機器檔案中的虛擬機器配置資訊)
**save-image-edit**  
edit XML for a domain'</span><span style="color:#ffffff">s saved state file</span><span style="color:#ffffff">(出</span><span style="color:#ffffff">save</span><span style="color:#ffffff">虛擬機器檔案中的虛擬機器配置資訊)</span><span style="color:#ffffff">

schedinfo                      show</span><span style="color:#ffffff">/</span><span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> scheduler parameters</span><span style="color:#ffffff">(顯示或設定</span><span style="color:#ffffff">scheduler</span><span style="color:#ffffff">引數)</span><span style="color:#ffffff">
screenshot                     take a screenshot of a current domain console </span><span style="color:#f0e68c"><strong>and</strong></span><span style="color:#ffffff"> store it </span><span style="color:#f0e68c"><strong>into</strong></span><span style="color:#ffffff"> a file</span><span style="color:#ffffff">(擷取當前虛擬機器的螢幕,並將其儲存到一個檔案中)</span>
<span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff">-</span><span style="color:#ffffff">user</span><span style="color:#ffffff">-</span><span style="color:#ffffff">password              </span><span style="color:#f0e68c"><strong>set</strong></span><span style="color:#ffffff"> the user password inside the domain
setmaxmem                      change maximum memory limit</span><span style="color:#ffffff">(改變最大記憶體限制,停機狀態下才可以)</span><span style="color:#ffffff">
setmem                         change memory allocation</span><span style="color:#ffffff">(使用</span><span style="color:#ffffff">virtio</span><span style="color:#ffffff">-</span><span style="color:#ffffff">balloon</span><span style="color:#ffffff">動態增大或者減小記憶體大小)</span><span style="color:#ffffff">
setvcpus                       change number of </span><span style="color:#f0e68c"><strong>virtual</strong></span> <span style="color:#98fb98">CPUs</span><span style="color:#ffffff">(設定</span><span style="color:#ffffff">vcpu</span><span style="color:#ffffff">個數)</span><span style="color:#ffffff">
shutdown                       gracefully shutdown a domain</span><span style="color:#ffffff">(優雅關閉虛擬機器,</span><span style="color:#ffffff">acpi</span><span style="color:#ffffff">|</span><span style="color:#ffffff">agent</span><span style="color:#ffffff">(啟用的</span><span style="color:#ffffff">qga</span><span style="color:#ffffff">情況下呼叫</span><span style="color:#ffffff">qga</span><span style="color:#ffffff">進行關機)|</span><span style="color:#ffffff">initctl</span><span style="color:#ffffff">(</span><span style="color:#ffffff">upstart</span><span style="color:#ffffff">命令)|</span><span style="color:#ffffff">signal</span><span style="color:#ffffff">|</span><span style="color:#ffffff">paravirt</span><span style="color:#ffffff">(</span><span style="color:#ffffff">xen</span><span style="color:#ffffff">)),對應</span><span style="color:#ffffff">qemu</span><span style="color:#ffffff">只支援</span><span style="color:#ffffff">agent</span><span style="color:#ffffff">和</span><span style="color:#ffffff">acpi
start                          start a </span><span style="color:#ffffff">(</span><span style="color:#ffffff">previously </span><span style="color:#f0e68c"><strong>defined</strong></span><span style="color:#ffffff">)</span><span style="color:#ffffff"> inactive domain</span><span style="color:#ffffff">(啟動一個處於關閉狀態的虛擬機器)</span>
<span style="color:#ffffff">**</span><span style="color:#ffffff">suspend</span><span style="color:#ffffff">**</span><span style="color:#ffffff">  
suspend a domain</span><span style="color:#ffffff">(暫停一個虛擬機器)</span><span style="color:#ffffff">
ttyconsole                     tty console</span><span style="color:#ffffff">(</span><span style="color:#ffffff">tty console</span><span style="color:#ffffff">顯示)</span><span style="color:#ffffff">
undefine                       undefine a domain</span><span style="color:#ffffff">(刪除虛擬機器的定義)</span><span style="color:#ffffff">
update</span><span style="color:#ffffff">-</span><span style="color:#ffffff">device                  update device </span><span style="color:#f0e68c"><strong>from</strong></span><span style="color:#ffffff"> an XML file</span><span style="color:#ffffff">(根據</span><span style="color:#ffffff">XML</span><span style="color:#ffffff">配置更新虛擬機器的裝置)</span><span style="color:#ffffff">
vcpucount                      domain vcpu counts</span><span style="color:#ffffff">(獲取虛擬機器</span><span style="color:#ffffff">vcpu</span><span style="color:#ffffff">個數)</span><span style="color:#ffffff">
vcpuinfo                       detailed domain vcpu information</span><span style="color:#ffffff">(顯示虛擬機器</span><span style="color:#ffffff">vcpu</span><span style="color:#ffffff">的詳細資訊)</span><span style="color:#ffffff">
vcpupin                        control </span><span style="color:#f0e68c"><strong>or</strong></span><span style="color:#ffffff"> query domain vcpu affinity</span><span style="color:#ffffff">(控制或者查詢虛擬機器的</span><span style="color:#ffffff">vcpu</span><span style="color:#ffffff">親和性)</span><span style="color:#ffffff">
emulatorpin                    control </span><span style="color:#f0e68c"><strong>or</strong></span><span style="color:#ffffff"> query domain emulator affinity</span><span style="color:#ffffff">(控制或者查詢模擬器的親和性)</span><span style="color:#ffffff">
vncdisplay                     vnc display</span><span style="color:#ffffff">(獲取</span><span style="color:#ffffff">vnc</span><span style="color:#ffffff">埠號)</span></code></span></span>

1虛擬機器操作相關

create:create從XML檔案建立域
定義:從XML檔案定義(但不要啟動)域
啟動:啟動(先前定義的)非活動域
destroy:銷燬(停止)域
關閉:正常關閉域
undefine:取消定義域名

reboot:重新啟動域
重置:重置域(重置目標域,就像通過電源按鈕一樣)

暫停:暫停域
恢復:恢復域

save:將域狀態儲存到檔案
還原:從檔案
螢幕截圖中的已儲存狀態還原域:獲取當前域控制檯的螢幕截圖並將其儲存到檔案中

自動啟動:自動啟動域(配置域在啟動時自動啟動)

managedsave:託管儲存域狀態(儲存並銷燬正在執行的域,以便以後可以從同一狀態重新啟動。當域的下次執行virsh'start'命令時,它將自動從這個儲存狀態。) managedsave-remove

:刪除域的託管儲存

desc:顯示或設定域的描述或標題
domhostname:列印域的主機名

domname:將域ID或UUID轉換為域名(輸出域名)
元資料:顯示或設定域的自定義XML元資料

domuuid:將域名或ID轉換為域UUID 
domid:將域名或UUID轉換為域id numatune:獲取或設定numa引數

emulatorpin:控制或查詢域模擬器關聯(Pin域模擬器執行緒到主機物理CPU)

2.XML相關

domxml-from-native:將本機配置轉換為域XML 
domxml-native:將域XML轉換為本機配置

dumpxml

:XML 
編輯中的域資訊:編輯域的XML配置

3.CPU相關

vcpucount:域VCPU計數
vcpuinfo:詳細域VCPU資訊
vcpupin:控制或查詢域VCPU親和力
setvcpus:虛擬CPU的數量改變
CPU的基線:計算基線CPU 
CPU-比較:由XML檔案中描述的一個CPU比較主機CPU CPU- stats:顯示域cpu統計資訊

4.mem相關

setmaxmem:更改最大記憶體限制
setmem:更改記憶體分配
memtune:獲取或設定記憶體引數

5.blk

blkdeviotune:設定或查詢塊裝置I / O調整引數。

blkiotune:獲取或設定blkio引數

blockcommit:啟動一個塊提交操作。(提交從快照到其支援影象的更改合併快照檔案)

blockcopy:啟動一個塊複製操作。
blockjob:管理活動塊操作
blockpull:從其後備映像填充磁碟。(將支援檔案資料合併至overlay中)blockresize:調整域的塊裝置。

6.attch /分離

attach-device:從XML檔案
附加裝置attach-device:attach disk device 
attach-interface:attach network interface

detach-device:從XML檔案中分離裝置
detach-disk:detach disk device 
detach-interface:detach network interface

update-device:從XML檔案更新裝置

7.遷移相關

遷移:遷移域到另一臺主機
遷移-setmaxdowntime:設定最大可容忍的停機時間
遷移,compcache:獲取/設定壓縮快取大小
遷移,setspeed:設定最大遷移頻寬
遷移-getspeed:獲取最大遷移頻寬

8.代理人

QEMU訪客代理是一個執行在虛擬機器內部的普通應用程式,其目的是實現一種宿主機和虛擬機器進行互動的方式這種方式不依賴於網路,而是依賴於為Virtio序列。
QEMU提供了串列埠裝置的模擬及資料交換的通道,最終呈現出來的是一個串列埠裝置(虛擬機器內部)和一個Unix套接字檔案(宿主機上)。
通過QEMU來賓代理,宿主機可以控制虛擬機器實現凍結/恢復/整理檔案系統(凍結檔案系統),列出IP地址等功能。

set-user-password:在域
domfsfreeze中設定使用者密碼:凍結域的掛載檔案系統。
domfsthaw:解凍域的掛載檔案系統。
domfsinfo:獲取域掛載檔案系統的資訊。
domfstrim:在域的掛載檔案系統上呼叫fstrim。

dompmsuspend:使用電源管理功能正常暫停域
dompmwakeup:從pmsuspended狀態喚醒域

9.io執行緒

當前不知道是配置,還是什麼原因,沒有相關的資訊

iothreadinfo:view domain IOThreads 

iothreadpin:control domain IOThread affinity 
iothreadadd:將IOThread新增到來賓域
iothreaddel:從來賓域中刪除IOThread

10操縱拯救生成的檔案

這裡主要是處理儲存生成的檔案,包括以XML形式展現等

save-image-define:為域的已儲存狀態檔案重新定義XML(替換與儲存的狀態檔案關聯的域XML)
save-image-dumpxml:以XML格式儲存的狀態域資訊(提取在域中生效的域XML)使用save命令建立儲存的狀態檔案檔案的時間)
save-image-edit:編輯域的已儲存狀態檔案的XML

11.Qemu特定命令

強烈建議不要使用以下命令。
它們可能導致libvirt混淆並在後續操作中做錯事。
使用此命令後,請不要向libvirt開發人員報告問題; 報告將被忽略。

qemu-attach QEMU附加
qemu-monitor-command QEMU Monitor命令
qemu-monitor-event QEMU監視器事件
qemu-agent-command QEMU Guest Agent命令

12.網路相關

domif-setlink:設定虛擬介面的鏈路狀態

<span style="color:#656565"><span style="color:#333333"><code><span style="color:#ffffff">virsh domif</span><span style="color:#ffffff">-</span><span style="color:#ffffff">setlink domain vnet0 down
virsh domif</span><span style="color:#ffffff">-</span><span style="color:#ffffff">setlink domain vnet0 up</span></code></span></span>

domiftune:獲取/設定虛擬介面的引數

13.other

domjobabort:abort active domain job 
domjobinfo:domain job information 
可以用來查詢任務進展,比如正在進行virsh save操作的時候,可以使用此命令進行查詢

dump:將域的核心轉儲到檔案進行分析
domdisplay:域顯示連線URI inject-nmi:向guest虛擬機器注入NMI(不可遮蔽中斷)(當響應時間很關鍵時使用,例如不可恢復的硬體錯誤)
vncdisplay:vnc display(輸出VNC顯示的IP地址和埠號)
ttyconsole:tty console(輸出TTY控制檯的裝置)
schedinfo:show / set scheduler parameters 

lxc-enter-namespace:LXC Guest輸入名稱空間(virsh lxc-enter-namespace命令可用於輸入容器的名稱空間和安全上下文,然後執行任意命令。)

send-key:向客戶傳送金鑰程式碼

在虛擬機器內部,每執行一條上述的傳送金鑰都會回顯一個金鑰字串
 send-process-signal:向程序傳送訊號

console:連線到訪客控制檯 事件:域事件