+ @classmethod
+ def _GetCgroupMemoryLimit(cls, instance_name):
+ """Return the memory limit for an instance
+
+ """
+ cgroup = cls._GetCgroupMountPoint()
+ try:
+ memory = int(utils.ReadFile(utils.PathJoin(cgroup, 'lxc',
+ instance_name,
+ "memory.limit_in_bytes")))
+ except EnvironmentError:
+ # memory resource controller may be disabled, ignore
+ memory = 0
+
+ return memory
+
+ def ListInstances(self, hvparams=None):