Revision 6613661a
b/lib/backend.py | ||
---|---|---|
2964 | 2964 |
(prefix, utils.TimestampForFilename()))) |
2965 | 2965 |
|
2966 | 2966 |
|
2967 |
def StartImportExportDaemon(mode, opts, host, port, instance, ieio, ieioargs): |
|
2967 |
def StartImportExportDaemon(mode, opts, host, port, instance, component, |
|
2968 |
ieio, ieioargs): |
|
2968 | 2969 |
"""Starts an import or export daemon. |
2969 | 2970 |
|
2970 | 2971 |
@param mode: Import/output mode |
... | ... | |
2976 | 2977 |
@param port: Remote port for export (None for import) |
2977 | 2978 |
@type instance: L{objects.Instance} |
2978 | 2979 |
@param instance: Instance object |
2980 |
@type component: string |
|
2981 |
@param component: which part of the instance is transferred now, |
|
2982 |
e.g. 'disk/0' |
|
2979 | 2983 |
@param ieio: Input/output type |
2980 | 2984 |
@param ieioargs: Input/output arguments |
2981 | 2985 |
|
... | ... | |
3015 | 3019 |
if not os.path.exists(i): |
3016 | 3020 |
_Fail("File '%s' does not exist" % i) |
3017 | 3021 |
|
3018 |
status_dir = _CreateImportExportStatusDir(prefix)
|
|
3022 |
status_dir = _CreateImportExportStatusDir("%s-%s" % (prefix, component))
|
|
3019 | 3023 |
try: |
3020 | 3024 |
status_file = utils.PathJoin(status_dir, _IES_STATUS_FILE) |
3021 | 3025 |
pid_file = utils.PathJoin(status_dir, _IES_PID_FILE) |
b/lib/masterd/instance.py | ||
---|---|---|
534 | 534 |
|
535 | 535 |
""" |
536 | 536 |
return self._lu.rpc.call_import_start(self.node_name, self._opts, |
537 |
self._instance, |
|
537 |
self._instance, self._component,
|
|
538 | 538 |
self._dest, self._dest_args) |
539 | 539 |
|
540 | 540 |
def CheckListening(self): |
... | ... | |
620 | 620 |
""" |
621 | 621 |
return self._lu.rpc.call_export_start(self.node_name, self._opts, |
622 | 622 |
self._dest_host, self._dest_port, |
623 |
self._instance, self._source,
|
|
624 |
self._source_args) |
|
623 |
self._instance, self._component,
|
|
624 |
self._source, self._source_args)
|
|
625 | 625 |
|
626 | 626 |
def CheckListening(self): |
627 | 627 |
"""Checks whether the daemon is listening. |
b/lib/rpc.py | ||
---|---|---|
1498 | 1498 |
return self._SingleNodeCall(node, "x509_cert_remove", [name]) |
1499 | 1499 |
|
1500 | 1500 |
@_RpcTimeout(_TMO_NORMAL) |
1501 |
def call_import_start(self, node, opts, instance, dest, dest_args): |
|
1501 |
def call_import_start(self, node, opts, instance, component, |
|
1502 |
dest, dest_args): |
|
1502 | 1503 |
"""Starts a listener for an import. |
1503 | 1504 |
|
1504 | 1505 |
This is a single-node call. |
... | ... | |
1507 | 1508 |
@param node: Node name |
1508 | 1509 |
@type instance: C{objects.Instance} |
1509 | 1510 |
@param instance: Instance object |
1511 |
@type component: string |
|
1512 |
@param component: which part of the instance is being imported |
|
1510 | 1513 |
|
1511 | 1514 |
""" |
1512 | 1515 |
return self._SingleNodeCall(node, "import_start", |
1513 | 1516 |
[opts.ToDict(), |
1514 |
self._InstDict(instance), dest, |
|
1517 |
self._InstDict(instance), component, dest,
|
|
1515 | 1518 |
_EncodeImportExportIO(dest, dest_args)]) |
1516 | 1519 |
|
1517 | 1520 |
@_RpcTimeout(_TMO_NORMAL) |
1518 | 1521 |
def call_export_start(self, node, opts, host, port, |
1519 |
instance, source, source_args): |
|
1522 |
instance, component, source, source_args):
|
|
1520 | 1523 |
"""Starts an export daemon. |
1521 | 1524 |
|
1522 | 1525 |
This is a single-node call. |
... | ... | |
1525 | 1528 |
@param node: Node name |
1526 | 1529 |
@type instance: C{objects.Instance} |
1527 | 1530 |
@param instance: Instance object |
1531 |
@type component: string |
|
1532 |
@param component: which part of the instance is being imported |
|
1528 | 1533 |
|
1529 | 1534 |
""" |
1530 | 1535 |
return self._SingleNodeCall(node, "export_start", |
1531 | 1536 |
[opts.ToDict(), host, port, |
1532 |
self._InstDict(instance), source, |
|
1537 |
self._InstDict(instance), |
|
1538 |
component, source, |
|
1533 | 1539 |
_EncodeImportExportIO(source, source_args)]) |
1534 | 1540 |
|
1535 | 1541 |
@_RpcTimeout(_TMO_FAST) |
b/lib/server/noded.py | ||
---|---|---|
919 | 919 |
"""Starts an import daemon. |
920 | 920 |
|
921 | 921 |
""" |
922 |
(opts_s, instance, dest, dest_args) = params |
|
922 |
(opts_s, instance, component, dest, dest_args) = params
|
|
923 | 923 |
|
924 | 924 |
opts = objects.ImportExportOptions.FromDict(opts_s) |
925 | 925 |
|
926 | 926 |
return backend.StartImportExportDaemon(constants.IEM_IMPORT, opts, |
927 | 927 |
None, None, |
928 | 928 |
objects.Instance.FromDict(instance), |
929 |
dest, |
|
929 |
component, dest,
|
|
930 | 930 |
_DecodeImportExportIO(dest, |
931 | 931 |
dest_args)) |
932 | 932 |
|
... | ... | |
935 | 935 |
"""Starts an export daemon. |
936 | 936 |
|
937 | 937 |
""" |
938 |
(opts_s, host, port, instance, source, source_args) = params |
|
938 |
(opts_s, host, port, instance, component, source, source_args) = params
|
|
939 | 939 |
|
940 | 940 |
opts = objects.ImportExportOptions.FromDict(opts_s) |
941 | 941 |
|
942 | 942 |
return backend.StartImportExportDaemon(constants.IEM_EXPORT, opts, |
943 | 943 |
host, port, |
944 | 944 |
objects.Instance.FromDict(instance), |
945 |
source, |
|
945 |
component, source,
|
|
946 | 946 |
_DecodeImportExportIO(source, |
947 | 947 |
source_args)) |
948 | 948 |
|
Also available in: Unified diff