GNU/Linux >> Linux Esercitazione >  >> Cent OS

Come aumentare le risorse di memoria guest KVM

Questo post illustra i passaggi su come aumentare la memoria guest KVM. Se la memoria guest KVM corrente è uguale al limite di memoria, puoi aumentare la memoria offline seguendo i passaggi seguenti:

1. Verifica lo stato attuale della memoria del guest KVM:

[root@kvm-host]# virsh dumpxml kvm-guest | grep -i memory
<memory unit='KiB'>8392704</memory>                   ### the maximum amount of memory that can be allocated to the VM
<currentMemory unit='KiB'>8392704</currentMemory>     ### current Guest VM memory
[root@kvm-host]# virsh dominfo kvm-guest
Id: 12
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
OS Type: hvm
State: running
CPU(s): 4
CPU time: 429.8s
Max memory: 8392704 KiB
Used memory: 8392704 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c339,c981 (enforcing)
[root@kvm-host]# virsh dominfo kvm-guest
Id: 12
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
OS Type: hvm
State: running
CPU(s): 4
CPU time: 429.8s
Max memory: 8392704 KiB
Used memory: 8392704 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c339,c981 (enforcing)

2. Spegnere la macchina virtuale guest:

[root@kvm-host]# virsh list
Id Name State
----------------------------------------------------
12 kvm-guest running
[root@kvm-host]# virsh destroy kvm-guest
Domain kvm-guest destroyed
[root@kvm-host]# virsh list
Id Name State
----------------------------------------------------

3. Aggiorna la memoria:

# virsh edit guest_vm

Ad esempio:

[root@kvm-host]# virsh edit kvm-guest
Domain kvm-guest XML configuration edited.

Da:

<memory unit='KiB'>8392704</memory>
<currentMemory unit='KiB'>8392704</currentMemory>

A:

<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>

4. Avvia la macchina virtuale guest:

[root@kvm-host]# virsh start kvm-guest
Domain kvm-guest started

5. Verifica se la memoria è stata aumentata:

Dall'host KVM:

[root@kvm-host]# virsh dominfo kvm-guest
...
Name: kvm-guest
UUID: 8f6fc48c-a6f4-429d-b77e-88a4b8d3d961
Max memory: 16777216 KiB
Used memory: 16777216 KiB
...
[root@kvm-host]# virsh dumpxml kvm-guest |grep -i memo
<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>

Da ospite:

[root@localhost ~]# free -g
total used free shared buffers cached
Mem: 15 0 15 0 0 0
-/+ buffers/cache: 0 15
Swap: 3 0 3
Come aumentare le risorse vCPU guest KVM


Cent OS
  1. Come installare KVM su CentOS 8 Linux

  2. Come disabilitare NUMA in CentOS / RHEL 6,7

  3. Come limitare alcune risorse di memoria utente su CentOS/RHEL usando cgroup

  4. Come aumentare le risorse vCPU guest KVM

  5. Come avviare KVM Guest in una shell di Rescue

Come abilitare l'accesso alla console Virsh per i guest KVM

Come aumentare la memoria e la CPU sulla macchina Vagrant

Come installare KVM su Manjaro 21

Come installare KVM su CentOS 8

Come aumentare il timeout nello stucco?

Come aumentare la risoluzione dello schermo visualizzato su QEMU / KVM?