Revision 6a1e009c
b/lib/cli.py | ||
---|---|---|
94 | 94 |
"GLOBAL_FILEDIR_OPT", |
95 | 95 |
"HID_OS_OPT", |
96 | 96 |
"GLOBAL_SHARED_FILEDIR_OPT", |
97 |
"HOTPLUG_OPT", |
|
97 | 98 |
"HVLIST_OPT", |
98 | 99 |
"HVOPTS_OPT", |
99 | 100 |
"HYPERVISOR_OPT", |
... | ... | |
1545 | 1546 |
action="store_false", |
1546 | 1547 |
help="Don't check for conflicting IPs") |
1547 | 1548 |
|
1549 |
HOTPLUG_OPT = cli_option("--hotplug", dest="hotplug", |
|
1550 |
action="store_true", default=False, |
|
1551 |
help="Try to hotplug device") |
|
1552 |
|
|
1548 | 1553 |
#: Options provided by all commands |
1549 | 1554 |
COMMON_OPTS = [DEBUG_OPT] |
1550 | 1555 |
|
b/lib/client/gnt_instance.py | ||
---|---|---|
1326 | 1326 |
op = opcodes.OpInstanceSetParams(instance_name=args[0], |
1327 | 1327 |
nics=nics, |
1328 | 1328 |
disks=disks, |
1329 |
hotplug=opts.hotplug, |
|
1329 | 1330 |
disk_template=opts.disk_template, |
1330 | 1331 |
remote_node=opts.node, |
1331 | 1332 |
hvparams=opts.hvparams, |
... | ... | |
1347 | 1348 |
ToStdout("Modified instance %s", args[0]) |
1348 | 1349 |
for param, data in result: |
1349 | 1350 |
ToStdout(" - %-5s -> %s", param, data) |
1350 |
ToStdout("Please don't forget that most parameters take effect" |
|
1351 |
" only at the next (re)start of the instance initiated by" |
|
1352 |
" ganeti; restarting from within the instance will" |
|
1353 |
" not be enough.") |
|
1351 |
if not opts.hotplug: |
|
1352 |
ToStdout("Please don't forget that most parameters take effect" |
|
1353 |
" only at the next (re)start of the instance initiated by" |
|
1354 |
" ganeti; restarting from within the instance will" |
|
1355 |
" not be enough.") |
|
1354 | 1356 |
return 0 |
1355 | 1357 |
|
1356 | 1358 |
|
... | ... | |
1528 | 1530 |
DISK_TEMPLATE_OPT, SINGLE_NODE_OPT, OS_OPT, FORCE_VARIANT_OPT, |
1529 | 1531 |
OSPARAMS_OPT, DRY_RUN_OPT, PRIORITY_OPT, NWSYNC_OPT, OFFLINE_INST_OPT, |
1530 | 1532 |
ONLINE_INST_OPT, IGNORE_IPOLICY_OPT, RUNTIME_MEM_OPT, |
1531 |
NOCONFLICTSCHECK_OPT], |
|
1533 |
NOCONFLICTSCHECK_OPT, HOTPLUG_OPT],
|
|
1532 | 1534 |
"<instance>", "Alters the parameters of an instance"), |
1533 | 1535 |
"shutdown": ( |
1534 | 1536 |
GenericManyOps("shutdown", _ShutdownInstance), [ArgInstance()], |
b/lib/opcodes.py | ||
---|---|---|
1314 | 1314 |
("src_path", None, ht.TMaybeString, "Source directory for import"), |
1315 | 1315 |
("start", True, ht.TBool, "Whether to start instance after creation"), |
1316 | 1316 |
("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Instance tags"), |
1317 |
("hotplug", None, ht.TMaybeBool, "Whether to hotplug devices"), |
|
1317 | 1318 |
] |
1318 | 1319 |
OP_RESULT = ht.Comment("instance nodes")(ht.TListOf(ht.TNonEmptyString)) |
1319 | 1320 |
|
... | ... | |
1680 | 1681 |
"Whether to wait for the disk to synchronize, when changing template"), |
1681 | 1682 |
("offline", None, ht.TMaybeBool, "Whether to mark instance as offline"), |
1682 | 1683 |
("conflicts_check", True, ht.TBool, "Check for conflicting IPs"), |
1684 |
("hotplug", None, ht.TMaybeBool, "Whether to hotplug devices"), |
|
1683 | 1685 |
] |
1684 | 1686 |
OP_RESULT = _TSetParamsResult |
1685 | 1687 |
|
b/tools/cfgupgrade | ||
---|---|---|
111 | 111 |
group["networks"] = {} |
112 | 112 |
|
113 | 113 |
|
114 |
def UpgradeInstances(config_data): |
|
115 |
for instance in config_data["instances"].values(): |
|
116 |
hotplug_info = instance.get("hotplug_info", None) |
|
117 |
if hotplug_info: |
|
118 |
try: |
|
119 |
del hotplug_info["pci_pool"] |
|
120 |
except KeyError: |
|
121 |
pass |
|
122 |
|
|
123 |
|
|
114 | 124 |
def main(): |
115 | 125 |
"""Main program. |
116 | 126 |
|
... | ... | |
294 | 304 |
|
295 | 305 |
UpgradeNetworks(config_data) |
296 | 306 |
UpgradeGroups(config_data) |
307 |
UpgradeInstances(config_data) |
|
297 | 308 |
|
298 | 309 |
try: |
299 | 310 |
logging.info("Writing configuration file to %s", options.CONFIG_DATA_PATH) |
Also available in: Unified diff