Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Add, Configure, and Remove Virtual Hardware
This section will focus on changing virtual machine (VM) hardware configurations like memory, vCPU, network adapters, and virtual disks.
Changing Virtual Memory
So, you configured your VM initially with 1,024 MB of RAM and you noticed that performance is lacking due to memory resource exhaustion. Let’s have a look at how you can change the amount of memory on your VM. To do so, you’ll use the Set-VM cmdlet. This cmdlet accepts a -MemoryMB parameter, which allows you to define a new memory size:
Set-VM VM001 -MemoryMB 2048 -Confirm:$false
Remember that for this line of code to work, your VM must be powered off or support memory hot plug. If your VM doesn’t support memory hot plug and you can only shut down your VM during maintenance hours, you might want to schedule an upgrade process.