Commit 88acff3f authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Add possibility to compress to OpInstanceCreate



OpInstanceCreate now supports the 'compress' option. It allows to enable
compression during instance imports.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 258de3fe
......@@ -1431,7 +1431,7 @@ class LUInstanceCreate(LogicalUnit):
disk_results = \
masterd.instance.RemoteImport(self, feedback_fn, iobj, self.pnode,
self.source_x509_ca,
self._cds, timeouts)
self._cds, self.op.compress, timeouts)
if not compat.all(disk_results):
# TODO: Should the instance still be started, even if some disks
# failed to import (valid for local imports, too)?
......
......@@ -1436,7 +1436,7 @@ class _RemoteImportCb(ImportExportCbBase):
def RemoteImport(lu, feedback_fn, instance, pnode, source_x509_ca,
cds, timeouts):
cds, compress, timeouts):
"""Imports an instance from another cluster.
@param lu: Logical unit instance
......@@ -1449,6 +1449,8 @@ def RemoteImport(lu, feedback_fn, instance, pnode, source_x509_ca,
@param source_x509_ca: Import source's X509 CA
@type cds: string
@param cds: Cluster domain secret
@type compress: string
@param compress: one of L{constants.IEC_ALL}
@type timeouts: L{ImportExportTimeouts}
@param timeouts: Timeouts for this import
......@@ -1487,7 +1489,9 @@ def RemoteImport(lu, feedback_fn, instance, pnode, source_x509_ca,
# Import daemon options
opts = objects.ImportExportOptions(key_name=x509_key_name,
ca_pem=source_ca_pem,
magic=magic, ipv6=ipv6)
magic=magic,
compress=compress,
ipv6=ipv6)
ieloop.Add(DiskImport(lu, instance.primary_node, opts, instance,
"disk%d" % idx,
......
......@@ -1251,7 +1251,7 @@ pMoveCompress =
pBackupCompress :: Field
pBackupCompress =
withDoc "Compression mode to use for moves during backups" .
withDoc "Compression mode to use for moves during backups/imports" .
defaultField [| None |] $
simpleField "compress" [t| ImportExportCompression |]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment