Revision b883637f
b/lib/cli.py | ||
---|---|---|
125 | 125 |
"OSPARAMS_OPT", |
126 | 126 |
"OS_OPT", |
127 | 127 |
"OS_SIZE_OPT", |
128 |
"PREALLOC_WIPE_DISKS_OPT", |
|
128 | 129 |
"PRIMARY_IP_VERSION_OPT", |
129 | 130 |
"PRIORITY_OPT", |
130 | 131 |
"RAPI_CERT_OPT", |
... | ... | |
1082 | 1083 |
type="bool", default=None, metavar=_YORNO, |
1083 | 1084 |
help="Sets the blacklisted flag on the OS") |
1084 | 1085 |
|
1086 |
PREALLOC_WIPE_DISKS_OPT = cli_option("--prealloc-wipe-disks", default=None, |
|
1087 |
type="bool", metavar=_YORNO, |
|
1088 |
dest="prealloc_wipe_disks", |
|
1089 |
help=("Wipe disks prior to instance" |
|
1090 |
" creation")) |
|
1091 |
|
|
1085 | 1092 |
|
1086 | 1093 |
#: Options provided by all commands |
1087 | 1094 |
COMMON_OPTS = [DEBUG_OPT] |
b/lib/cmdlib.py | ||
---|---|---|
2454 | 2454 |
("add_uids", None, ht.NoType), |
2455 | 2455 |
("remove_uids", None, ht.NoType), |
2456 | 2456 |
("maintain_node_health", None, ht.TMaybeBool), |
2457 |
("prealloc_wipe_disks", None, ht.TMaybeBool), |
|
2457 | 2458 |
("nicparams", None, ht.TOr(ht.TDict, ht.TNone)), |
2458 | 2459 |
("drbd_helper", None, ht.TOr(ht.TString, ht.TNone)), |
2459 | 2460 |
("default_iallocator", None, ht.TOr(ht.TString, ht.TNone)), |
... | ... | |
2726 | 2727 |
if self.op.maintain_node_health is not None: |
2727 | 2728 |
self.cluster.maintain_node_health = self.op.maintain_node_health |
2728 | 2729 |
|
2730 |
if self.op.prealloc_wipe_disks is not None: |
|
2731 |
self.cluster.prealloc_wipe_disks = self.op.prealloc_wipe_disks |
|
2732 |
|
|
2729 | 2733 |
if self.op.add_uids is not None: |
2730 | 2734 |
uidpool.AddToUidPool(self.cluster.uid_pool, self.op.add_uids) |
2731 | 2735 |
|
b/lib/opcodes.py | ||
---|---|---|
318 | 318 |
"reserved_lvs", |
319 | 319 |
"hidden_os", |
320 | 320 |
"blacklisted_os", |
321 |
"prealloc_wipe_disks", |
|
321 | 322 |
] |
322 | 323 |
|
323 | 324 |
|
b/man/gnt-cluster.sgml | ||
---|---|---|
258 | 258 |
<sbr> |
259 | 259 |
<arg>--primary-ip-version <replaceable>version</replaceable></arg> |
260 | 260 |
<sbr> |
261 |
<arg>--prealloc-wipe-disks</arg> |
|
261 |
<arg>--prealloc-wipe-disks <group choice="req"><arg>yes</arg><arg>no</arg></group></arg>
|
|
262 | 262 |
<sbr> |
263 | 263 |
<arg choice="req"><replaceable>clustername</replaceable></arg> |
264 | 264 |
</cmdsynopsis> |
... | ... | |
658 | 658 |
<sbr> |
659 | 659 |
<arg>--maintain-node-health <group choice="req"><arg>yes</arg><arg>no</arg></group></arg> |
660 | 660 |
<sbr> |
661 |
<arg choice="opt">--prealloc-wipe-disks <group choice="req"><arg>yes</arg><arg>no</arg></group></arg> |
|
662 |
<sbr> |
|
661 | 663 |
<arg choice="opt">-I <replaceable>default instance allocator</replaceable></arg> |
662 | 664 |
|
663 | 665 |
<sbr> |
... | ... | |
676 | 678 |
<option>--backend-parameters</option>, |
677 | 679 |
<option>--nic-parameters</option>, |
678 | 680 |
<option>--maintain-node-health</option>, |
681 |
<option>--prealloc-wipe-disks</option>, |
|
679 | 682 |
<option>--uid-pool</option> options are described in |
680 | 683 |
the <command>init</command> command. |
681 | 684 |
</para> |
b/scripts/gnt-cluster | ||
---|---|---|
42 | 42 |
from ganeti import uidpool |
43 | 43 |
from ganeti import compat |
44 | 44 |
|
45 |
PREALLOC_WIPE_DISKS_OPT = cli_option("--prealloc-wipe-disks", default=False, |
|
46 |
action="store_true", |
|
47 |
dest="prealloc_wipe_disks", |
|
48 |
help=("Wipe disks prior to instance" |
|
49 |
" creation")) |
|
50 | 45 |
|
51 | 46 |
@UsesRPC |
52 | 47 |
def InitCluster(opts, args): |
... | ... | |
110 | 105 |
if uid_pool is not None: |
111 | 106 |
uid_pool = uidpool.ParseUidPool(uid_pool) |
112 | 107 |
|
108 |
if opts.prealloc_wipe_disks is None: |
|
109 |
opts.prealloc_wipe_disks = False |
|
110 |
|
|
113 | 111 |
try: |
114 | 112 |
primary_ip_version = int(opts.primary_ip_version) |
115 | 113 |
except (ValueError, TypeError), err: |
... | ... | |
716 | 714 |
opts.add_uids is not None or |
717 | 715 |
opts.remove_uids is not None or |
718 | 716 |
opts.default_iallocator is not None or |
719 |
opts.reserved_lvs is not None): |
|
717 |
opts.reserved_lvs is not None or |
|
718 |
opts.prealloc_wipe_disks is not None): |
|
720 | 719 |
ToStderr("Please give at least one of the parameters.") |
721 | 720 |
return 1 |
722 | 721 |
|
... | ... | |
785 | 784 |
add_uids=add_uids, |
786 | 785 |
remove_uids=remove_uids, |
787 | 786 |
default_iallocator=opts.default_iallocator, |
787 |
prealloc_wipe_disks=opts.prealloc_wipe_disks, |
|
788 | 788 |
reserved_lvs=opts.reserved_lvs) |
789 | 789 |
SubmitOpCode(op, opts=opts) |
790 | 790 |
return 0 |
... | ... | |
945 | 945 |
NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT, |
946 | 946 |
UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT, |
947 | 947 |
NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT, |
948 |
DRY_RUN_OPT, PRIORITY_OPT], |
|
948 |
DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT],
|
|
949 | 949 |
"[opts...]", |
950 | 950 |
"Alters the parameters of the cluster"), |
951 | 951 |
"renew-crypto": ( |
Also available in: Unified diff