Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
14.13.7. Configuring Memory Allocation
To modify a guest virtual machine's memory allocation with
virsh:
virsh setmem {domain-id or domain-name} count
# virsh setmem {domain-id or domain-name} count
virsh setmem vr-rhel6u1-x86_64-kvm --kilobytes 1025000
# virsh setmem vr-rhel6u1-x86_64-kvm --kilobytes 1025000
You must specify the
count in kilobytes. The new count value cannot exceed the amount you specified when you created the guest virtual machine. Values lower than 64 MB are unlikely to work with most guest virtual machine operating systems. A higher maximum memory value does not affect active guest virtual machines. If the new value is lower than the available memory, it will shrink possibly causing the guest virtual machine to crash.
This command has the following options:
- [--domain] <string> domain name, id or uuid
- [--size] <number> new memory size, as scaled integer (default KiB)Valid memory units include:
borbytesfor bytesKBfor kilobytes (103 or blocks of 1,000 bytes)korKiBfor kibibytes (210 or blocks of 1024 bytes)MBfor megabytes (106 or blocks of 1,000,000 bytes)MorMiBfor mebibytes (220 or blocks of 1,048,576 bytes)GBfor gigabytes (109 or blocks of 1,000,000,000 bytes)GorGiBfor gibibytes (230 or blocks of 1,073,741,824 bytes)TBfor terabytes (1012 or blocks of 1,000,000,000,000 bytes)TorTiBfor tebibytes (240 or blocks of 1,099,511,627,776 bytes)
Note that all values will be rounded up to the nearest kibibyte by libvirt, and may be further rounded to the granularity supported by the hypervisor. Some hypervisors also enforce a minimum, such as 4000KiB (or 4000 x 210 or 4,096,000 bytes). The units for this value are determined by the optional attributememory unit, which defaults to the kibibytes (KiB) as a unit of measure where the value given is multiplied by 210 or blocks of 1024 bytes. - --config takes affect next boot
- --live controls the memory of the running domain
- --current controls the memory on the current domain