Revision f5410303
b/lib/cli.py | ||
---|---|---|
232 | 232 |
"YES_DOIT_OPT", |
233 | 233 |
"ZEROING_IMAGE_OPT", |
234 | 234 |
"ZERO_FREE_SPACE_OPT", |
235 |
"HELPER_STARTUP_TIMEOUT_OPT", |
|
236 |
"HELPER_SHUTDOWN_TIMEOUT_OPT", |
|
235 | 237 |
"ZEROING_TIMEOUT_FIXED_OPT", |
236 | 238 |
"ZEROING_TIMEOUT_PER_MIB_OPT", |
237 | 239 |
"DISK_STATE_OPT", |
... | ... | |
1766 | 1768 |
help="Whether to zero the free space on the disks of the " |
1767 | 1769 |
"instance prior to the export") |
1768 | 1770 |
|
1771 |
HELPER_STARTUP_TIMEOUT_OPT = \ |
|
1772 |
cli_option("--helper-startup-timeout", |
|
1773 |
dest="helper_startup_timeout", action="store", type="int", |
|
1774 |
help="Startup timeout for the helper VM") |
|
1775 |
|
|
1776 |
HELPER_SHUTDOWN_TIMEOUT_OPT = \ |
|
1777 |
cli_option("--helper-shutdown-timeout", |
|
1778 |
dest="helper_shutdown_timeout", action="store", type="int", |
|
1779 |
help="Shutdown timeout for the helper VM") |
|
1780 |
|
|
1769 | 1781 |
ZEROING_TIMEOUT_FIXED_OPT = \ |
1770 | 1782 |
cli_option("--zeroing-timeout-fixed", |
1771 | 1783 |
dest="zeroing_timeout_fixed", action="store", type="int", |
... | ... | |
2815 | 2827 |
osparams_private = opts.osparams_private or serializer.PrivateDict() |
2816 | 2828 |
osparams_secret = opts.osparams_secret or serializer.PrivateDict() |
2817 | 2829 |
|
2830 |
helper_startup_timeout = opts.helper_startup_timeout |
|
2831 |
helper_shutdown_timeout = opts.helper_shutdown_timeout |
|
2832 |
|
|
2818 | 2833 |
if mode == constants.INSTANCE_CREATE: |
2819 | 2834 |
start = opts.start |
2820 | 2835 |
os_type = opts.os |
... | ... | |
2870 | 2885 |
no_install=no_install, |
2871 | 2886 |
identify_defaults=identify_defaults, |
2872 | 2887 |
ignore_ipolicy=opts.ignore_ipolicy, |
2873 |
instance_communication=instance_communication) |
|
2888 |
instance_communication=instance_communication, |
|
2889 |
helper_startup_timeout=helper_startup_timeout, |
|
2890 |
helper_shutdown_timeout=helper_shutdown_timeout) |
|
2874 | 2891 |
|
2875 | 2892 |
SubmitOrSend(op, opts) |
2876 | 2893 |
return 0 |
b/lib/client/gnt_backup.py | ||
---|---|---|
140 | 140 |
SRC_NODE_OPT, |
141 | 141 |
COMPRESS_OPT, |
142 | 142 |
IGNORE_IPOLICY_OPT, |
143 |
HELPER_STARTUP_TIMEOUT_OPT, |
|
144 |
HELPER_SHUTDOWN_TIMEOUT_OPT, |
|
143 | 145 |
] |
144 | 146 |
|
145 | 147 |
|
b/lib/client/gnt_instance.py | ||
---|---|---|
1485 | 1485 |
NO_INSTALL_OPT, |
1486 | 1486 |
IGNORE_IPOLICY_OPT, |
1487 | 1487 |
INSTANCE_COMMUNICATION_OPT, |
1488 |
HELPER_STARTUP_TIMEOUT_OPT, |
|
1489 |
HELPER_SHUTDOWN_TIMEOUT_OPT, |
|
1488 | 1490 |
] |
1489 | 1491 |
|
1490 | 1492 |
commands = { |
b/lib/cmdlib/instance.py | ||
---|---|---|
438 | 438 |
constants.INIC_NETWORK: |
439 | 439 |
self.cfg.GetInstanceCommunicationNetwork()}) |
440 | 440 |
|
441 |
# timeouts for unsafe OS installs |
|
442 |
if self.op.helper_startup_timeout is None: |
|
443 |
self.op.helper_startup_timeout = constants.HELPER_VM_STARTUP |
|
444 |
|
|
445 |
if self.op.helper_shutdown_timeout is None: |
|
446 |
self.op.helper_shutdown_timeout = constants.HELPER_VM_SHUTDOWN |
|
447 |
|
|
441 | 448 |
# check nics' parameter names |
442 | 449 |
for nic in self.op.nics: |
443 | 450 |
utils.ForceDictType(nic, constants.INIC_PARAMS_TYPES) |
b/src/Ganeti/Constants.hs | ||
---|---|---|
4945 | 4945 |
|
4946 | 4946 |
-- * Helper VM-related timeouts |
4947 | 4947 |
|
4948 |
-- | The default fixed timeout - needed to startup the helper VM
|
|
4948 |
-- | The default fixed timeout needed to startup the helper VM.
|
|
4949 | 4949 |
helperVmStartup :: Int |
4950 | 4950 |
helperVmStartup = 5 * 60 |
4951 | 4951 |
|
4952 |
-- | The default fixed timeout needed until the helper VM is finally |
|
4953 |
-- shutdown, for example, after installing the OS. |
|
4954 |
helperVmShutdown :: Int |
|
4955 |
helperVmShutdown = 2 * 60 * 60 |
|
4956 |
|
|
4952 | 4957 |
-- | The zeroing timeout per MiB of disks to zero |
4953 | 4958 |
-- |
4954 |
-- Determined by estimating that a disk writes at a relatively slow speed of 1/5
|
|
4955 |
-- of the max speed of current drives
|
|
4959 |
-- Determined by estimating that a disk writes at a relatively slow |
|
4960 |
-- speed of 1/5 of the max speed of current drives.
|
|
4956 | 4961 |
zeroingTimeoutPerMib :: Double |
4957 | 4962 |
zeroingTimeoutPerMib = 1.0 / (100.0 / 5.0) |
b/src/Ganeti/OpCodes.hs | ||
---|---|---|
460 | 460 |
, pStartInstance |
461 | 461 |
, pInstTags |
462 | 462 |
, pInstanceCommunication |
463 |
, pHelperStartupTimeout |
|
464 |
, pHelperShutdownTimeout |
|
463 | 465 |
], |
464 | 466 |
"instance_name") |
465 | 467 |
, ("OpInstanceMultiAlloc", |
b/src/Ganeti/OpParams.hs | ||
---|---|---|
222 | 222 |
, pX509KeyName |
223 | 223 |
, pX509DestCA |
224 | 224 |
, pZeroFreeSpace |
225 |
, pHelperStartupTimeout |
|
226 |
, pHelperShutdownTimeout |
|
225 | 227 |
, pZeroingTimeoutFixed |
226 | 228 |
, pZeroingTimeoutPerMiB |
227 | 229 |
, pTagSearchPattern |
... | ... | |
1506 | 1508 |
withDoc "Whether to zero the free space on the disks of the instance" $ |
1507 | 1509 |
defaultFalse "zero_free_space" |
1508 | 1510 |
|
1511 |
pHelperStartupTimeout :: Field |
|
1512 |
pHelperStartupTimeout = |
|
1513 |
withDoc "Startup timeout for the helper VM" . |
|
1514 |
optionalField $ simpleField "helper_startup_timeout" [t| Int |] |
|
1515 |
|
|
1516 |
pHelperShutdownTimeout :: Field |
|
1517 |
pHelperShutdownTimeout = |
|
1518 |
withDoc "Shutdown timeout for the helper VM" . |
|
1519 |
optionalField $ simpleField "helper_shutdown_timeout" [t| Int |] |
|
1520 |
|
|
1509 | 1521 |
pZeroingTimeoutFixed :: Field |
1510 | 1522 |
pZeroingTimeoutFixed = |
1511 | 1523 |
withDoc "The fixed part of time to wait before declaring the zeroing\ |
b/test/hs/Test/Ganeti/OpCodes.hs | ||
---|---|---|
298 | 298 |
<*> arbitrary -- start |
299 | 299 |
<*> (genTags >>= mapM mkNonEmpty) -- tags |
300 | 300 |
<*> arbitrary -- instance_communication |
301 |
<*> arbitrary -- helper_startup_timeout |
|
302 |
<*> arbitrary -- helper_shutdown_timeout |
|
301 | 303 |
"OP_INSTANCE_MULTI_ALLOC" -> |
302 | 304 |
OpCodes.OpInstanceMultiAlloc <$> arbitrary <*> genMaybe genNameNE <*> |
303 | 305 |
pure [] |
Also available in: Unified diff