Revision f9193417 tools/burnin

b/tools/burnin
131 131
                      help="Skip instance stop/start", action="store_false",
132 132
                      default=True)
133 133
    parser.add_option("-t", "--disk-template", dest="disk_template",
134
                      choices=("diskless", "plain", "remote_raid1", "drbd"),
135
                      default="remote_raid1",
136
                      help="Template type for network mirroring (remote_raid1"
137
                      " or drbd) [remote_raid1]")
134
                      choices=("diskless", "plain", "drbd"),
135
                      default="drbd",
136
                      help="Disk template (diskless, plain or drbd) [drbd]")
138 137
    parser.add_option("-n", "--nodes", dest="nodes", default="",
139 138
                      help="Comma separated list of nodes to perform"
140 139
                      " the burnin on (defaults to all nodes)")
......
143 142
    if len(args) < 1 or options.os is None:
144 143
      Usage()
145 144

  
146
    supported_disk_templates = (constants.DT_DISKLESS, constants.DT_PLAIN,
147
                                constants.DT_REMOTE_RAID1,
145
    supported_disk_templates = (constants.DT_DISKLESS,
146
                                constants.DT_PLAIN,
148 147
                                constants.DT_DRBD8)
149 148
    if options.disk_template not in supported_disk_templates:
150 149
      Log("Unknown disk template '%s'" % options.disk_template)
......
219 218
      self.ExecOp(op)
220 219
      self.to_rem.append(instance)
221 220

  
222
  def ReplaceDisks1R1(self):
223
    """Replace disks with the same secondary for rr1."""
224
    # replace all, both disks
225
    for instance in self.instances:
226
      op = opcodes.OpReplaceDisks(instance_name=instance,
227
                                  remote_node=None,
228
                                  mode=constants.REPLACE_DISK_ALL,
229
                                  disks=["sda", "sdb"])
230

  
231
      Log("- Replace disks for instance %s" % (instance))
232
      self.ExecOp(op)
233

  
234 221
  def ReplaceDisks1D8(self):
235 222
    """Replace disks on primary and secondary for drbd8."""
236 223
    for instance in self.instances:
......
243 230

  
244 231
  def ReplaceDisks2(self):
245 232
    """Replace secondary node."""
246
    if self.opts.disk_template == constants.DT_REMOTE_RAID1:
247
      mode = constants.REPLACE_DISK_ALL
248
    else:
249
      mode = constants.REPLACE_DISK_SEC
233
    mode = constants.REPLACE_DISK_SEC
250 234

  
251 235
    mytor = izip(islice(cycle(self.nodes), 2, None),
252 236
                 self.instances)
......
352 336
    try:
353 337
      self.CreateInstances()
354 338
      if opts.do_replace1 and opts.disk_template in constants.DTS_NET_MIRROR:
355
        if opts.disk_template == constants.DT_REMOTE_RAID1:
356
          self.ReplaceDisks1R1()
357
        elif opts.disk_template == constants.DT_DRBD8:
358
          self.ReplaceDisks1D8()
339
        self.ReplaceDisks1D8()
359 340
      if (opts.do_replace2 and len(self.nodes) > 2 and
360 341
          opts.disk_template in constants.DTS_NET_MIRROR) :
361 342
        self.ReplaceDisks2()

Also available in: Unified diff