Revision 2a10865c
b/daemons/ganeti-noded | ||
---|---|---|
341 | 341 |
return backend.StartInstance(instance, extra_args) |
342 | 342 |
|
343 | 343 |
@staticmethod |
344 |
def perspective_instance_migrate(params): |
|
345 |
"""Migrates an instance. |
|
346 |
|
|
347 |
""" |
|
348 |
instance, target, live = params |
|
349 |
return backend.MigrateInstance(instance, target, live) |
|
350 |
|
|
351 |
@staticmethod |
|
344 | 352 |
def perspective_instance_reboot(params): |
345 | 353 |
"""Reboot an instance. |
346 | 354 |
|
b/lib/backend.py | ||
---|---|---|
672 | 672 |
return True |
673 | 673 |
|
674 | 674 |
|
675 |
def MigrateInstance(instance, target, live): |
|
676 |
"""Migrates an instance to another node. |
|
677 |
|
|
678 |
""" |
|
679 |
hyper = hypervisor.GetHypervisor() |
|
680 |
|
|
681 |
try: |
|
682 |
hyper.MigrateInstance(instance, target, live) |
|
683 |
except errors.HypervisorError, err: |
|
684 |
msg = "Failed to migrate instance: %s" % str(err) |
|
685 |
logger.Error(msg) |
|
686 |
return (False, msg) |
|
687 |
return (True, "Migration successfull") |
|
688 |
|
|
689 |
|
|
675 | 690 |
def CreateBlockDevice(disk, size, owner, on_primary, info): |
676 | 691 |
"""Creates a block device for an instance. |
677 | 692 |
|
b/lib/constants.py | ||
---|---|---|
24 | 24 |
from ganeti import _autoconf |
25 | 25 |
|
26 | 26 |
# various versions |
27 |
PROTOCOL_VERSION = 12
|
|
27 |
PROTOCOL_VERSION = 13
|
|
28 | 28 |
RELEASE_VERSION = _autoconf.PACKAGE_VERSION |
29 | 29 |
OS_API_VERSION = 5 |
30 | 30 |
EXPORT_VERSION = 0 |
b/lib/rpc.py | ||
---|---|---|
208 | 208 |
return c.getresult().get(node, False) |
209 | 209 |
|
210 | 210 |
|
211 |
def call_instance_migrate(node, instance, target, live): |
|
212 |
"""Migrate an instance. |
|
213 |
|
|
214 |
This is a single-node call. |
|
215 |
|
|
216 |
""" |
|
217 |
c = Client("instance_migrate", [instance.name, target, live]) |
|
218 |
c.connect(node) |
|
219 |
c.run() |
|
220 |
return c.getresult().get(node, False) |
|
221 |
|
|
222 |
|
|
211 | 223 |
def call_instance_reboot(node, instance, reboot_type, extra_args): |
212 | 224 |
"""Reboots an instance. |
213 | 225 |
|
Also available in: Unified diff