virsh 学习
| 命令 | 说明 |
|---|---|
| help | 打印帮助 |
| attach-device | 从一个XML文件附加装置 |
| attach-disk | 附加磁盘设备 |
| attach-interface | 获得网络界面 |
| autostart | 自动开始一个域 |
| capabilities | 性能 |
| cd | change the current directory |
| connect | 连接(重新连接)到 hypervisor |
| console | 连接到客户会话 |
| cpu-baseline | compute baseline CPU |
| cpu-compare | compare 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 | 域信息 |
| domjobinfo | domain job information |
| domjobabort | abort active domain job |
| domname | 将域 id 或 UUID 转换为域名 |
| domstate | 域状态 |
| domblkstat | 获得域设备块状态 |
| domifstat | 获得域网络接口状态 |
| dommemstat | get memory statistics for a domain |
| domblkinfo | domain block device size information |
| domxml-from-nati | ve Convert native config to domain XML |
| domxml-to-native | Convert domain XML to native config |
| dumpxml | XML 中的域信息 |
| edit | 编辑某个域的 XML 配置 |
| find-storage-poo | l-sources 发现潜在存储池源 |
| find-storage-poo | l-sources-as 找到潜在存储池源 |
| freecell | NUMA可用内存 |
| hostname | 打印管理程序主机名 |
| list | 列出域 |
| migrate | 将域迁移到另一个主机中 |
| migrate-setmaxdo | wntime set maximum tolerable downtime |
| net-autostart | 自动开始网络 |
| net-create | 从一个 XML 文件创建一个网络 |
| net-define | 从一个 XML 文件定义(但不开始)一个网络 |
| net-destroy | 删除一个网络 |
| net-dumpxml | XML 中的网络信息 |
| net-edit | 为网络编辑 XML 配置 |
| net-list | 列出网络 |
| net-name | 把一个网络UUID 转换为网络名 |
| net-start | 开始一个(以前定义的)不活跃的网络 |
| net-undefine | 取消定义一个非活跃的网络 |
| net-uuid | 把一个网络名转换为网络UUID |
| iface-list | list physical host interfaces |
| iface-name | convert an interface MAC address to interface name |
| iface-mac | convert an interface name to interface MAC address |
| iface-dumpxml | interface information in XML |
| iface-define | define (but don’t start) a physical host interface from an XML file |
| iface-undefine | undefine a physical host interface (remove it from configuration) |
| iface-edit | edit XML configuration for a physical host interface |
| iface-start | start a physical host interface (enable it / “if-up”) |
| iface-destroy | destroy a physical host interface (disable it / “if-down”) |
| managedsave | managed save of a domain state |
| nodeinfo | 节点信息 |
| nodedev-list | 这台主机中中的枚举设备 |
| nodedev-dumpxml | XML 中的节点设备详情 |
| nodedev-dettach | dettach node device from its device driver |
| nodedev-reattach | reattach node device to its device driver |
| nodedev-reset | 重置节点设备 |
| nodedev-create | create a device defined by an XML file on the node |
| nodedev-destroy | destroy a device on the node |
| nwfilter-define | define or update a network filter from an XML file |
| nwfilter-undefine | undefine a network filter |
| nwfilter-dumpxml | network filter information in XML |
| nwfilter-list | list network filters |
| nwfilter-edit | edit 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-dumpxml | XML 中的池信息 |
| pool-edit | 为存储池编辑 XML 配置 |
| pool-info | 存储池信息 |
| pool-list | 列出池 |
| pool-name | 将池 UUID 转换为池名称 |
| pool-refresh | 刷新池 |
| pool-start | 启动一个(以前定义的)非活跃的池 |
| pool-undefine | 取消定义一个不活跃的池 |
| pool-uuid | 把一个池名称转换为池 UUID |
| secret-define | define or modify a secret from an XML file |
| secret-dumpxml | secret attributes in XML |
| secret-set-value | set a secret value |
| secret-get-value | Output a secret value |
| secret-undefine | undefine a secret |
| secret-list | list secrets |
| pwd | print the current directory |
| quit | 退出这个非交互式终端 |
| exit | 退出这个非交互式终端 |
| reboot | 重新启动一个域 |
| restore | 从一个存在一个文件中的状态恢复一个域 |
| resume | 重新恢复一个域 |
| save | 把一个域的状态保存到一个文件 |
| schedinfo | 显示/设置日程安排变量 |
| dump | 把一个域的内核 dump 到一个文件中以方便分析 |
| shutdown | 关闭一个域 |
| setmem | 改变内存的分配 |
| setmaxmem | 改变最大内存限制值 |
| setvcpus | 改变虚拟 CPU 的号 |
| suspend | 挂起一个域 |
| ttyconsole | tty 控制台 |
| undefine | 取消定义一个非活跃的域 |
| update-device | update device from an XML file |
| uri | 打印管理程序典型的URI |
| vol-create | 从一个 XML 文件创建一个卷 |
| vol-create-from | create a vol, using another volume as input |
| vol-create-as | 从一组变量中创建卷 |
| vol-clone | clone a volume. |
| vol-delete | 删除卷 |
| vol-wipe | wipe a vol |
| vol-dumpxml | XML 中的卷信息 |
| vol-info | 存储卷信息 |
| vol-list | 列出卷 |
| vol-pool | returns the storage pool for a given volume key or path |
| vol-path | returns the volume path for a given volume name or key |
| vol-name | returns the volume name for a given volume key or path |
| vol-key | returns the volume key for a given volume name or path |
| vcpuinfo | 域 vcpu 的信息 |
| vcpupin | 控制域 vcpu affinity |
| version | 显示版本 |
| vncdisplay | vnc 显示 |
| snapshot-create | Create a snapshot |
| snapshot-current | Get the current snapshot |
| snapshot-delete | Delete a domain snapshot |
| snapshot-dumpxml | Dump XML for a domain snapshot |
| snapshot-list | List snapshots for a domain |
| snapshot-revert | Revert 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

1424

被折叠的 条评论
为什么被折叠?



