Statistics
| Branch: | Tag: | Revision:

root / scripts / gnt-cluster @ 23683c26

History | View | Annotate | Download (19.8 kB)

1
#!/usr/bin/python
2
#
3

    
4
# Copyright (C) 2006, 2007 Google Inc.
5
#
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
# 02110-1301, USA.
20

    
21

    
22
# pylint: disable-msg=W0401,W0614
23
# W0401: Wildcard import ganeti.cli
24
# W0614: Unused import %s from wildcard import (since we need cli)
25

    
26
import sys
27
import os.path
28
import time
29

    
30
from ganeti.cli import *
31
from ganeti import opcodes
32
from ganeti import constants
33
from ganeti import errors
34
from ganeti import utils
35
from ganeti import bootstrap
36
from ganeti import ssh
37
from ganeti import objects
38

    
39

    
40
@UsesRPC
41
def InitCluster(opts, args):
42
  """Initialize the cluster.
43

    
44
  @param opts: the command line options selected by the user
45
  @type args: list
46
  @param args: should contain only one element, the desired
47
      cluster name
48
  @rtype: int
49
  @return: the desired exit code
50

    
51
  """
52
  if not opts.lvm_storage and opts.vg_name:
53
    ToStderr("Options --no-lvm-storage and --vg-name conflict.")
54
    return 1
55

    
56
  vg_name = opts.vg_name
57
  if opts.lvm_storage and not opts.vg_name:
58
    vg_name = constants.DEFAULT_VG
59

    
60
  hvlist = opts.enabled_hypervisors
61
  if hvlist is None:
62
    hvlist = constants.DEFAULT_ENABLED_HYPERVISOR
63
  hvlist = hvlist.split(",")
64

    
65
  hvparams = dict(opts.hvparams)
66
  beparams = opts.beparams
67
  nicparams = opts.nicparams
68

    
69
  # prepare beparams dict
70
  beparams = objects.FillDict(constants.BEC_DEFAULTS, beparams)
71
  utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES)
72

    
73
  # prepare nicparams dict
74
  nicparams = objects.FillDict(constants.NICC_DEFAULTS, nicparams)
75
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
76

    
77
  # prepare hvparams dict
78
  for hv in constants.HYPER_TYPES:
79
    if hv not in hvparams:
80
      hvparams[hv] = {}
81
    hvparams[hv] = objects.FillDict(constants.HVC_DEFAULTS[hv], hvparams[hv])
82
    utils.ForceDictType(hvparams[hv], constants.HVS_PARAMETER_TYPES)
83

    
84
  if opts.candidate_pool_size is None:
85
    opts.candidate_pool_size = constants.MASTER_POOL_SIZE_DEFAULT
86

    
87
  if opts.mac_prefix is None:
88
    opts.mac_prefix = constants.DEFAULT_MAC_PREFIX
89

    
90
  bootstrap.InitCluster(cluster_name=args[0],
91
                        secondary_ip=opts.secondary_ip,
92
                        vg_name=vg_name,
93
                        mac_prefix=opts.mac_prefix,
94
                        master_netdev=opts.master_netdev,
95
                        file_storage_dir=opts.file_storage_dir,
96
                        enabled_hypervisors=hvlist,
97
                        hvparams=hvparams,
98
                        beparams=beparams,
99
                        nicparams=nicparams,
100
                        candidate_pool_size=opts.candidate_pool_size,
101
                        modify_etc_hosts=opts.modify_etc_hosts,
102
                        )
103
  op = opcodes.OpPostInitCluster()
104
  SubmitOpCode(op)
105
  return 0
106

    
107

    
108
@UsesRPC
109
def DestroyCluster(opts, args):
110
  """Destroy the cluster.
111

    
112
  @param opts: the command line options selected by the user
113
  @type args: list
114
  @param args: should be an empty list
115
  @rtype: int
116
  @return: the desired exit code
117

    
118
  """
119
  if not opts.yes_do_it:
120
    ToStderr("Destroying a cluster is irreversible. If you really want"
121
             " destroy this cluster, supply the --yes-do-it option.")
122
    return 1
123

    
124
  op = opcodes.OpDestroyCluster()
125
  master = SubmitOpCode(op)
126
  # if we reached this, the opcode didn't fail; we can proceed to
127
  # shutdown all the daemons
128
  bootstrap.FinalizeClusterDestroy(master)
129
  return 0
130

    
131

    
132
def RenameCluster(opts, args):
133
  """Rename the cluster.
134

    
135
  @param opts: the command line options selected by the user
136
  @type args: list
137
  @param args: should contain only one element, the new cluster name
138
  @rtype: int
139
  @return: the desired exit code
140

    
141
  """
142
  name = args[0]
143
  if not opts.force:
144
    usertext = ("This will rename the cluster to '%s'. If you are connected"
145
                " over the network to the cluster name, the operation is very"
146
                " dangerous as the IP address will be removed from the node"
147
                " and the change may not go through. Continue?") % name
148
    if not AskUser(usertext):
149
      return 1
150

    
151
  op = opcodes.OpRenameCluster(name=name)
152
  SubmitOpCode(op)
153
  return 0
154

    
155

    
156
def RedistributeConfig(opts, args):
157
  """Forces push of the cluster configuration.
158

    
159
  @param opts: the command line options selected by the user
160
  @type args: list
161
  @param args: empty list
162
  @rtype: int
163
  @return: the desired exit code
164

    
165
  """
166
  op = opcodes.OpRedistributeConfig()
167
  SubmitOrSend(op, opts)
168
  return 0
169

    
170

    
171
def ShowClusterVersion(opts, args):
172
  """Write version of ganeti software to the standard output.
173

    
174
  @param opts: the command line options selected by the user
175
  @type args: list
176
  @param args: should be an empty list
177
  @rtype: int
178
  @return: the desired exit code
179

    
180
  """
181
  cl = GetClient()
182
  result = cl.QueryClusterInfo()
183
  ToStdout("Software version: %s", result["software_version"])
184
  ToStdout("Internode protocol: %s", result["protocol_version"])
185
  ToStdout("Configuration format: %s", result["config_version"])
186
  ToStdout("OS api version: %s", result["os_api_version"])
187
  ToStdout("Export interface: %s", result["export_version"])
188
  return 0
189

    
190

    
191
def ShowClusterMaster(opts, args):
192
  """Write name of master node to the standard output.
193

    
194
  @param opts: the command line options selected by the user
195
  @type args: list
196
  @param args: should be an empty list
197
  @rtype: int
198
  @return: the desired exit code
199

    
200
  """
201
  master = bootstrap.GetMaster()
202
  ToStdout(master)
203
  return 0
204

    
205
def _PrintGroupedParams(paramsdict):
206
  """Print Grouped parameters (be, nic, disk) by group.
207

    
208
  @type paramsdict: dict of dicts
209
  @param paramsdict: {group: {param: value, ...}, ...}
210

    
211
  """
212
  for gr_name, gr_dict in paramsdict.items():
213
    ToStdout("  - %s:", gr_name)
214
    for item, val in gr_dict.iteritems():
215
      ToStdout("      %s: %s", item, val)
216

    
217
def ShowClusterConfig(opts, args):
218
  """Shows cluster information.
219

    
220
  @param opts: the command line options selected by the user
221
  @type args: list
222
  @param args: should be an empty list
223
  @rtype: int
224
  @return: the desired exit code
225

    
226
  """
227
  cl = GetClient()
228
  result = cl.QueryClusterInfo()
229

    
230
  ToStdout("Cluster name: %s", result["name"])
231
  ToStdout("Cluster UUID: %s", result["uuid"])
232

    
233
  ToStdout("Creation time: %s", utils.FormatTime(result["ctime"]))
234
  ToStdout("Modification time: %s", utils.FormatTime(result["mtime"]))
235

    
236
  ToStdout("Master node: %s", result["master"])
237

    
238
  ToStdout("Architecture (this node): %s (%s)",
239
           result["architecture"][0], result["architecture"][1])
240

    
241
  if result["tags"]:
242
    tags = ", ".join(utils.NiceSort(result["tags"]))
243
  else:
244
    tags = "(none)"
245

    
246
  ToStdout("Tags: %s", tags)
247

    
248
  ToStdout("Default hypervisor: %s", result["default_hypervisor"])
249
  ToStdout("Enabled hypervisors: %s", ", ".join(result["enabled_hypervisors"]))
250

    
251
  ToStdout("Hypervisor parameters:")
252
  _PrintGroupedParams(result["hvparams"])
253

    
254
  ToStdout("Cluster parameters:")
255
  ToStdout("  - candidate pool size: %s", result["candidate_pool_size"])
256
  ToStdout("  - master netdev: %s", result["master_netdev"])
257
  ToStdout("  - lvm volume group: %s", result["volume_group_name"])
258
  ToStdout("  - file storage path: %s", result["file_storage_dir"])
259

    
260
  ToStdout("Default instance parameters:")
261
  _PrintGroupedParams(result["beparams"])
262

    
263
  ToStdout("Default nic parameters:")
264
  _PrintGroupedParams(result["nicparams"])
265

    
266
  return 0
267

    
268

    
269
def ClusterCopyFile(opts, args):
270
  """Copy a file from master to some nodes.
271

    
272
  @param opts: the command line options selected by the user
273
  @type args: list
274
  @param args: should contain only one element, the path of
275
      the file to be copied
276
  @rtype: int
277
  @return: the desired exit code
278

    
279
  """
280
  filename = args[0]
281
  if not os.path.exists(filename):
282
    raise errors.OpPrereqError("No such filename '%s'" % filename)
283

    
284
  cl = GetClient()
285

    
286
  myname = utils.HostInfo().name
287

    
288
  cluster_name = cl.QueryConfigValues(["cluster_name"])[0]
289

    
290
  results = GetOnlineNodes(nodes=opts.nodes, cl=cl)
291
  results = [name for name in results if name != myname]
292

    
293
  srun = ssh.SshRunner(cluster_name=cluster_name)
294
  for node in results:
295
    if not srun.CopyFileToNode(node, filename):
296
      ToStderr("Copy of file %s to node %s failed", filename, node)
297

    
298
  return 0
299

    
300

    
301
def RunClusterCommand(opts, args):
302
  """Run a command on some nodes.
303

    
304
  @param opts: the command line options selected by the user
305
  @type args: list
306
  @param args: should contain the command to be run and its arguments
307
  @rtype: int
308
  @return: the desired exit code
309

    
310
  """
311
  cl = GetClient()
312

    
313
  command = " ".join(args)
314

    
315
  nodes = GetOnlineNodes(nodes=opts.nodes, cl=cl)
316

    
317
  cluster_name, master_node = cl.QueryConfigValues(["cluster_name",
318
                                                    "master_node"])
319

    
320
  srun = ssh.SshRunner(cluster_name=cluster_name)
321

    
322
  # Make sure master node is at list end
323
  if master_node in nodes:
324
    nodes.remove(master_node)
325
    nodes.append(master_node)
326

    
327
  for name in nodes:
328
    result = srun.Run(name, "root", command)
329
    ToStdout("------------------------------------------------")
330
    ToStdout("node: %s", name)
331
    ToStdout("%s", result.output)
332
    ToStdout("return code = %s", result.exit_code)
333

    
334
  return 0
335

    
336

    
337
def VerifyCluster(opts, args):
338
  """Verify integrity of cluster, performing various test on nodes.
339

    
340
  @param opts: the command line options selected by the user
341
  @type args: list
342
  @param args: should be an empty list
343
  @rtype: int
344
  @return: the desired exit code
345

    
346
  """
347
  skip_checks = []
348
  if opts.skip_nplusone_mem:
349
    skip_checks.append(constants.VERIFY_NPLUSONE_MEM)
350
  op = opcodes.OpVerifyCluster(skip_checks=skip_checks,
351
                               verbose=opts.verbose,
352
                               error_codes=opts.error_codes,
353
                               debug_simulate_errors=opts.simulate_errors)
354
  if SubmitOpCode(op):
355
    return 0
356
  else:
357
    return 1
358

    
359

    
360
def VerifyDisks(opts, args):
361
  """Verify integrity of cluster disks.
362

    
363
  @param opts: the command line options selected by the user
364
  @type args: list
365
  @param args: should be an empty list
366
  @rtype: int
367
  @return: the desired exit code
368

    
369
  """
370
  op = opcodes.OpVerifyDisks()
371
  result = SubmitOpCode(op)
372
  if not isinstance(result, (list, tuple)) or len(result) != 3:
373
    raise errors.ProgrammerError("Unknown result type for OpVerifyDisks")
374

    
375
  bad_nodes, instances, missing = result
376

    
377
  retcode = constants.EXIT_SUCCESS
378

    
379
  if bad_nodes:
380
    for node, text in bad_nodes.items():
381
      ToStdout("Error gathering data on node %s: %s",
382
               node, utils.SafeEncode(text[-400:]))
383
      retcode |= 1
384
      ToStdout("You need to fix these nodes first before fixing instances")
385

    
386
  if instances:
387
    for iname in instances:
388
      if iname in missing:
389
        continue
390
      op = opcodes.OpActivateInstanceDisks(instance_name=iname)
391
      try:
392
        ToStdout("Activating disks for instance '%s'", iname)
393
        SubmitOpCode(op)
394
      except errors.GenericError, err:
395
        nret, msg = FormatError(err)
396
        retcode |= nret
397
        ToStderr("Error activating disks for instance %s: %s", iname, msg)
398

    
399
  if missing:
400
    for iname, ival in missing.iteritems():
401
      all_missing = utils.all(ival, lambda x: x[0] in bad_nodes)
402
      if all_missing:
403
        ToStdout("Instance %s cannot be verified as it lives on"
404
                 " broken nodes", iname)
405
      else:
406
        ToStdout("Instance %s has missing logical volumes:", iname)
407
        ival.sort()
408
        for node, vol in ival:
409
          if node in bad_nodes:
410
            ToStdout("\tbroken node %s /dev/xenvg/%s", node, vol)
411
          else:
412
            ToStdout("\t%s /dev/xenvg/%s", node, vol)
413
    ToStdout("You need to run replace_disks for all the above"
414
           " instances, if this message persist after fixing nodes.")
415
    retcode |= 1
416

    
417
  return retcode
418

    
419

    
420
def RepairDiskSizes(opts, args):
421
  """Verify sizes of cluster disks.
422

    
423
  @param opts: the command line options selected by the user
424
  @type args: list
425
  @param args: optional list of instances to restrict check to
426
  @rtype: int
427
  @return: the desired exit code
428

    
429
  """
430
  op = opcodes.OpRepairDiskSizes(instances=args)
431
  SubmitOpCode(op)
432

    
433

    
434
@UsesRPC
435
def MasterFailover(opts, args):
436
  """Failover the master node.
437

    
438
  This command, when run on a non-master node, will cause the current
439
  master to cease being master, and the non-master to become new
440
  master.
441

    
442
  @param opts: the command line options selected by the user
443
  @type args: list
444
  @param args: should be an empty list
445
  @rtype: int
446
  @return: the desired exit code
447

    
448
  """
449
  if opts.no_voting:
450
    usertext = ("This will perform the failover even if most other nodes"
451
                " are down, or if this node is outdated. This is dangerous"
452
                " as it can lead to a non-consistent cluster. Check the"
453
                " gnt-cluster(8) man page before proceeding. Continue?")
454
    if not AskUser(usertext):
455
      return 1
456

    
457
  return bootstrap.MasterFailover(no_voting=opts.no_voting)
458

    
459

    
460
def SearchTags(opts, args):
461
  """Searches the tags on all the cluster.
462

    
463
  @param opts: the command line options selected by the user
464
  @type args: list
465
  @param args: should contain only one element, the tag pattern
466
  @rtype: int
467
  @return: the desired exit code
468

    
469
  """
470
  op = opcodes.OpSearchTags(pattern=args[0])
471
  result = SubmitOpCode(op)
472
  if not result:
473
    return 1
474
  result = list(result)
475
  result.sort()
476
  for path, tag in result:
477
    ToStdout("%s %s", path, tag)
478

    
479

    
480
def SetClusterParams(opts, args):
481
  """Modify the cluster.
482

    
483
  @param opts: the command line options selected by the user
484
  @type args: list
485
  @param args: should be an empty list
486
  @rtype: int
487
  @return: the desired exit code
488

    
489
  """
490
  if not (not opts.lvm_storage or opts.vg_name or
491
          opts.enabled_hypervisors or opts.hvparams or
492
          opts.beparams or opts.nicparams or
493
          opts.candidate_pool_size is not None):
494
    ToStderr("Please give at least one of the parameters.")
495
    return 1
496

    
497
  vg_name = opts.vg_name
498
  if not opts.lvm_storage and opts.vg_name:
499
    ToStdout("Options --no-lvm-storage and --vg-name conflict.")
500
    return 1
501
  elif not opts.lvm_storage:
502
    vg_name = ''
503

    
504
  hvlist = opts.enabled_hypervisors
505
  if hvlist is not None:
506
    hvlist = hvlist.split(",")
507

    
508
  # a list of (name, dict) we can pass directly to dict() (or [])
509
  hvparams = dict(opts.hvparams)
510
  for hv, hv_params in hvparams.iteritems():
511
    utils.ForceDictType(hv_params, constants.HVS_PARAMETER_TYPES)
512

    
513
  beparams = opts.beparams
514
  utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES)
515

    
516
  nicparams = opts.nicparams
517
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
518

    
519
  op = opcodes.OpSetClusterParams(vg_name=vg_name,
520
                                  enabled_hypervisors=hvlist,
521
                                  hvparams=hvparams,
522
                                  beparams=beparams,
523
                                  nicparams=nicparams,
524
                                  candidate_pool_size=opts.candidate_pool_size)
525
  SubmitOpCode(op)
526
  return 0
527

    
528

    
529
def QueueOps(opts, args):
530
  """Queue operations.
531

    
532
  @param opts: the command line options selected by the user
533
  @type args: list
534
  @param args: should contain only one element, the subcommand
535
  @rtype: int
536
  @return: the desired exit code
537

    
538
  """
539
  command = args[0]
540
  client = GetClient()
541
  if command in ("drain", "undrain"):
542
    drain_flag = command == "drain"
543
    client.SetQueueDrainFlag(drain_flag)
544
  elif command == "info":
545
    result = client.QueryConfigValues(["drain_flag"])
546
    if result[0]:
547
      val = "set"
548
    else:
549
      val = "unset"
550
    ToStdout("The drain flag is %s" % val)
551
  else:
552
    raise errors.OpPrereqError("Command '%s' is not valid." % command)
553

    
554
  return 0
555

    
556

    
557
def _ShowWatcherPause(until):
558
  if until is None or until < time.time():
559
    ToStdout("The watcher is not paused.")
560
  else:
561
    ToStdout("The watcher is paused until %s.", time.ctime(until))
562

    
563

    
564
def WatcherOps(opts, args):
565
  """Watcher operations.
566

    
567
  @param opts: the command line options selected by the user
568
  @type args: list
569
  @param args: should contain only one element, the subcommand
570
  @rtype: int
571
  @return: the desired exit code
572

    
573
  """
574
  command = args[0]
575
  client = GetClient()
576

    
577
  if command == "continue":
578
    client.SetWatcherPause(None)
579
    ToStdout("The watcher is no longer paused.")
580

    
581
  elif command == "pause":
582
    if len(args) < 2:
583
      raise errors.OpPrereqError("Missing pause duration")
584

    
585
    result = client.SetWatcherPause(time.time() + ParseTimespec(args[1]))
586
    _ShowWatcherPause(result)
587

    
588
  elif command == "info":
589
    result = client.QueryConfigValues(["watcher_pause"])
590
    _ShowWatcherPause(result)
591

    
592
  else:
593
    raise errors.OpPrereqError("Command '%s' is not valid." % command)
594

    
595
  return 0
596

    
597

    
598
commands = {
599
  'init': (
600
    InitCluster, [ArgHost(min=1, max=1)],
601
    [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT,
602
     HVLIST_OPT, MAC_PREFIX_OPT, MASTER_NETDEV_OPT, NIC_PARAMS_OPT,
603
     NOLVM_STORAGE_OPT, NOMODIFY_ETCHOSTS_OPT, SECONDARY_IP_OPT, VG_NAME_OPT],
604
    "[opts...] <cluster_name>", "Initialises a new cluster configuration"),
605
  'destroy': (
606
    DestroyCluster, ARGS_NONE, [YES_DOIT_OPT],
607
    "", "Destroy cluster"),
608
  'rename': (
609
    RenameCluster, [ArgHost(min=1, max=1)],
610
    [FORCE_OPT],
611
    "<new_name>",
612
    "Renames the cluster"),
613
  'redist-conf': (
614
    RedistributeConfig, ARGS_NONE, [SUBMIT_OPT],
615
    "", "Forces a push of the configuration file and ssconf files"
616
    " to the nodes in the cluster"),
617
  'verify': (
618
    VerifyCluster, ARGS_NONE,
619
    [VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT],
620
    "", "Does a check on the cluster configuration"),
621
  'verify-disks': (
622
    VerifyDisks, ARGS_NONE, [],
623
    "", "Does a check on the cluster disk status"),
624
  'repair-disk-sizes': (
625
    RepairDiskSizes, ARGS_MANY_INSTANCES, [],
626
    "", "Updates mismatches in recorded disk sizes"),
627
  'masterfailover': (
628
    MasterFailover, ARGS_NONE, [NOVOTING_OPT],
629
    "", "Makes the current node the master"),
630
  'version': (
631
    ShowClusterVersion, ARGS_NONE, [],
632
    "", "Shows the cluster version"),
633
  'getmaster': (
634
    ShowClusterMaster, ARGS_NONE, [],
635
    "", "Shows the cluster master"),
636
  'copyfile': (
637
    ClusterCopyFile, [ArgFile(min=1, max=1)],
638
    [NODE_LIST_OPT],
639
    "[-n node...] <filename>", "Copies a file to all (or only some) nodes"),
640
  'command': (
641
    RunClusterCommand, [ArgCommand(min=1)],
642
    [NODE_LIST_OPT],
643
    "[-n node...] <command>", "Runs a command on all (or only some) nodes"),
644
  'info': (
645
    ShowClusterConfig, ARGS_NONE, [],
646
    "", "Show cluster configuration"),
647
  'list-tags': (
648
    ListTags, ARGS_NONE, [], "", "List the tags of the cluster"),
649
  'add-tags': (
650
    AddTags, [ArgUnknown()], [TAG_SRC_OPT],
651
    "tag...", "Add tags to the cluster"),
652
  'remove-tags': (
653
    RemoveTags, [ArgUnknown()], [TAG_SRC_OPT],
654
    "tag...", "Remove tags from the cluster"),
655
  'search-tags': (
656
    SearchTags, [ArgUnknown(min=1, max=1)],
657
    [], "", "Searches the tags on all objects on"
658
    " the cluster for a given pattern (regex)"),
659
  'queue': (
660
    QueueOps,
661
    [ArgChoice(min=1, max=1, choices=["drain", "undrain", "info"])],
662
    [], "drain|undrain|info", "Change queue properties"),
663
  'watcher': (
664
    WatcherOps,
665
    [ArgChoice(min=1, max=1, choices=["pause", "continue", "info"]),
666
     ArgSuggest(min=0, max=1, choices=["30m", "1h", "4h"])],
667
    [],
668
    "{pause <timespec>|continue|info}", "Change watcher properties"),
669
  'modify': (
670
    SetClusterParams, ARGS_NONE,
671
    [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
672
     NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT],
673
    "[opts...]",
674
    "Alters the parameters of the cluster"),
675
  }
676

    
677
if __name__ == '__main__':
678
  sys.exit(GenericMain(commands, override={"tag_type": constants.TAG_CLUSTER}))