Commit 4e6cfd11 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

gnt-cluster modify --shared-file-storage-dir



This patch introduces to 'gnt-cluster modify' the option
'--shared-file-storage-dir' to change the default directory
for instances using shared file storage at cluster runtime.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 2fe1e043
......@@ -1308,7 +1308,7 @@ GLOBAL_SHARED_FILEDIR_OPT = cli_option(
help="Specify the default directory (cluster-wide) for storing the"
" shared file-based disks [%s]" %
pathutils.DEFAULT_SHARED_FILE_STORAGE_DIR,
metavar="SHAREDDIR", default=pathutils.DEFAULT_SHARED_FILE_STORAGE_DIR)
metavar="SHAREDDIR", default=None)
NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest="modify_etc_hosts",
help="Don't modify %s" % pathutils.ETC_HOSTS,
......
......@@ -818,6 +818,11 @@ class LUClusterSetParams(LogicalUnit):
CheckFileStoragePathVsEnabledDiskTemplates(
self.LogWarning, self.op.file_storage_dir, enabled_disk_templates)
if self.op.shared_file_storage_dir is not None:
CheckSharedFileStoragePathVsEnabledDiskTemplates(
self.LogWarning, self.op.shared_file_storage_dir,
enabled_disk_templates)
if self.op.drbd_helper:
# checks given drbd helper on all nodes
helpers = self.rpc.call_drbd_helper(node_uuids)
......
......@@ -951,6 +951,8 @@ class OpClusterSetParams(OpCode):
"Whether the cluster can modify and keep in sync the /etc/hosts files"),
("file_storage_dir", None, ht.TMaybeString,
"Default directory for storing file-backed disks"),
("shared_file_storage_dir", None, ht.TMaybeString,
"Default directory for storing shared-file-backed disks"),
]
OP_RESULT = ht.TNone
......
......@@ -25,7 +25,6 @@
import logging
from ganeti import constants
from ganeti import pathutils
def GetDiskTemplatesOfStorageType(storage_type):
......
......@@ -186,6 +186,7 @@ $(genOpCode "OpCode"
, pEnabledDiskTemplates
, pModifyEtcHosts
, pGlobalFileStorageDir
, pGlobalSharedFileStorageDir
])
, ("OpClusterRedistConf", [])
, ("OpClusterActivateMasterIp", [])
......
......@@ -106,6 +106,7 @@ module Ganeti.OpParams
, pFileDriver
, pFileStorageDir
, pGlobalFileStorageDir
, pGlobalSharedFileStorageDir
, pVgName
, pEnabledHypervisors
, pHypervisor
......@@ -792,6 +793,10 @@ pFileStorageDir = optionalNEStringField "file_storage_dir"
pGlobalFileStorageDir :: Field
pGlobalFileStorageDir = optionalNEStringField "file_storage_dir"
-- | Global directory for storing shared-file-backed disks.
pGlobalSharedFileStorageDir :: Field
pGlobalSharedFileStorageDir = optionalNEStringField "shared_file_storage_dir"
-- | Volume group name.
pVgName :: Field
pVgName = optionalStringField "vg_name"
......
......@@ -164,6 +164,7 @@ instance Arbitrary OpCodes.OpCode where
emptyMUD <*> emptyMUD <*> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
genMaybe (genName >>= mkNonEmpty) <*>
genMaybe (genName >>= mkNonEmpty)
"OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf
"OP_CLUSTER_ACTIVATE_MASTER_IP" ->
......
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