# virsh list --all # virsh vcpuinfo kvm_centos7
# virsh shutdown kvm_centos7 # virsh edit kvm_centos7 # /etc/libvirt/qemu/kvm_centos7.xml <vcpu placement='static'>4</vcpu> # virsh start kvm_centos7
<vcpu placement='static'>4</vcpu> <cpu> <topology sockets='1' cores='4' threads='1'/> </cpu>
# free -m
# virsh shutdown kvm_centos7 # virsh edit kvm_centos7 # /etc/libvirt/qemu/kvm_centos7.xml <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> # virsh start kvm_centos7
Memory Example
<currentMemory unit='M'>2</currentMemory>
<currentMemory unit='MiB'>2</currentMemory>
<currentMemory unit='G'>2</currentMemory>
<currentMemory unit='GiB'>2</currentMemory>
<currentMemory unit='TiB'>2</currentMemory>
1GB = 1048576 = 1 x 1024 x 1024
2GB = 2097152 = 2 x 1024 x 1024
4GB = 4194304 = 4 x 1024 x 1024
6GB = 6291456 = 6 x 1024 x 1024
8GB = 8388608 = 8 x 1024 x 1024
KVM CLI Commands Cheet Sheat and Configuration Examples