Revision e29e9550 scripts/gnt-instance

b/scripts/gnt-instance
1207 1207
  @return: the desired exit code
1208 1208

  
1209 1209
  """
1210
  if not (opts.nics or opts.disks or
1210
  if not (opts.nics or opts.disks or opts.disk_template or
1211 1211
          opts.hvparams or opts.beparams):
1212 1212
    ToStderr("Please give at least one of the parameters.")
1213 1213
    return 1
......
1247 1247
                                   errors.ECODE_INVAL)
1248 1248
      disk_dict['size'] = utils.ParseUnit(disk_dict['size'])
1249 1249

  
1250
  if (opts.disk_template and
1251
      opts.disk_template in constants.DTS_NET_MIRROR and
1252
      not opts.node):
1253
    ToStderr("Changing the disk template to a mirrored one requires"
1254
             " specifying a secondary node")
1255
    return 1
1256

  
1250 1257
  op = opcodes.OpSetInstanceParams(instance_name=args[0],
1251 1258
                                   nics=opts.nics,
1252 1259
                                   disks=opts.disks,
1260
                                   disk_template=opts.disk_template,
1261
                                   remote_node=opts.node,
1253 1262
                                   hvparams=opts.hvparams,
1254 1263
                                   beparams=opts.beparams,
1255 1264
                                   force=opts.force)
......
1261 1270
    ToStdout("Modified instance %s", args[0])
1262 1271
    for param, data in result:
1263 1272
      ToStdout(" - %-5s -> %s", param, data)
1264
    ToStdout("Please don't forget that these parameters take effect"
1273
    ToStdout("Please don't forget that most parameters take effect"
1265 1274
             " only at the next start of the instance.")
1266 1275
  return 0
1267 1276

  
......
1407 1416
    "Replaces all disks for the instance"),
1408 1417
  'modify': (
1409 1418
    SetInstanceParams, ARGS_ONE_INSTANCE,
1410
    [BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT],
1419
    [BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT,
1420
     DISK_TEMPLATE_OPT, SINGLE_NODE_OPT],
1411 1421
    "<instance>", "Alters the parameters of an instance"),
1412 1422
  'shutdown': (
1413 1423
    GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()],

Also available in: Unified diff