1,migrate --domain --destURL --dname --live(熱遷移)
migrate lf 192.168.16.3 dname
2,managedsave domain-id 保存當前運行的虛擬機的狀態,當虛擬機再次啟動的時候會恢復到之前保存的狀態
Domain Management (help keyword 'domain'): 詳細解釋: 用法:
attach-device 從一個XML文件附加裝置; 使用 XML文件中的設備定義在客戶端中添加設備。attach-device lf lf.xml
attach-disk 附加磁盤設備
attach-interface 獲得網絡界面
autostart 自動開始一個域;定義為該狀態的domain會在libvirt服務啟動時自動啟動。
blkdeviotune Set or query a block device I/O tuning parameters.;使用blkdeviotune可以設置虛擬機的讀寫速度和iops
blkiotune Get or set blkio parameters; 設置磁盤的權重 設置虛擬機的權重為700,並立即生效。
blockpull Populate a disk from its backing image.;將backing file數據合並至overlay中,截止目前只能將backing file合並至當前使用的active中,也就是說還不支 持指定top的合並.(blockcommit: 從 top 合並數據到 base )
blockjob Manage active block operations.;xxxxxxxxxxxx
blockresize Resize block device of domain. ;調整塊設備大小。調整容量大小
console 連接到客戶會話
cpu-baseline compute baseline CPU ;xxxxxxxxxxxx
cpu-compare compare host CPU with a CPU described by an XML file;xxxxxxxxxxxx
create 從一個 XML 文件創建一個域;創建一個虛擬機並啟動
define 從一個 XML 文件定義(但不開始)一個域;定義一個虛擬機
destroy destroy (stop) a domain;強制關機
detach-device 從一個 XML 文件分離設備;xxxxxxxxxxxx
detach-disk 分離磁盤設備;xxxxxxxxxxxx
detach-interface 分離網絡界面;xxxxxxxxxxxx
domid 把一個域名或 UUID 轉換為域 id;根據虛擬機名稱獲取域名或ID
domif-setlink set link state of a virtual interface ;需要參數interface。
domjobabort abort active domain job;xxxxxxxxxxxx
domjobinfo domain job information;xxxxxxxxxxxx
domname 將域 id 或 UUID 轉換為域名
domuuid 把一個域名或 id 轉換為域 UUID
domxml-from-native Convert native config to domain XML;配置文件到xml的轉換
domxml-to-native Convert domain XML to native config;xml到配置文件的轉換
dump 把一個域的內核 dump 到一個文件中以方便分析
dumpxml XML 中的域信息
edit 編輯某個域的 XML 配置
inject-nmi Inject NMI to the guest ;把NMI注入到客戶機
send-key Send keycodes to the guest;將鍵碼發送到客戶機
managedsave managed save of a domain state;相當於系統還原點
managedsave-remove Remove managed save of a domain;刪除系統還原點
maxvcpus connection vcpu maximum ;連接虛擬處理器最大值
memtune Get or set memory parameters;設置內存參數
OPTIONS
[--domain] <string> domain name, id or uuid
--hard-limit <number> 強制最大內存 (default KiB)
--soft-limit <number> 可用最大內存 (default KiB)
--swap-hard-limit <number> 強制最大swap使用大小(default KiB)
--min-guarantee <number> 最小保證的內存 (default KiB)
--config 下次重啟生效
--live 在線生效
--current 只在當前生效
例子:
memtune 6 --hard-limit 4194304 --soft-limit 8388608 --swap-hard-limit 4194304 --config
migrate 將域遷移到另一個主機中。;完成VM狀態轉儲.保存運行狀態虛擬機的內存設備狀態信息至文件,可以通過此文件恢復到保存時的狀態,有點類似系統
的休眠.(注意創建VM狀態保存的時候VM磁盤必須是未發生寫入改動的)
migrate-setmaxdowntime set maximum tolerable downtime;設定可以容忍的最長停機時間
migrate-setspeed Set the maximum migration bandwidth;設定最大遷移帶寬
migrate-getspeed Get the maximum migration bandwidth;獲取最大遷移帶寬
reboot 重新啟動一個域
reset reset a domain;重置域
restore 從一個存在一個文件中的狀態恢復一個域;
resume 重新恢復一個域;重新運行。
save 把一個域的狀態保存到一個文件
save-image-define redefine the XML for a domain's saved state file;為域的保存狀態文件重新定義XML
save-image-dumpxml saved state domain information in XML; XML中的保存狀態域信息
save-image-edit edit XML for a domain's saved state file;為域的保存狀態文件編輯XML
schedinfo 顯示/設置日程安排變量;顯示/設定調度器參數
screenshot take a screenshot of a current domain console and store it into a file;獲取當前域控制台的屏幕截圖,並保存到文件中
setmaxmem 改變最大內存限制值;
setmem 改變內存的分配
setvcpus 改變虛擬 CPU 的數量;
shutdown 關閉一個域;關機
start 開始一個(以前定義的)非活躍的域
suspend 掛起一個域,暫停;
ttyconsole tty 控制台
undefine undefine a domain 取消已經定義的域
update-device update device from an XML file;從XML文件更新設備
vcpucount domain vcpu counts; 域虛擬處理器數量
vcpuinfo detailed domain vcpu information;詳細的域虛擬處理器信息
vcpupin control or query domain vcpu affinity; 控制或查詢域虛擬處理器親近性
version 顯示版本
vncdisplay vnc 顯示
-----------------------------------------------------------------------
Domain Monitoring (help keyword 'monitor'):
domblkinfo domain block device size information
domblklist list all domain blocks ;查看虛擬機磁盤列表
domblkstat 獲得域設備塊狀態
domcontrol domain control interface state;域控制台界面狀態
domif-getlink get link state of a virtual interface;獲取虛擬接口的鏈路狀態
domifstat 獲得域網絡接口狀態;獲取域的網絡接口統計信息
dominfo 域信息
dommemstat get memory statistics for a domain ;獲取mem實際大小
domstate 域狀態
list 列出域
Host and Hypervisor (help keyword 'host'):
capabilities 性能
connect 連接(重新連接)到 hypervisor
freecell NUMA可用內存
hostname 打印管理程序主機名
nodecpustats Prints cpu stats of the node.;CPU狀態
nodeinfo 節點信息;CPU信息
nodememstats Prints memory stats of the node.
nodesuspend suspend the host node for a given time duration;將主機節點暫停一段特定的時間
qemu-attach QEMU Attach
qemu-monitor-command QEMU Monitor Command
sysinfo print the hypervisor sysinfo
uri 打印管理程序典型的URI
Interface (help keyword 'interface'):
iface-begin create a snapshot of current interfaces settings, which can be later commited (iface-commit) or restored (iface-rollback);拍攝當前接口設置的 快照,以后可以提交(iface-commit)或恢復(iface-rollback)
iface-bridge create a bridge device and attach an existing network device to it;建立網橋設備,並與現有網絡設備相連
iface-commit commit changes made since iface-begin and free restore point;實行自iface-begin和閑置恢復點以來所作的變化
iface-define define (but don't start) a physical host interface from an XML file;從XML文件定義(但不啟動)物理主機接口
iface-destroy destroy a physical host interface (disable it / "if-down");銷毀物理主機接口(禁用它/ "if-down")
iface-dumpxml interface information in XML
iface-edit edit XML configuration for a physical host interface
iface-list list physical host interfaces ;XXXXXXXXXXXXXXXX
iface-mac convert an interface name to interface MAC address;XXX
iface-name convert an interface MAC address to interface name;XXX
iface-rollback rollback to previous saved configuration created via iface-begin;恢復到通過iface-begin創建的之前保存的配置
iface-start start a physical host interface (enable it / "if-up");啟動物理主機接口(啟用它/ "if-up")
iface-unbridge undefine a bridge device after detaching its slave device;分離從屬設備后,取消定義網橋設備
iface-undefine undefine a physical host interface (remove it from configuration);取消定義物理主機接口(將它從配置中移除)
Network Filter (help keyword 'filter'):
nwfilter-define define or update a network filter from an XML file;從XML文件定義或更新網絡過濾器
nwfilter-dumpxml network filter information in XML;XML中的網絡過濾器信息
nwfilter-edit edit XML configuration for a network filter
nwfilter-list list network filters
nwfilter-undefine undefine a network filter
Networking (help keyword 'network'):
net-autostart 自動開始網絡
net-create 從一個 XML 文件創建一個網絡
net-define 從一個 XML 文件定義(但不開始)一個網絡
net-destroy destroy (stop) a network
net-dumpxml XML 中的網絡信息
net-edit 為網絡編輯 XML 配置
net-info network information
net-list 列出網絡
net-name 把一個網絡UUID 轉換為網絡名
net-start 開始一個(以前定義的)不活躍的網絡
net-undefine 取消定義一個非活躍的網絡
net-uuid 把一個網絡名轉換為網絡UUID
Node Device (help keyword 'nodedev'):
nodedev-create create a device defined by an XML file on the node
nodedev-destroy destroy (stop) a device on the node
nodedev-dettach dettach node device from its device driver
nodedev-dumpxml XML 中的節點設備詳情
nodedev-list 這台主機中中的枚舉設備
nodedev-reattach reattach node device to its device driver
nodedev-reset 重置節點設備
Secret (help keyword 'secret'):
secret-define define or modify a secret from an XML file
secret-dumpxml secret attributes in XML
secret-get-value Output a secret value
secret-list list secrets
secret-set-value set a secret value
secret-undefine undefine a secret
Snapshot (help keyword 'snapshot'):
snapshot-create Create a snapshot from XML;通過xml配置文件創建快照
snapshot-create-as Create a snapshot from a set of args ;直接用命令創建快照;創建外置disk-only磁盤快照
snapshot-current Get or set the current snapshot;查看snapshot當前狀態信息。
snapshot-delete Delete a domain snapshot
snapshot-dumpxml Dump XML for a domain snapshot
snapshot-edit edit XML for a snapshot
snapshot-list List snapshots for a domain
snapshot-parent Get the name of the parent of a snapshot
snapshot-revert Revert a domain to a snapshot ;回滾快照
Storage Pool (help keyword 'pool'):
find-storage-pool-sources-as 找到潛在存儲池源
find-storage-pool-sources 發現潛在存儲池源
pool-autostart 自動啟動某個池
pool-build 建立池
pool-create-as 從一組變量中創建一個池
pool-create 從一個 XML 文件中創建一個池
pool-define-as 在一組變量中定義池
pool-define 在一個 XML 文件中定義(但不啟動)一個池
pool-delete 刪除池
pool-destroy destroy (stop) a pool
pool-dumpxml XML 中的池信息
pool-edit 為存儲池編輯 XML 配置
pool-info 存儲池信息
pool-list 列出池
pool-name 將池 UUID 轉換為池名稱
pool-refresh 刷新池
pool-start 啟動一個(以前定義的)非活躍的池
pool-undefine 取消定義一個不活躍的池
pool-uuid 把一個池名稱轉換為池 UUID
Storage Volume (help keyword 'volume'):
vol-clone clone a volume.
vol-create-as 從一組變量中創建卷;其實就是創建個文件。
vol-create 從一個 XML 文件創建一個卷
vol-create-from create a vol, using another volume as input
vol-delete 刪除卷
vol-download Download a volume to a file
vol-dumpxml XML 中的卷信息
vol-info 存儲卷信息
vol-key returns the volume key for a given volume name or path
vol-list 列出卷
vol-name returns the volume name for a given volume key or path;獲取卷的名稱根據路徑或key
vol-path returns the volume path for a given volume name or key;根據卷名得到卷縮在路徑。
vol-pool returns the storage pool for a given volume key or path;根據key和路徑得到存儲池的名稱。
vol-upload upload a file into a volume;把某個文件導入卷內。
vol-wipe wipe a vol;擦出卷
