Add file backend storage options to ImportInstance
authorManuel Franceschini <manuel.franceschini@gmail.com>
Mon, 28 Apr 2008 15:24:20 +0000 (15:24 +0000)
committerManuel Franceschini <manuel.franceschini@gmail.com>
Mon, 28 Apr 2008 15:24:20 +0000 (15:24 +0000)
This patch adds the file storage options to gnt-backup import which
would otherwise fail since the values of file_storage_dir and
file_driver are accessed in LUCreateInstance.

Reviewed-by: ultrotter

scripts/gnt-backup

index 538b9ec..e11b438 100755 (executable)
@@ -100,6 +100,8 @@ def ImportInstance(opts, args):
                                 ip=opts.ip, bridge=opts.bridge, start=False,
                                 src_node=opts.src_node, src_path=opts.src_dir,
                                 wait_for_sync=opts.wait_for_sync, mac="auto",
+                                file_storage_dir=opts.file_storage_dir,
+                                file_driver=opts.file_driver,
                                 iallocator=opts.iallocator)
   SubmitOpCode(op)
   return 0
@@ -160,6 +162,12 @@ import_opts = [
   make_option("--iallocator", metavar="<NAME>",
               help="Select nodes for the instance automatically using the"
               " <NAME> iallocator plugin", default=None, type="string"),
+  make_option("--file-storage-dir", dest="file_storage_dir",
+              help="Relative path under default cluster-wide file storage dir"
+              " to store file-based disks", default=None,
+              metavar="<DIR>"),
+  make_option("--file-driver", dest="file_driver", help="Driver to use"
+              " for image files", default="loop", metavar="<DRIVER>"),
   ]
 
 commands = {