Revision 40827683 lib/client/gnt_instance.py

b/lib/client/gnt_instance.py
1313 1313
                      allowed_values=[constants.VALUE_DEFAULT])
1314 1314

  
1315 1315
  nics = _ConvertNicDiskModifications(opts.nics)
1316
  for action, _, __ in nics:
1317
    if action == constants.DDM_MODIFY and opts.hotplug:
1318
      usertext = ("You are about to hot-modify a NIC. This will be done"
1319
                  " by removing the exisiting and then adding a new one."
1320
                  " Network connection might be lost. Continue?")
1321
      if not AskUser(usertext):
1322
        return 1
1323

  
1316 1324
  disks = _ParseDiskSizes(_ConvertNicDiskModifications(opts.disks))
1317 1325

  
1318 1326
  if (opts.disk_template and
......
1332 1340
  op = opcodes.OpInstanceSetParams(instance_name=args[0],
1333 1341
                                   nics=nics,
1334 1342
                                   disks=disks,
1343
                                   hotplug=opts.hotplug,
1335 1344
                                   disk_template=opts.disk_template,
1336 1345
                                   remote_node=opts.node,
1337 1346
                                   pnode=opts.new_primary_node,
......
1354 1363
    ToStdout("Modified instance %s", args[0])
1355 1364
    for param, data in result:
1356 1365
      ToStdout(" - %-5s -> %s", param, data)
1357
    ToStdout("Please don't forget that most parameters take effect"
1358
             " only at the next (re)start of the instance initiated by"
1359
             " ganeti; restarting from within the instance will"
1360
             " not be enough.")
1366
    if not opts.hotplug:
1367
      ToStdout("Please don't forget that most parameters take effect"
1368
               " only at the next (re)start of the instance initiated by"
1369
               " ganeti; restarting from within the instance will"
1370
               " not be enough.")
1361 1371
  return 0
1362 1372

  
1363 1373

  
......
1535 1545
     DISK_TEMPLATE_OPT, SINGLE_NODE_OPT, OS_OPT, FORCE_VARIANT_OPT,
1536 1546
     OSPARAMS_OPT, DRY_RUN_OPT, PRIORITY_OPT, NWSYNC_OPT, OFFLINE_INST_OPT,
1537 1547
     ONLINE_INST_OPT, IGNORE_IPOLICY_OPT, RUNTIME_MEM_OPT,
1538
     NOCONFLICTSCHECK_OPT, NEW_PRIMARY_OPT],
1548
     NOCONFLICTSCHECK_OPT, NEW_PRIMARY_OPT, HOTPLUG_OPT],
1539 1549
    "<instance>", "Alters the parameters of an instance"),
1540 1550
  "shutdown": (
1541 1551
    GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()],

Also available in: Unified diff