cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

middleware:virtualization:kvm:change_cpu_memory.html



KVM : How to change cpu number, memory size of gest os

How to change CPU Numbers of Guest OS

Check CPU Numbers

# virsh list --all
# virsh vcpuinfo kvm_centos7

Chenge CPU

# virsh shutdown kvm_centos7
# virsh edit kvm_centos7             # /etc/libvirt/qemu/kvm_centos7.xml

<vcpu placement='static'>4</vcpu>

# virsh start kvm_centos7


How to Change Core Numbers.

<vcpu placement='static'>4</vcpu>
<cpu>
    <topology sockets='1' cores='4' threads='1'/>
</cpu>


How to change Memory Sizes of Guest OS

Check

# free -m

Chenge Memory

# 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







middleware/virtualization/kvm/change_cpu_memory.html.txt ยท Last modified: 2019/06/12 by admin

Page Tools