+
+ @classmethod
+ def PowercycleNode(cls):
+ """Fake hypervisor powercycle, just a wrapper over Linux powercycle.
+
+ """
+ cls.LinuxPowercycle()
+
+ def AcceptInstance(self, instance, info, target):
+ """Prepare to accept an instance.
+
+ @type instance: L{objects.Instance}
+ @param instance: instance to be accepted
+ @type info: string
+ @param info: instance info, not used
+ @type target: string
+ @param target: target host (usually ip), on this node
+
+ """
+ if self._IsAlive(instance.name):
+ raise errors.HypervisorError("Can't accept instance, already running")
+
+ def MigrateInstance(self, instance, target, live):
+ """Migrate an instance.
+
+ @type instance: L{objects.Instance}
+ @param instance: the instance to be migrated
+ @type target: string
+ @param target: hostname (usually ip) of the target node
+ @type live: boolean
+ @param live: whether to do a live or non-live migration
+
+ """
+ logging.debug("Fake hypervisor migrating %s to %s (live=%s)",
+ instance, target, live)
+
+ self._MarkDown(instance.name)
+
+ def FinalizeMigration(self, instance, info, success):
+ """Finalize an instance migration.
+
+ For the fake hv, this just marks the instance up.
+
+ @type instance: L{objects.Instance}
+ @param instance: instance whose migration is being finalized
+
+ """
+ if success:
+ self._MarkUp(instance)
+ else:
+ # ensure it's down
+ self._MarkDown(instance.name)