Installation guide

Dell Inc.
KVM Virtualization in RHEL 6 Made Easy
13
Max memory: 1048576 kB
Used memory: 524288 kB
In our second example, let‟s increase the amount of memory in vm1 above from 512 MB to 2 GB:
1. In this case we will first need to increase the maximum memory setting. The best way to do it is by
editing the VM‟s configuration file. Shutdown the VM or you might see unexpected results:
# virsh shutdown vm1
2. Edit the VM‟s configuration file:
# virsh edit vm1
Change the value inside the <memory> tab to:
<memory>2097152</memory>
Remember that the value is in KB. Save the file and exit.
3. Restart the VM from its updated configuration file:
# virsh create /etc/libvirt/qemu/vm1.xml
4. View memory settings:
# virsh dominfo vm1 | grep memory
Max memory: 2097152 kB
Used memory: 524288 kB
5. Now you can dynamically change the memory:
# virsh setmem vm1 2097152
Verify:
# virsh dominfo vm1 | grep memory
Max memory: 2097152 kB
Used memory: 2097152 kB
6.2 VCPUs
To change the number of virtual CPUs in a VM, change the number in the vcpu tag in the VM‟s
configuration file. For example, let‟s change the number of virtual CPUs to 2:
# virsh shutdown vm1
# virsh edit vm1
<vcpu>2</vcpu>
# virsh create /etc/libvirt/qemu/vm1.xml