Difference between revisions of "Qemu Quick Ref + KVM + Virsh"
Jump to navigation
Jump to search
Line 26: | Line 26: | ||
[[Category:KVM]] | [[Category:KVM]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
+ | [[Category:ReferenceCards]] |
Revision as of 06:25, 15 February 2023
1 facts
- get disks
virsh domblklist $VM
- disk info
qemu-img info $VM_IDISK
- get ip adress of vm
virsh qemu-agent-command $VM '{"execute":"guest-network-get-interfaces"}' | python3 -mjson.tool | grep ip-address
2 resize
- resize image
qemu-img resize $VM_IDISK 100G
3 snapshot
- list snapshots with virsh
virsh snapshot-list $VM
- commit snapshot from online vm
virsh blockcommit $VM $VM_IDISK --active --pivot --verbose
- commit snapshot from powered-off vm
qemu-img commit $VM_DISK_DELTA_FILE
- delete snapshot meta data
virsh snapshot-delete $VM snap_name --metadata
- delete snapshot within qcow2 file
qemu-img snapshot -d $SNAP_NAME $VM_DISK