diff --git a/scripts/gnt-backup b/scripts/gnt-backup index ea0cad62fc75d1622635c3d5a6bb6b5e3c76c6cb..877933af3f0b4eb208014e7210be48a984baa7a8 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -1,7 +1,7 @@ #!/usr/bin/python # -# Copyright (C) 2006, 2007 Google Inc. +# Copyright (C) 2006, 2007, 2010 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -136,6 +136,7 @@ import_opts = [ SRC_DIR_OPT, SRC_NODE_OPT, SUBMIT_OPT, + DRY_RUN_OPT, ] @@ -147,7 +148,7 @@ commands = { 'export': ( ExportInstance, ARGS_ONE_INSTANCE, [FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT, - REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT], + REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT, DRY_RUN_OPT], "-n <target_node> [opts...] <name>", "Exports an instance to an image"), 'import': ( @@ -155,7 +156,7 @@ commands = { "[...] -t disk-type -n node[:secondary-node] <name>", "Imports an instance from an exported image"), 'remove': ( - RemoveExport, [ArgUnknown(min=1, max=1)], [], + RemoveExport, [ArgUnknown(min=1, max=1)], [DRY_RUN_OPT], "<name>", "Remove exports of named instance from the filesystem."), } diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index 66afdc7397bc0bef68917d9b98f5bc86cc423628..73161ba1159669f5043776fb94a7e8a31dcfaee2 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -1,7 +1,7 @@ #!/usr/bin/python # -# Copyright (C) 2006, 2007 Google Inc. +# Copyright (C) 2006, 2007, 2010 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -856,22 +856,23 @@ commands = { "", "Destroy cluster"), 'rename': ( RenameCluster, [ArgHost(min=1, max=1)], - [FORCE_OPT], + [FORCE_OPT, DRY_RUN_OPT], "<new_name>", "Renames the cluster"), 'redist-conf': ( - RedistributeConfig, ARGS_NONE, [SUBMIT_OPT], + RedistributeConfig, ARGS_NONE, [SUBMIT_OPT, DRY_RUN_OPT], "", "Forces a push of the configuration file and ssconf files" " to the nodes in the cluster"), 'verify': ( VerifyCluster, ARGS_NONE, - [VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT], + [VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT, + DRY_RUN_OPT], "", "Does a check on the cluster configuration"), 'verify-disks': ( VerifyDisks, ARGS_NONE, [], "", "Does a check on the cluster disk status"), 'repair-disk-sizes': ( - RepairDiskSizes, ARGS_MANY_INSTANCES, [], + RepairDiskSizes, ARGS_MANY_INSTANCES, [DRY_RUN_OPT], "", "Updates mismatches in recorded disk sizes"), 'master-failover': ( MasterFailover, ARGS_NONE, [NOVOTING_OPT], @@ -923,7 +924,8 @@ commands = { [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT, UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT, - NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT], + NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT, + DRY_RUN_OPT], "[opts...]", "Alters the parameters of the cluster"), "renew-crypto": ( diff --git a/scripts/gnt-debug b/scripts/gnt-debug index 944ccdc0f8bf19924037f48afaa7df9ada52c8cc..a860b3da019adb2cfe64163e7458f3a07adfd9d1 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -1,7 +1,7 @@ #!/usr/bin/python # -# Copyright (C) 2006, 2007 Google Inc. +# Copyright (C) 2006, 2007, 2010 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -407,6 +407,7 @@ commands = { action="append", help="Select nodes to sleep on"), cli_option("-r", "--repeat", type="int", default="0", dest="repeat", help="Number of times to repeat the sleep"), + DRY_RUN_OPT, ], "[opts...] <duration>", "Executes a TestDelay OpCode"), 'submit-job': ( @@ -420,6 +421,7 @@ commands = { action="store_true", help="Show timing stats"), cli_option("--each", default=False, action="store_true", help="Submit each job separately"), + DRY_RUN_OPT, ], "<op_list_file...>", "Submits jobs built from json files" " containing a list of serialized opcodes"), @@ -447,6 +449,7 @@ commands = { help="Select number of VCPUs for the instance"), cli_option("--tags", default=None, help="Comma separated list of tags"), + DRY_RUN_OPT, ], "{opts...} <instance>", "Executes a TestAllocator OpCode"), "test-jobqueue": ( diff --git a/scripts/gnt-instance b/scripts/gnt-instance index cd3dc209a7fe342d102dbc48b5c4056d04c76bff..e64ef9349f64282e8852e6775ec94b2060c07061 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1402,6 +1402,7 @@ add_opts = [ NO_INSTALL_OPT, OS_SIZE_OPT, SUBMIT_OPT, + DRY_RUN_OPT, ] commands = { @@ -1410,7 +1411,7 @@ commands = { "[...] -t disk-type -n node[:secondary-node] -o os-type <name>", "Creates and adds a new instance to the cluster"), 'batch-create': ( - BatchCreate, [ArgFile(min=1, max=1)], [], + BatchCreate, [ArgFile(min=1, max=1)], [DRY_RUN_OPT], "<instances.json>", "Create a bunch of instances based on specs in the file."), 'console': ( @@ -1419,17 +1420,19 @@ commands = { "[--show-cmd] <instance>", "Opens a console on the specified instance"), 'failover': ( FailoverInstance, ARGS_ONE_INSTANCE, - [FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT, SHUTDOWN_TIMEOUT_OPT], + [FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT, SHUTDOWN_TIMEOUT_OPT, + DRY_RUN_OPT], "[-f] <instance>", "Stops the instance and starts it on the backup node," " using the remote mirror (only for instances of type drbd)"), 'migrate': ( MigrateInstance, ARGS_ONE_INSTANCE, - [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT], + [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT, DRY_RUN_OPT], "[-f] <instance>", "Migrate instance to its secondary node" " (only for instances of type drbd)"), 'move': ( MoveInstance, ARGS_ONE_INSTANCE, - [FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT, SHUTDOWN_TIMEOUT_OPT], + [FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT, SHUTDOWN_TIMEOUT_OPT, + DRY_RUN_OPT], "[-f] <instance>", "Move instance to an arbitrary node" " (only for instances of type file and lv)"), 'info': ( @@ -1459,63 +1462,67 @@ commands = { [FORCE_OPT, OS_OPT, FORCE_VARIANT_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, m_inst_tags_opt, SELECT_OS_OPT, - SUBMIT_OPT], + SUBMIT_OPT, DRY_RUN_OPT], "[-f] <instance>", "Reinstall a stopped instance"), 'remove': ( RemoveInstance, ARGS_ONE_INSTANCE, - [FORCE_OPT, SHUTDOWN_TIMEOUT_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], + [FORCE_OPT, SHUTDOWN_TIMEOUT_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT, + DRY_RUN_OPT], "[-f] <instance>", "Shuts down the instance and removes it"), 'rename': ( RenameInstance, [ArgInstance(min=1, max=1), ArgHost(min=1, max=1)], - [NOIPCHECK_OPT, NONAMECHECK_OPT, SUBMIT_OPT], + [NOIPCHECK_OPT, NONAMECHECK_OPT, SUBMIT_OPT, DRY_RUN_OPT], "<instance> <new_name>", "Rename the instance"), 'replace-disks': ( ReplaceDisks, ARGS_ONE_INSTANCE, [AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT, - NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT], + NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT, + DRY_RUN_OPT], "[-s|-p|-n NODE|-I NAME] <instance>", "Replaces all disks for the instance"), 'modify': ( SetInstanceParams, ARGS_ONE_INSTANCE, [BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT, DISK_TEMPLATE_OPT, SINGLE_NODE_OPT, OS_OPT, FORCE_VARIANT_OPT, - OSPARAMS_OPT], + OSPARAMS_OPT, DRY_RUN_OPT], "<instance>", "Alters the parameters of an instance"), 'shutdown': ( GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()], [m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, - m_inst_tags_opt, m_inst_opt, m_force_multi, TIMEOUT_OPT, SUBMIT_OPT], + m_inst_tags_opt, m_inst_opt, m_force_multi, TIMEOUT_OPT, SUBMIT_OPT, + DRY_RUN_OPT], "<instance>", "Stops an instance"), 'startup': ( GenericManyOps("startup", _StartupInstance), [ArgInstance()], [FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, m_inst_tags_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, HVOPTS_OPT, - BACKEND_OPT], + BACKEND_OPT, DRY_RUN_OPT], "<instance>", "Starts an instance"), 'reboot': ( GenericManyOps("reboot", _RebootInstance), [ArgInstance()], [m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, m_node_tags_opt, m_pri_node_tags_opt, m_sec_node_tags_opt, - m_inst_tags_opt, SHUTDOWN_TIMEOUT_OPT], + m_inst_tags_opt, SHUTDOWN_TIMEOUT_OPT, DRY_RUN_OPT], "<instance>", "Reboots an instance"), 'activate-disks': ( - ActivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, IGNORE_SIZE_OPT], + ActivateDisks, ARGS_ONE_INSTANCE, + [SUBMIT_OPT, IGNORE_SIZE_OPT], "<instance>", "Activate an instance's disks"), 'deactivate-disks': ( - DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT], + DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DRY_RUN_OPT], "<instance>", "Deactivate an instance's disks"), 'recreate-disks': ( - RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT], + RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT, DRY_RUN_OPT], "<instance>", "Recreate an instance's disks"), 'grow-disk': ( GrowDisk, [ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), ArgUnknown(min=1, max=1)], - [SUBMIT_OPT, NWSYNC_OPT], + [SUBMIT_OPT, NWSYNC_OPT, DRY_RUN_OPT], "<instance> <disk> <size>", "Grow an instance's disk"), 'list-tags': ( ListTags, ARGS_ONE_INSTANCE, [], diff --git a/scripts/gnt-node b/scripts/gnt-node index f8048afab092244d90a36f9ebb617c27a26c64f9..1cb7f7d980e454fa3ddede7a390b2f5048458050 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -679,14 +679,14 @@ commands = { 'modify': ( SetNodeParams, ARGS_ONE_NODE, [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT, - AUTO_PROMOTE_OPT], + AUTO_PROMOTE_OPT, DRY_RUN_OPT], "<node_name>", "Alters the parameters of a node"), 'powercycle': ( PowercycleNode, ARGS_ONE_NODE, - [FORCE_OPT, CONFIRM_OPT], + [FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT], "<node_name>", "Tries to forcefully powercycle a node"), 'remove': ( - RemoveNode, ARGS_ONE_NODE, [], + RemoveNode, ARGS_ONE_NODE, [DRY_RUN_OPT], "<node_name>", "Removes a node from the cluster"), 'volumes': ( ListVolumes, [ArgNode()], @@ -703,14 +703,14 @@ commands = { [ArgNode(min=1, max=1), ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES), ArgFile(min=1, max=1)], - [ALLOCATABLE_OPT], + [ALLOCATABLE_OPT, DRY_RUN_OPT], "<node_name> <storage_type> <name>", "Modify storage volume on a node"), 'repair-storage': ( RepairStorage, [ArgNode(min=1, max=1), ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES), ArgFile(min=1, max=1)], - [IGNORE_CONSIST_OPT], + [IGNORE_CONSIST_OPT, DRY_RUN_OPT], "<node_name> <storage_type> <name>", "Repairs a storage volume on a node"), 'list-tags': ( diff --git a/scripts/gnt-os b/scripts/gnt-os index ff3e4cf622af7cc747b54a0897ee7659e2d8a242..d07d75ce849a5da974a6ca2d62b76f1837deb4eb 100755 --- a/scripts/gnt-os +++ b/scripts/gnt-os @@ -1,7 +1,7 @@ #!/usr/bin/python # -# Copyright (C) 2006, 2007 Google Inc. +# Copyright (C) 2006, 2007, 2010 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -269,7 +269,7 @@ commands = { ShowOSInfo, [ArgOs()], [], "", "Show detailed information about " "operating systems"), 'modify': ( - ModifyOS, ARGS_ONE_OS, [HVLIST_OPT, OSPARAMS_OPT], "", + ModifyOS, ARGS_ONE_OS, [HVLIST_OPT, OSPARAMS_OPT, DRY_RUN_OPT], "", "Modify the OS parameters"), }