Revision 60af751d lib/hypervisor/hv_fake.py
b/lib/hypervisor/hv_fake.py | ||
---|---|---|
259 | 259 |
logging.debug("Fake hypervisor migrating %s to %s (live=%s)", |
260 | 260 |
instance, target, live) |
261 | 261 |
|
262 |
self._MarkDown(instance.name) |
|
263 |
|
|
264 |
def FinalizeMigration(self, instance, info, success): |
|
265 |
"""Finalize an instance migration. |
|
262 |
def FinalizeMigrationDst(self, instance, info, success): |
|
263 |
"""Finalize the instance migration on the target node. |
|
266 | 264 |
|
267 | 265 |
For the fake hv, this just marks the instance up. |
268 | 266 |
|
269 | 267 |
@type instance: L{objects.Instance} |
270 | 268 |
@param instance: instance whose migration is being finalized |
269 |
@type info: string/data (opaque) |
|
270 |
@param info: migration information, from the source node |
|
271 |
@type success: boolean |
|
272 |
@param success: whether the migration was a success or a failure |
|
271 | 273 |
|
272 | 274 |
""" |
273 | 275 |
if success: |
... | ... | |
275 | 277 |
else: |
276 | 278 |
# ensure it's down |
277 | 279 |
self._MarkDown(instance.name) |
280 |
|
|
281 |
def PostMigrationCleanup(self, instance): |
|
282 |
"""Clean-up after a migration. |
|
283 |
|
|
284 |
To be executed on the source node. |
|
285 |
|
|
286 |
@type instance: L{objects.Instance} |
|
287 |
@param instance: the instance that was migrated |
|
288 |
|
|
289 |
""" |
|
290 |
pass |
|
291 |
|
|
292 |
def FinalizeMigrationSource(self, instance, success, live): |
|
293 |
"""Finalize the instance migration on the source node. |
|
294 |
|
|
295 |
@type instance: L{objects.Instance} |
|
296 |
@param instance: the instance that was migrated |
|
297 |
@type success: bool |
|
298 |
@param success: whether the migration succeeded or not |
|
299 |
@type live: bool |
|
300 |
@param live: whether the user requested a live migration or not |
|
301 |
|
|
302 |
""" |
|
303 |
# pylint: disable=W0613 |
|
304 |
if success: |
|
305 |
self._MarkDown(instance.name) |
|
306 |
|
|
307 |
def GetMigrationStatus(self, instance): |
|
308 |
"""Get the migration status |
|
309 |
|
|
310 |
The fake hypervisor migration always succeeds. |
|
311 |
|
|
312 |
@type instance: L{objects.Instance} |
|
313 |
@param instance: the instance that is being migrated |
|
314 |
@rtype: L{objects.MigrationStatus} |
|
315 |
@return: the status of the current migration (one of |
|
316 |
L{constants.HV_MIGRATION_VALID_STATUSES}), plus any additional |
|
317 |
progress info that can be retrieved from the hypervisor |
|
318 |
|
|
319 |
""" |
|
320 |
return objects.MigrationStatus(status=constants.HV_MIGRATION_COMPLETED) |
Also available in: Unified diff