Skip to content
Snippets Groups Projects
Commit 0628a50a authored by Iustin Pop's avatar Iustin Pop
Browse files

Make LXC fail verification if cgroup is not mounted


Since LXC now relies on cgroup memory limits to enforce memory, let's
make hypervisor verification (and thus cluster-verify) return errors
when the cgroup filesystem is not mounted.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 53fde1ac
No related branches found
No related tags found
No related merge requests found
# #
# #
# Copyright (C) 2010 Google Inc. # Copyright (C) 2010, 2013 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -425,10 +425,18 @@ class LXCHypervisor(hv_base.BaseHypervisor): ...@@ -425,10 +425,18 @@ class LXCHypervisor(hv_base.BaseHypervisor):
@return: Problem description if something is wrong, C{None} otherwise @return: Problem description if something is wrong, C{None} otherwise
""" """
if os.path.exists(self._ROOT_DIR): msgs = []
return None
else: if not os.path.exists(self._ROOT_DIR):
return "The required directory '%s' does not exist" % self._ROOT_DIR msgs.append("The required directory '%s' does not exist" %
self._ROOT_DIR)
try:
self._GetCgroupMountPoint()
except errors.HypervisorError, err:
msgs.append(str(err))
return self._FormatVerifyResults(msgs)
@classmethod @classmethod
def PowercycleNode(cls): def PowercycleNode(cls):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment