Merge branch 'stable-2.9' into stable-2.10
[ganeti-local] / lib / hypervisor / hv_lxc.py
index 12d48ee..e3f3d1e 100644 (file)
@@ -163,11 +163,13 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     """
     return [iinfo[0] for iinfo in self.GetAllInstancesInfo()]
 
-  def GetInstanceInfo(self, instance_name):
+  def GetInstanceInfo(self, instance_name, hvparams=None):
     """Get instance properties.
 
     @type instance_name: string
     @param instance_name: the instance name
+    @type hvparams: dict of strings
+    @param hvparams: hvparams to be used with this instance
     @rtype: tuple of strings
     @return: (name, id, memory, vcpus, stat, times)
 
@@ -189,9 +191,11 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     memory = self._GetCgroupMemoryLimit(instance_name) / (1024 ** 2)
     return (instance_name, 0, memory, len(cpu_list), 0, 0)
 
-  def GetAllInstancesInfo(self):
+  def GetAllInstancesInfo(self, hvparams=None):
     """Get properties of all instances.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor parameter
     @return: [(name, id, memory, vcpus, stat, times),...]
 
     """
@@ -396,27 +400,19 @@ class LXCHypervisor(hv_base.BaseHypervisor):
   def GetNodeInfo(self, hvparams=None):
     """Return information about the node.
 
-    This is just a wrapper over the base GetLinuxNodeInfo method.
-
-    @type hvparams: dict of strings
-    @param hvparams: hypervisor parameters, not used in this class
-
-    @return: a dict with the following keys (values in MiB):
-          - memory_total: the total memory size on the node
-          - memory_free: the available memory on the node for instances
-          - memory_dom0: the memory used by the node itself, if available
+    See L{BaseHypervisor.GetLinuxNodeInfo}.
 
     """
     return self.GetLinuxNodeInfo()
 
   @classmethod
-  def GetInstanceConsole(cls, instance, hvparams, beparams):
+  def GetInstanceConsole(cls, instance, primary_node, hvparams, beparams):
     """Return a command for connecting to the console of an instance.
 
     """
     return objects.InstanceConsole(instance=instance.name,
                                    kind=constants.CONS_SSH,
-                                   host=instance.primary_node,
+                                   host=primary_node.name,
                                    user=constants.SSH_CONSOLE_USER,
                                    command=["lxc-console", "-n", instance.name])
 
@@ -445,15 +441,20 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     return self._FormatVerifyResults(msgs)
 
   @classmethod
-  def PowercycleNode(cls):
+  def PowercycleNode(cls, hvparams=None):
     """LXC powercycle, just a wrapper over Linux powercycle.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor params to be used on this node
+
     """
     cls.LinuxPowercycle()
 
-  def MigrateInstance(self, instance, target, live):
+  def MigrateInstance(self, cluster_name, instance, target, live):
     """Migrate an instance.
 
+    @type cluster_name: string
+    @param cluster_name: name of the cluster
     @type instance: L{objects.Instance}
     @param instance: the instance to be migrated
     @type target: string