This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
технология_kvm [2024/07/12 14:24] val [Загрузка образа] |
технология_kvm [2025/02/13 08:34] (current) val [Загрузка образа] |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| # egrep -c '(vmx|svm)' /proc/cpuinfo | # egrep -c '(vmx|svm)' /proc/cpuinfo | ||
| + | # apt update | ||
| # time apt install qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager #qemu | # time apt install qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager #qemu | ||
| real 4m27.401s | real 4m27.401s | ||
| Line 34: | Line 35: | ||
| node1# virsh list --all | node1# virsh list --all | ||
| - | node1# virsh vncdisplay winxp1 | + | node1# virsh vncdisplay winxp |
| :0 | :0 | ||
| </code> | </code> | ||
| Line 113: | Line 114: | ||
| # qemu-img info --output json /root/noble-server-cloudimg-amd64.img | # qemu-img info --output json /root/noble-server-cloudimg-amd64.img | ||
| + | # qemu-img info --output json /root/debian-12-generic-amd64.qcow2 | ||
| - | # apt install libguestfs-tools | + | # time apt install libguestfs-tools |
| + | real 1m47.380s | ||
| # time virt-customize -a /root/noble-server-cloudimg-amd64.img --root-password password:'strongpassword' | # time virt-customize -a /root/noble-server-cloudimg-amd64.img --root-password password:'strongpassword' | ||
| + | # time virt-customize -a /root/debian-12-generic-amd64.qcow2 --root-password password:'strongpassword' | ||
| real 1m26.032s | real 1m26.032s | ||
| </code> | </code> | ||
| Line 144: | Line 148: | ||
| # virsh vol-create-as --pool pool-nodes --name disk-node1 --capacity $(qemu-img info --output json /root/noble-server-cloudimg-amd64.img | jq -r .[\"virtual-size\"]) | # virsh vol-create-as --pool pool-nodes --name disk-node1 --capacity $(qemu-img info --output json /root/noble-server-cloudimg-amd64.img | jq -r .[\"virtual-size\"]) | ||
| + | # virsh vol-create-as --pool pool-nodes --name disk-node1 --capacity $(qemu-img info --output json /root/debian-12-generic-amd64.qcow2 | jq -r .[\"virtual-size\"]) | ||
| # virsh vol-upload --pool pool-nodes --vol disk-node1 --file /root/noble-server-cloudimg-amd64.img | # virsh vol-upload --pool pool-nodes --vol disk-node1 --file /root/noble-server-cloudimg-amd64.img | ||
| + | # virsh vol-upload --pool pool-nodes --vol disk-node1 --file /root/debian-12-generic-amd64.qcow2 | ||
| # virsh vol-info --pool pool-nodes --vol disk-node1 | # virsh vol-info --pool pool-nodes --vol disk-node1 | ||
| Line 168: | Line 174: | ||
| # virsh vol-upload --pool pool-nodes --vol cloud-init-node1 --file cloud-init-node1.iso | # virsh vol-upload --pool pool-nodes --vol cloud-init-node1 --file cloud-init-node1.iso | ||
| - | |||
| - | # ###virsh vol-delete --pool pool-nodes --vol cloud-init-node1 | ||
| # virsh vol-list --pool pool-nodes | # virsh vol-list --pool pool-nodes | ||
| + | |||
| + | # ###virsh vol-delete --pool pool-nodes --vol cloud-init-node1 | ||
| </code> | </code> | ||
| Line 179: | Line 185: | ||
| <code> | <code> | ||
| + | # virt-install --osinfo list | grep debian | ||
| + | |||
| # virt-install \ | # virt-install \ | ||
| --name domain-node1 \ | --name domain-node1 \ | ||
| - | --osinfo detect=on,require=off \ | + | --osinfo debian11 \ |
| --ram=2048 \ | --ram=2048 \ | ||
| --vcpus=2 \ | --vcpus=2 \ | ||
| Line 193: | Line 201: | ||
| --import | --import | ||
| </code><code> | </code><code> | ||
| + | Escape character is ^] (Ctrl + ]) | ||
| + | ... | ||
| + | node1 login: | ||
| ... | ... | ||
| [ OK ] Reached target cloud-init.target - Cloud-init target. | [ OK ] Reached target cloud-init.target - Cloud-init target. | ||
| Line 205: | Line 216: | ||
| # virsh --connect qemu:///system start domain-node1 | # virsh --connect qemu:///system start domain-node1 | ||
| + | # ###virsh destroy domain-node1 | ||
| # ###virsh undefine --domain domain-node1 | # ###virsh undefine --domain domain-node1 | ||
| </code> | </code> | ||