Revision 848cdc34

b/lib/cli.py
95 95
  "GLOBAL_FILEDIR_OPT",
96 96
  "HID_OS_OPT",
97 97
  "GLOBAL_SHARED_FILEDIR_OPT",
98
  "HOTPLUG_OPT",
98 99
  "HVLIST_OPT",
99 100
  "HVOPTS_OPT",
100 101
  "HYPERVISOR_OPT",
......
1638 1639
                                 default=False, action="store_true",
1639 1640
                                 help="Include default values")
1640 1641

  
1642
HOTPLUG_OPT = cli_option("--hotplug", dest="hotplug",
1643
                         action="store_true", default=False,
1644
                         help="Try to hotplug device")
1645

  
1641 1646
#: Options provided by all commands
1642 1647
COMMON_OPTS = [DEBUG_OPT, REASON_OPT]
1643 1648

  
b/lib/client/gnt_instance.py
1319 1319
                      allowed_values=[constants.VALUE_DEFAULT])
1320 1320

  
1321 1321
  nics = _ConvertNicDiskModifications(opts.nics)
1322
  for action, identifier, params in nics:
1323
    if action == constants.DDM_MODIFY and opts.hotplug:
1324
      usertext = ("You are about to hot-modify a NIC. This will be done"
1325
                  " by removing the exisiting and then adding a new one."
1326
                  " Network connection might be lost. Continue?")
1327
    if not AskUser(usertext):
1328
      return 1
1329

  
1322 1330
  disks = _ParseDiskSizes(_ConvertNicDiskModifications(opts.disks))
1323 1331

  
1324 1332
  if (opts.disk_template and
......
1338 1346
  op = opcodes.OpInstanceSetParams(instance_name=args[0],
1339 1347
                                   nics=nics,
1340 1348
                                   disks=disks,
1349
                                   hotplug=opts.hotplug,
1341 1350
                                   disk_template=opts.disk_template,
1342 1351
                                   remote_node=opts.node,
1343 1352
                                   pnode=opts.new_primary_node,
......
1360 1369
    ToStdout("Modified instance %s", args[0])
1361 1370
    for param, data in result:
1362 1371
      ToStdout(" - %-5s -> %s", param, data)
1363
    ToStdout("Please don't forget that most parameters take effect"
1364
             " only at the next (re)start of the instance initiated by"
1365
             " ganeti; restarting from within the instance will"
1366
             " not be enough.")
1372
    if not opts.hotplug:
1373
      ToStdout("Please don't forget that most parameters take effect"
1374
               " only at the next (re)start of the instance initiated by"
1375
               " ganeti; restarting from within the instance will"
1376
               " not be enough.")
1367 1377
  return 0
1368 1378

  
1369 1379

  
......
1545 1555
    [DISK_TEMPLATE_OPT, SINGLE_NODE_OPT, OS_OPT, FORCE_VARIANT_OPT,
1546 1556
     OSPARAMS_OPT, DRY_RUN_OPT, PRIORITY_OPT, NWSYNC_OPT, OFFLINE_INST_OPT,
1547 1557
     ONLINE_INST_OPT, IGNORE_IPOLICY_OPT, RUNTIME_MEM_OPT,
1548
     NOCONFLICTSCHECK_OPT, NEW_PRIMARY_OPT],
1558
     NOCONFLICTSCHECK_OPT, NEW_PRIMARY_OPT, HOTPLUG_OPT],
1549 1559
    "<instance>", "Alters the parameters of an instance"),
1550 1560
  "shutdown": (
1551 1561
    GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()],
b/lib/opcodes.py
1374 1374
    ("src_path", None, ht.TMaybeString, "Source directory for import"),
1375 1375
    ("start", True, ht.TBool, "Whether to start instance after creation"),
1376 1376
    ("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Instance tags"),
1377
    ("hotplug", None, ht.TMaybeBool, "Whether to hotplug devices"),
1377 1378
    ]
1378 1379
  OP_RESULT = ht.Comment("instance nodes")(ht.TListOf(ht.TNonEmptyString))
1379 1380

  
......
1767 1768
     "Whether to wait for the disk to synchronize, when changing template"),
1768 1769
    ("offline", None, ht.TMaybeBool, "Whether to mark instance as offline"),
1769 1770
    ("conflicts_check", True, ht.TBool, "Check for conflicting IPs"),
1771
    ("hotplug", None, ht.TMaybeBool, "Whether to hotplug devices"),
1770 1772
    ]
1771 1773
  OP_RESULT = _TSetParamsResult
1772 1774

  
b/tools/cfgupgrade
189 189
          print("NIC with network name %s found."
190 190
                " Substituting with uuid %s." % (name, uuid))
191 191
          nic["network"] = uuid
192
      try:
193
        del nic["idx"]
194
        print("Deleting deprecated idx")
195
      except KeyError:
196
        pass
192 197

  
193 198
    if "disks" not in iobj:
194 199
      raise Error("Instance '%s' doesn't have a disks entry?!" % instance)
......
203 208
        dobj["iv_name"] = expected
204 209
      if not "spindles" in dobj:
205 210
        missing_spindles = True
211
      try:
212
        del dobj["idx"]
213
        print("Deleting deprecated idx")
214
      except KeyError:
215
        pass
216

  
217
    for attr in ("dev_idxs", "hotplug_info", "hotplugs", "pci_reservations"):
218
      try:
219
        del iobj[attr]
220
        print("Deleting deprecated %s" % attr)
221
      except KeyError:
222
        pass
206 223

  
207 224
  if GetExclusiveStorageValue(config_data) and missing_spindles:
208 225
    # We cannot be sure that the instances that are missing spindles have

Also available in: Unified diff