How to hot add and remove memory in Windows Server 2016 Hyper-V
1. First, open the Hyper-V Management Console. Select the Virtual Machine you want to alter. Right click, and select setting.
2. Then, select the Memory tab under Hardware, and specify the required additional memory. You should be seeing a screen like the one below.
Then, just set the value of RAM as desired add or remove.
Keep in mind that Hyper-V Manager often shows a nondescript “Failed to modify device ‘Memory’” error:
It does have some clear messages, and those work well. For instance, if you try to assign more memory than the host has, and the guest operating system supports hot add/remove, you’ll be told the exact maximum amount that you can use. If the guest operating system doesn’t support the feature, then you will get the same nondescript error.
3. After adding the memory to your VM, click Apply and OK. The additional memory should have been added to the VM.