Difference between revisions of "Qemu Quick Ref + KVM + Virsh"
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
virsh blockcommit $VM $VM_IDISK --active --pivot --verbose | virsh blockcommit $VM $VM_IDISK --active --pivot --verbose | ||
* commit snapshot from powered-off vm | * commit snapshot from powered-off vm | ||
− | qemu-img commit | + | qemu-img commit $VM_DISK_DELTA_FILE |
* delete snapshot meta data | * delete snapshot meta data | ||
virsh snapshot-delete $VM snap_name --metadata | virsh snapshot-delete $VM snap_name --metadata | ||
+ | * delete snapshot within qcow2 file | ||
+ | qemu-img snapshot -d $SNAP_NAME $VM_DISK | ||
[[Category:KVM]] | [[Category:KVM]] | ||
[[Category:Linux]] | [[Category:Linux]] |
Revision as of 08:40, 24 January 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