Does Hyper-V Dynamic Memory work with Linux?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Peter_U

New Member
Apr 11, 2012
22
0
1
USA-Canada Border
I am trying to spec out a few lighter use VMs. I searched and it seems like there is conflicting information on if it works or not. Some technet articles say if you turn it on it pegs you at 100% cpu utilization.
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,511
5,792
113
I think it started working with newer CentOS and Ubuntu versions as of Windows Server 2012 R1.

In Windows Server 2012 R2 and the latest CentOS 6.5 / Ubuntu Server it works fairly well. I do see higher dynamic allocations than on my Windows Server 2012 R2 Standard VM though.
 

Salami

New Member
Oct 12, 2012
31
1
0
There is a Hyper-V Integration Services for Linux you can download from Microsoft, or it comes with some newer versions of Linux, that you can install on the Linux guest. This should do it, but if there are specific problems I wouldn't know.
 

Reading@Work

New Member
Jul 31, 2014
3
0
1
45
Feature Descriptions for Linux virtual machines on Hyper-V
Applies To: Hyper-V Server 2012, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2​

Linux Virtual Machines on Hyper-V

Depends on the version of Windows Server/Hyper-V and Linux Guest OS. They've got a pretty verbose breakdown on the Dynamic Memory support with different Linux guest operatint systems at the Microsoft Technet.

For example:
Cent OS / Red Hat Enterprise Linux
Versions 7.0 and 6.5:
  1. Hot-Add support is not enabled by default in this distribution. To enable Hot-Add support you need to add a udev rule under /etc/udev/rules.d/ as follows:
    1. Create a file /etc/udev/rules.d/100-balloon.rules. You may use any other desired name for the file.
    2. Add the following content to the file: SUBSYSTEM=="memory", ACTION=="add", ATTR{state}="online"
    3. Reboot the system to enable Hot-Add support.
  2. Dynamic memory operations can fail if the guest operating system is running too low on memory. The following are some best practices:
    • Startup memory and minimal memory should be equal to or greater than the amount of memory that the distribution vendor recommends.
    • Applications that tend to consume the entire available memory on a system are limited to consuming up to 80 percent of available RAM.
  3. If you are using Dynamic Memory on a Windows Server 2012 operating system, specify Startup memory, Minimum memory, and Maximum memoryparameters in multiples of 128 megabytes (MB). Failure to do so can lead to hot-add failures, and you may not see any memory increase in a guest operating system.
 

Reading@Work

New Member
Jul 31, 2014
3
0
1
45
For Ubuntu 14.04 it seems like it's already well integrated:

Ubuntu virtual machines on Hyper-V
Applies To: Hyper-V Server 2012, Hyper-V Server 2012 R2, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2​
Ubuntu virtual machines on Hyper-V
  1. Dynamic memory support is only available on 64-bit virtual machines.

  2. Dynamic Memory operations can fail if the guest operating system is running too low on memory. The following are some best practices:
    • Startup memory and minimal memory should be equal to or greater than the amount of memory that the distribution vendor recommends.
    • Applications that tend to consume the entire available memory on a system are limited to consuming up to 80 percent of available RAM.
  3. If you are using Dynamic Memory on Windows Server 2012 operating systems, specify Startup memory, Minimum memory, and Maximum memoryparameters in multiples of 128 megabytes (MB). Failure to do so can lead to Hot-Add failures, and you might not see any memory increase on a guest operating system.

As additional benefit with Ubuntu 14.04 LTS, you cna run it as a Generation 2 Virtual Machine.

Benjamin Armstong has an MSDN article that briefly discusses the setup and configuration:
Ubuntu 14.04 in a Generation 2 VM
Ubuntu 14.04 in a Generation 2 VM - Ben Armstrong - Site Home - MSDN Blogs
He mentions that Dynamic Memory was active during the setup process.​