Commit 22096c14 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Add zeroing timeout params to opcode



This patch adds two parameters controlling the zeroing timeout - one
that is fixed and another that depends on the amount of data (size of
disks) to zero.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarJose A. Lopes <jabolopes@google.com>
parent 03d56d40
......@@ -4882,3 +4882,17 @@ debugModeConfidentialityWarning =
-- | The size of the file
statSize :: String
statSize = "size"
-- * Helper VM-related timeouts
-- | The default fixed timeout - needed to startup the helper VM
helperVmStartup :: Int
helperVmStartup = 5 * 60
-- | The zeroing timeout per MiB of disks to zero
--
-- Determined by estimating that a disk writes at a relatively slow speed of 1/5
-- of the max speed of current drives
zeroingTimeoutPerMib :: Double
zeroingTimeoutPerMib = 1.0 / (100.0 / 5.0)
......@@ -778,6 +778,8 @@ $(genOpCode "OpCode"
, pX509KeyName
, pX509DestCA
, pZeroFreeSpace
, pZeroingTimeoutFixed
, pZeroingTimeoutPerMiB
],
"instance_name")
, ("OpBackupRemove",
......
......@@ -220,6 +220,8 @@ module Ganeti.OpParams
, pX509KeyName
, pX509DestCA
, pZeroFreeSpace
, pZeroingTimeoutFixed
, pZeroingTimeoutPerMiB
, pTagSearchPattern
, pRestrictedCommand
, pReplaceDisksMode
......@@ -1491,6 +1493,18 @@ pZeroFreeSpace =
withDoc "Whether to zero the free space on the disks of the instance" $
defaultFalse "zero_free_space"
pZeroingTimeoutFixed :: Field
pZeroingTimeoutFixed =
withDoc "The fixed part of time to wait before declaring the zeroing\
\ operation to have failed" .
optionalField $ simpleField "zeroing_timeout_fixed" [t| Int |]
pZeroingTimeoutPerMiB :: Field
pZeroingTimeoutPerMiB =
withDoc "The variable part of time to wait before declaring the zeroing\
\ operation to have failed, dependent on total size of disks" .
optionalField $ simpleField "zeroing_timeout_per_mib" [t| Double |]
pTagsObject :: Field
pTagsObject =
withDoc "Tag kind" $
......
......@@ -401,7 +401,8 @@ instance Arbitrary OpCodes.OpCode where
OpCodes.OpBackupExport <$> genFQDN <*> return Nothing <*>
arbitrary <*> arbitrary <*> arbitrary <*> return Nothing <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
genMaybe (pure []) <*> genMaybe genNameNE <*> arbitrary
genMaybe (pure []) <*> genMaybe genNameNE <*> arbitrary <*>
arbitrary <*> arbitrary
"OP_BACKUP_REMOVE" ->
OpCodes.OpBackupRemove <$> genFQDN <*> return Nothing
"OP_TEST_ALLOCATOR" ->
......
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