Revision db5a8a2d
b/scripts/gnt-backup | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
136 | 136 |
SRC_DIR_OPT, |
137 | 137 |
SRC_NODE_OPT, |
138 | 138 |
SUBMIT_OPT, |
139 |
DRY_RUN_OPT, |
|
139 | 140 |
] |
140 | 141 |
|
141 | 142 |
|
... | ... | |
147 | 148 |
'export': ( |
148 | 149 |
ExportInstance, ARGS_ONE_INSTANCE, |
149 | 150 |
[FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT, |
150 |
REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT], |
|
151 |
REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT, DRY_RUN_OPT],
|
|
151 | 152 |
"-n <target_node> [opts...] <name>", |
152 | 153 |
"Exports an instance to an image"), |
153 | 154 |
'import': ( |
... | ... | |
155 | 156 |
"[...] -t disk-type -n node[:secondary-node] <name>", |
156 | 157 |
"Imports an instance from an exported image"), |
157 | 158 |
'remove': ( |
158 |
RemoveExport, [ArgUnknown(min=1, max=1)], [], |
|
159 |
RemoveExport, [ArgUnknown(min=1, max=1)], [DRY_RUN_OPT],
|
|
159 | 160 |
"<name>", "Remove exports of named instance from the filesystem."), |
160 | 161 |
} |
161 | 162 |
|
b/scripts/gnt-cluster | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
856 | 856 |
"", "Destroy cluster"), |
857 | 857 |
'rename': ( |
858 | 858 |
RenameCluster, [ArgHost(min=1, max=1)], |
859 |
[FORCE_OPT], |
|
859 |
[FORCE_OPT, DRY_RUN_OPT],
|
|
860 | 860 |
"<new_name>", |
861 | 861 |
"Renames the cluster"), |
862 | 862 |
'redist-conf': ( |
863 |
RedistributeConfig, ARGS_NONE, [SUBMIT_OPT], |
|
863 |
RedistributeConfig, ARGS_NONE, [SUBMIT_OPT, DRY_RUN_OPT],
|
|
864 | 864 |
"", "Forces a push of the configuration file and ssconf files" |
865 | 865 |
" to the nodes in the cluster"), |
866 | 866 |
'verify': ( |
867 | 867 |
VerifyCluster, ARGS_NONE, |
868 |
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT], |
|
868 |
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT, |
|
869 |
DRY_RUN_OPT], |
|
869 | 870 |
"", "Does a check on the cluster configuration"), |
870 | 871 |
'verify-disks': ( |
871 | 872 |
VerifyDisks, ARGS_NONE, [], |
872 | 873 |
"", "Does a check on the cluster disk status"), |
873 | 874 |
'repair-disk-sizes': ( |
874 |
RepairDiskSizes, ARGS_MANY_INSTANCES, [], |
|
875 |
RepairDiskSizes, ARGS_MANY_INSTANCES, [DRY_RUN_OPT],
|
|
875 | 876 |
"", "Updates mismatches in recorded disk sizes"), |
876 | 877 |
'master-failover': ( |
877 | 878 |
MasterFailover, ARGS_NONE, [NOVOTING_OPT], |
... | ... | |
923 | 924 |
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, |
924 | 925 |
NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT, |
925 | 926 |
UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT, |
926 |
NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT], |
|
927 |
NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT, |
|
928 |
DRY_RUN_OPT], |
|
927 | 929 |
"[opts...]", |
928 | 930 |
"Alters the parameters of the cluster"), |
929 | 931 |
"renew-crypto": ( |
b/scripts/gnt-debug | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
407 | 407 |
action="append", help="Select nodes to sleep on"), |
408 | 408 |
cli_option("-r", "--repeat", type="int", default="0", dest="repeat", |
409 | 409 |
help="Number of times to repeat the sleep"), |
410 |
DRY_RUN_OPT, |
|
410 | 411 |
], |
411 | 412 |
"[opts...] <duration>", "Executes a TestDelay OpCode"), |
412 | 413 |
'submit-job': ( |
... | ... | |
420 | 421 |
action="store_true", help="Show timing stats"), |
421 | 422 |
cli_option("--each", default=False, action="store_true", |
422 | 423 |
help="Submit each job separately"), |
424 |
DRY_RUN_OPT, |
|
423 | 425 |
], |
424 | 426 |
"<op_list_file...>", "Submits jobs built from json files" |
425 | 427 |
" containing a list of serialized opcodes"), |
... | ... | |
447 | 449 |
help="Select number of VCPUs for the instance"), |
448 | 450 |
cli_option("--tags", default=None, |
449 | 451 |
help="Comma separated list of tags"), |
452 |
DRY_RUN_OPT, |
|
450 | 453 |
], |
451 | 454 |
"{opts...} <instance>", "Executes a TestAllocator OpCode"), |
452 | 455 |
"test-jobqueue": ( |
b/scripts/gnt-instance | ||
---|---|---|
1402 | 1402 |
NO_INSTALL_OPT, |
1403 | 1403 |
OS_SIZE_OPT, |
1404 | 1404 |
SUBMIT_OPT, |
1405 |
DRY_RUN_OPT, |
|
1405 | 1406 |
] |
1406 | 1407 |
|
1407 | 1408 |
commands = { |
... | ... | |
1410 | 1411 |
"[...] -t disk-type -n node[:secondary-node] -o os-type <name>", |
1411 | 1412 |
"Creates and adds a new instance to the cluster"), |
1412 | 1413 |
'batch-create': ( |
1413 |
BatchCreate, [ArgFile(min=1, max=1)], [], |
|
1414 |
BatchCreate, [ArgFile(min=1, max=1)], [DRY_RUN_OPT],
|
|
1414 | 1415 |
"<instances.json>", |
1415 | 1416 |
"Create a bunch of instances based on specs in the file."), |
1416 | 1417 |
'console': ( |
... | ... | |
1419 | 1420 |
"[--show-cmd] <instance>", "Opens a console on the specified instance"), |
1420 | 1421 |
'failover': ( |
1421 | 1422 |
FailoverInstance, ARGS_ONE_INSTANCE, |
1422 |
[FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT, SHUTDOWN_TIMEOUT_OPT], |
|
1423 |
[FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT, SHUTDOWN_TIMEOUT_OPT, |
|
1424 |
DRY_RUN_OPT], |
|
1423 | 1425 |
"[-f] <instance>", "Stops the instance and starts it on the backup node," |
1424 | 1426 |
" using the remote mirror (only for instances of type drbd)"), |
1425 | 1427 |
'migrate': ( |
1426 | 1428 |
MigrateInstance, ARGS_ONE_INSTANCE, |
1427 |
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT], |
|
1429 |
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT, DRY_RUN_OPT],
|
|
1428 | 1430 |
"[-f] <instance>", "Migrate instance to its secondary node" |
1429 | 1431 |
" (only for instances of type drbd)"), |
1430 | 1432 |
'move': ( |
1431 | 1433 |
MoveInstance, ARGS_ONE_INSTANCE, |
1432 |
[FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT, SHUTDOWN_TIMEOUT_OPT], |
|
1434 |
[FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT, SHUTDOWN_TIMEOUT_OPT, |
|
1435 |
DRY_RUN_OPT], |
|
1433 | 1436 |
"[-f] <instance>", "Move instance to an arbitrary node" |
1434 | 1437 |
" (only for instances of type file and lv)"), |
1435 | 1438 |
'info': ( |
... | ... | |
1459 | 1462 |
[FORCE_OPT, OS_OPT, FORCE_VARIANT_OPT, m_force_multi, m_node_opt, |
1460 | 1463 |
m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, m_node_tags_opt, |
1461 | 1464 |
m_pri_node_tags_opt, m_sec_node_tags_opt, m_inst_tags_opt, SELECT_OS_OPT, |
1462 |
SUBMIT_OPT], |
|
1465 |
SUBMIT_OPT, DRY_RUN_OPT],
|
|
1463 | 1466 |
"[-f] <instance>", "Reinstall a stopped instance"), |
1464 | 1467 |
'remove': ( |
1465 | 1468 |
RemoveInstance, ARGS_ONE_INSTANCE, |
1466 |
[FORCE_OPT, SHUTDOWN_TIMEOUT_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], |
|
1469 |
[FORCE_OPT, SHUTDOWN_TIMEOUT_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT, |
|
1470 |
DRY_RUN_OPT], |
|
1467 | 1471 |
"[-f] <instance>", "Shuts down the instance and removes it"), |
1468 | 1472 |
'rename': ( |
1469 | 1473 |
RenameInstance, |
1470 | 1474 |
[ArgInstance(min=1, max=1), ArgHost(min=1, max=1)], |
1471 |
[NOIPCHECK_OPT, NONAMECHECK_OPT, SUBMIT_OPT], |
|
1475 |
[NOIPCHECK_OPT, NONAMECHECK_OPT, SUBMIT_OPT, DRY_RUN_OPT],
|
|
1472 | 1476 |
"<instance> <new_name>", "Rename the instance"), |
1473 | 1477 |
'replace-disks': ( |
1474 | 1478 |
ReplaceDisks, ARGS_ONE_INSTANCE, |
1475 | 1479 |
[AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT, |
1476 |
NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT], |
|
1480 |
NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT, |
|
1481 |
DRY_RUN_OPT], |
|
1477 | 1482 |
"[-s|-p|-n NODE|-I NAME] <instance>", |
1478 | 1483 |
"Replaces all disks for the instance"), |
1479 | 1484 |
'modify': ( |
1480 | 1485 |
SetInstanceParams, ARGS_ONE_INSTANCE, |
1481 | 1486 |
[BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT, |
1482 | 1487 |
DISK_TEMPLATE_OPT, SINGLE_NODE_OPT, OS_OPT, FORCE_VARIANT_OPT, |
1483 |
OSPARAMS_OPT], |
|
1488 |
OSPARAMS_OPT, DRY_RUN_OPT],
|
|
1484 | 1489 |
"<instance>", "Alters the parameters of an instance"), |
1485 | 1490 |
'shutdown': ( |
1486 | 1491 |
GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()], |
1487 | 1492 |
[m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, |
1488 | 1493 |
m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, |
1489 |
m_inst_tags_opt, m_inst_opt, m_force_multi, TIMEOUT_OPT, SUBMIT_OPT], |
|
1494 |
m_inst_tags_opt, m_inst_opt, m_force_multi, TIMEOUT_OPT, SUBMIT_OPT, |
|
1495 |
DRY_RUN_OPT], |
|
1490 | 1496 |
"<instance>", "Stops an instance"), |
1491 | 1497 |
'startup': ( |
1492 | 1498 |
GenericManyOps("startup", _StartupInstance), [ArgInstance()], |
1493 | 1499 |
[FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, |
1494 | 1500 |
m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, |
1495 | 1501 |
m_inst_tags_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, HVOPTS_OPT, |
1496 |
BACKEND_OPT], |
|
1502 |
BACKEND_OPT, DRY_RUN_OPT],
|
|
1497 | 1503 |
"<instance>", "Starts an instance"), |
1498 | 1504 |
'reboot': ( |
1499 | 1505 |
GenericManyOps("reboot", _RebootInstance), [ArgInstance()], |
1500 | 1506 |
[m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, m_node_opt, |
1501 | 1507 |
m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, |
1502 | 1508 |
m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, |
1503 |
m_inst_tags_opt, SHUTDOWN_TIMEOUT_OPT], |
|
1509 |
m_inst_tags_opt, SHUTDOWN_TIMEOUT_OPT, DRY_RUN_OPT],
|
|
1504 | 1510 |
"<instance>", "Reboots an instance"), |
1505 | 1511 |
'activate-disks': ( |
1506 |
ActivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1512 |
ActivateDisks, ARGS_ONE_INSTANCE, |
|
1513 |
[SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1507 | 1514 |
"<instance>", "Activate an instance's disks"), |
1508 | 1515 |
'deactivate-disks': ( |
1509 |
DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT], |
|
1516 |
DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DRY_RUN_OPT],
|
|
1510 | 1517 |
"<instance>", "Deactivate an instance's disks"), |
1511 | 1518 |
'recreate-disks': ( |
1512 |
RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT], |
|
1519 |
RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT, DRY_RUN_OPT],
|
|
1513 | 1520 |
"<instance>", "Recreate an instance's disks"), |
1514 | 1521 |
'grow-disk': ( |
1515 | 1522 |
GrowDisk, |
1516 | 1523 |
[ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), |
1517 | 1524 |
ArgUnknown(min=1, max=1)], |
1518 |
[SUBMIT_OPT, NWSYNC_OPT], |
|
1525 |
[SUBMIT_OPT, NWSYNC_OPT, DRY_RUN_OPT],
|
|
1519 | 1526 |
"<instance> <disk> <size>", "Grow an instance's disk"), |
1520 | 1527 |
'list-tags': ( |
1521 | 1528 |
ListTags, ARGS_ONE_INSTANCE, [], |
b/scripts/gnt-node | ||
---|---|---|
679 | 679 |
'modify': ( |
680 | 680 |
SetNodeParams, ARGS_ONE_NODE, |
681 | 681 |
[FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT, |
682 |
AUTO_PROMOTE_OPT], |
|
682 |
AUTO_PROMOTE_OPT, DRY_RUN_OPT],
|
|
683 | 683 |
"<node_name>", "Alters the parameters of a node"), |
684 | 684 |
'powercycle': ( |
685 | 685 |
PowercycleNode, ARGS_ONE_NODE, |
686 |
[FORCE_OPT, CONFIRM_OPT], |
|
686 |
[FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT],
|
|
687 | 687 |
"<node_name>", "Tries to forcefully powercycle a node"), |
688 | 688 |
'remove': ( |
689 |
RemoveNode, ARGS_ONE_NODE, [], |
|
689 |
RemoveNode, ARGS_ONE_NODE, [DRY_RUN_OPT],
|
|
690 | 690 |
"<node_name>", "Removes a node from the cluster"), |
691 | 691 |
'volumes': ( |
692 | 692 |
ListVolumes, [ArgNode()], |
... | ... | |
703 | 703 |
[ArgNode(min=1, max=1), |
704 | 704 |
ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES), |
705 | 705 |
ArgFile(min=1, max=1)], |
706 |
[ALLOCATABLE_OPT], |
|
706 |
[ALLOCATABLE_OPT, DRY_RUN_OPT],
|
|
707 | 707 |
"<node_name> <storage_type> <name>", "Modify storage volume on a node"), |
708 | 708 |
'repair-storage': ( |
709 | 709 |
RepairStorage, |
710 | 710 |
[ArgNode(min=1, max=1), |
711 | 711 |
ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES), |
712 | 712 |
ArgFile(min=1, max=1)], |
713 |
[IGNORE_CONSIST_OPT], |
|
713 |
[IGNORE_CONSIST_OPT, DRY_RUN_OPT],
|
|
714 | 714 |
"<node_name> <storage_type> <name>", |
715 | 715 |
"Repairs a storage volume on a node"), |
716 | 716 |
'list-tags': ( |
b/scripts/gnt-os | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
269 | 269 |
ShowOSInfo, [ArgOs()], [], "", "Show detailed information about " |
270 | 270 |
"operating systems"), |
271 | 271 |
'modify': ( |
272 |
ModifyOS, ARGS_ONE_OS, [HVLIST_OPT, OSPARAMS_OPT], "", |
|
272 |
ModifyOS, ARGS_ONE_OS, [HVLIST_OPT, OSPARAMS_OPT, DRY_RUN_OPT], "",
|
|
273 | 273 |
"Modify the OS parameters"), |
274 | 274 |
} |
275 | 275 |
|
Also available in: Unified diff