libvirtd 学习

virsh 学习

命令说明
help打印帮助
attach-device从一个XML文件附加装置
attach-disk附加磁盘设备
attach-interface获得网络界面
autostart自动开始一个域
capabilities性能
cdchange the current directory
connect连接(重新连接)到 hypervisor
console连接到客户会话
cpu-baselinecompute baseline CPU
cpu-comparecompare host CPU with a CPU described by an XML file
create从一个 XML 文件创建一个域
start开始一个(以前定义的)非活跃的域
destroy删除一个域
detach-device从一个 XML 文件分离设备
detach-disk分离磁盘设备
detach-interface分离网络界面
define从一个 XML 文件定义(但不开始)一个域
domid把一个域名或 UUID 转换为域 id
domuuid把一个域名或 id 转换为域 UUID
dominfo域信息
domjobinfodomain job information
domjobabortabort active domain job
domname将域 id 或 UUID 转换为域名
domstate域状态
domblkstat获得域设备块状态
domifstat获得域网络接口状态
dommemstatget memory statistics for a domain
domblkinfodomain block device size information
domxml-from-native Convert native config to domain XML
domxml-to-nativeConvert domain XML to native config
dumpxmlXML 中的域信息
edit编辑某个域的 XML 配置
find-storage-pool-sources 发现潜在存储池源
find-storage-pool-sources-as 找到潜在存储池源
freecellNUMA可用内存
hostname打印管理程序主机名
list列出域
migrate将域迁移到另一个主机中
migrate-setmaxdowntime set maximum tolerable downtime
net-autostart自动开始网络
net-create从一个 XML 文件创建一个网络
net-define从一个 XML 文件定义(但不开始)一个网络
net-destroy删除一个网络
net-dumpxmlXML 中的网络信息
net-edit为网络编辑 XML 配置
net-list列出网络
net-name把一个网络UUID 转换为网络名
net-start开始一个(以前定义的)不活跃的网络
net-undefine取消定义一个非活跃的网络
net-uuid把一个网络名转换为网络UUID
iface-listlist physical host interfaces
iface-nameconvert an interface MAC address to interface name
iface-macconvert an interface name to interface MAC address
iface-dumpxmlinterface information in XML
iface-definedefine (but don’t start) a physical host interface from an XML file
iface-undefineundefine a physical host interface (remove it from configuration)
iface-editedit XML configuration for a physical host interface
iface-startstart a physical host interface (enable it / “if-up”)
iface-destroydestroy a physical host interface (disable it / “if-down”)
managedsavemanaged save of a domain state
nodeinfo节点信息
nodedev-list这台主机中中的枚举设备
nodedev-dumpxmlXML 中的节点设备详情
nodedev-dettachdettach node device from its device driver
nodedev-reattachreattach node device to its device driver
nodedev-reset重置节点设备
nodedev-createcreate a device defined by an XML file on the node
nodedev-destroydestroy a device on the node
nwfilter-definedefine or update a network filter from an XML file
nwfilter-undefineundefine a network filter
nwfilter-dumpxmlnetwork filter information in XML
nwfilter-listlist network filters
nwfilter-editedit XML configuration for a network filter
pool-autostart自动启动某个池
pool-build建立池
pool-create从一个 XML 文件中创建一个池
pool-create-as从一组变量中创建一个池
pool-define在一个 XML 文件中定义(但不启动)一个池
pool-define-as在一组变量中定义池
pool-destroy销毁池
pool-delete删除池
pool-dumpxmlXML 中的池信息
pool-edit为存储池编辑 XML 配置
pool-info存储池信息
pool-list列出池
pool-name将池 UUID 转换为池名称
pool-refresh刷新池
pool-start启动一个(以前定义的)非活跃的池
pool-undefine取消定义一个不活跃的池
pool-uuid把一个池名称转换为池 UUID
secret-definedefine or modify a secret from an XML file
secret-dumpxmlsecret attributes in XML
secret-set-valueset a secret value
secret-get-valueOutput a secret value
secret-undefineundefine a secret
secret-listlist secrets
pwdprint the current directory
quit退出这个非交互式终端
exit退出这个非交互式终端
reboot重新启动一个域
restore从一个存在一个文件中的状态恢复一个域
resume重新恢复一个域
save把一个域的状态保存到一个文件
schedinfo显示/设置日程安排变量
dump把一个域的内核 dump 到一个文件中以方便分析
shutdown关闭一个域
setmem改变内存的分配
setmaxmem改变最大内存限制值
setvcpus改变虚拟 CPU 的号
suspend挂起一个域
ttyconsoletty 控制台
undefine取消定义一个非活跃的域
update-deviceupdate device from an XML file
uri打印管理程序典型的URI
vol-create从一个 XML 文件创建一个卷
vol-create-fromcreate a vol, using another volume as input
vol-create-as从一组变量中创建卷
vol-cloneclone a volume.
vol-delete删除卷
vol-wipewipe a vol
vol-dumpxmlXML 中的卷信息
vol-info存储卷信息
vol-list列出卷
vol-poolreturns the storage pool for a given volume key or path
vol-pathreturns the volume path for a given volume name or key
vol-namereturns the volume name for a given volume key or path
vol-keyreturns the volume key for a given volume name or path
vcpuinfo域 vcpu 的信息
vcpupin控制域 vcpu affinity
version显示版本
vncdisplayvnc 显示
snapshot-createCreate a snapshot
snapshot-currentGet the current snapshot
snapshot-deleteDelete a domain snapshot
snapshot-dumpxmlDump XML for a domain snapshot
snapshot-listList snapshots for a domain
snapshot-revertRevert a domain to a snapshot

virsh define test.xml
virsh list
virsh list --all
virsh edit Id


/etc/libvirt/qemu/         # xml  路径
/var/lib/libvirt/images/  # image 路径

查看spice端口
netstat -ntpl | grep qemu

virsh domdisplay --type spice {Id or Name}

创建镜像:
qemu-img create -f qcow2 ubuntu-14.04.qcow2 20G

qemu-img info ubuntu-14.04.qcow2

镜像压缩
qemu-img convert -p -c -O qcow2 source.img destination.qcow2

创建快照
qemu-img create -f qcow2 -b base.qcow2 snapshot.qcow2

resize
qemu-img resize source.qcow2 +10G


链接:
在KVM虚拟机中使用spice
每天5分钟玩转 OpenStack

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值