Revision 064c21f8 scripts/gnt-instance
b/scripts/gnt-instance | ||
---|---|---|
1357 | 1357 |
|
1358 | 1358 |
# this is defined separately due to readability only |
1359 | 1359 |
add_opts = [ |
1360 |
DEBUG_OPT, |
|
1361 |
NODE_PLACEMENT_OPT, |
|
1362 |
OS_OPT, |
|
1363 | 1360 |
BACKEND_OPT, |
1364 |
DISK_TEMPLATE_OPT, |
|
1365 |
OS_SIZE_OPT, |
|
1366 | 1361 |
DISK_OPT, |
1367 |
NET_OPT, |
|
1368 |
NONICS_OPT, |
|
1369 |
NWSYNC_OPT, |
|
1370 |
NOSTART_OPT, |
|
1371 |
NOIPCHECK_OPT, |
|
1362 |
DISK_TEMPLATE_OPT, |
|
1372 | 1363 |
FILESTORE_DIR_OPT, |
1373 | 1364 |
FILESTORE_DRIVER_OPT, |
1374 |
IALLOCATOR_OPT, |
|
1375 | 1365 |
HYPERVISOR_OPT, |
1366 |
IALLOCATOR_OPT, |
|
1367 |
NET_OPT, |
|
1368 |
NODE_PLACEMENT_OPT, |
|
1369 |
NOIPCHECK_OPT, |
|
1370 |
NONICS_OPT, |
|
1371 |
NOSTART_OPT, |
|
1372 |
NWSYNC_OPT, |
|
1373 |
OS_OPT, |
|
1374 |
OS_SIZE_OPT, |
|
1376 | 1375 |
SUBMIT_OPT, |
1377 | 1376 |
] |
1378 | 1377 |
|
... | ... | |
1382 | 1381 |
"[...] -t disk-type -n node[:secondary-node] -o os-type <name>", |
1383 | 1382 |
"Creates and adds a new instance to the cluster"), |
1384 | 1383 |
'batch-create': ( |
1385 |
BatchCreate, [ArgFile(min=1, max=1)], |
|
1386 |
[DEBUG_OPT], |
|
1384 |
BatchCreate, [ArgFile(min=1, max=1)], [], |
|
1387 | 1385 |
"<instances.json>", |
1388 | 1386 |
"Create a bunch of instances based on specs in the file."), |
1389 | 1387 |
'console': ( |
1390 | 1388 |
ConnectToInstanceConsole, ARGS_ONE_INSTANCE, |
1391 |
[DEBUG_OPT, SHOWCMD_OPT],
|
|
1389 |
[SHOWCMD_OPT], |
|
1392 | 1390 |
"[--show-cmd] <instance>", "Opens a console on the specified instance"), |
1393 | 1391 |
'failover': ( |
1394 | 1392 |
FailoverInstance, ARGS_ONE_INSTANCE, |
1395 |
[DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT],
|
|
1393 |
[FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT], |
|
1396 | 1394 |
"[-f] <instance>", "Stops the instance and starts it on the backup node," |
1397 | 1395 |
" using the remote mirror (only for instances of type drbd)"), |
1398 | 1396 |
'migrate': ( |
1399 | 1397 |
MigrateInstance, ARGS_ONE_INSTANCE, |
1400 |
[DEBUG_OPT, FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT],
|
|
1398 |
[FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT], |
|
1401 | 1399 |
"[-f] <instance>", "Migrate instance to its secondary node" |
1402 | 1400 |
" (only for instances of type drbd)"), |
1403 | 1401 |
'move': ( |
1404 | 1402 |
MoveInstance, ARGS_ONE_INSTANCE, |
1405 |
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT],
|
|
1403 |
[FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT], |
|
1406 | 1404 |
"[-f] <instance>", "Move instance to an arbitrary node" |
1407 | 1405 |
" (only for instances of type file and lv)"), |
1408 | 1406 |
'info': ( |
1409 | 1407 |
ShowInstanceConfig, ARGS_MANY_INSTANCES, |
1410 |
[DEBUG_OPT, STATIC_OPT, ALL_OPT],
|
|
1408 |
[STATIC_OPT, ALL_OPT], |
|
1411 | 1409 |
"[-s] {--all | <instance>...}", |
1412 | 1410 |
"Show information on the specified instance(s)"), |
1413 | 1411 |
'list': ( |
1414 | 1412 |
ListInstances, ARGS_MANY_INSTANCES, |
1415 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
|
|
1413 |
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], |
|
1416 | 1414 |
"[<instance>...]", |
1417 | 1415 |
"Lists the instances and their status. The available fields are" |
1418 | 1416 |
" (see the man page for details): status, oper_state, oper_ram," |
... | ... | |
1424 | 1422 |
), |
1425 | 1423 |
'reinstall': ( |
1426 | 1424 |
ReinstallInstance, [ArgInstance(min=1)], |
1427 |
[DEBUG_OPT, FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt,
|
|
1425 |
[FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt, |
|
1428 | 1426 |
m_sec_node_opt, m_clust_opt, m_inst_opt, SELECT_OS_OPT, SUBMIT_OPT], |
1429 | 1427 |
"[-f] <instance>", "Reinstall a stopped instance"), |
1430 | 1428 |
'remove': ( |
1431 | 1429 |
RemoveInstance, ARGS_ONE_INSTANCE, |
1432 |
[DEBUG_OPT, FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT],
|
|
1430 |
[FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], |
|
1433 | 1431 |
"[-f] <instance>", "Shuts down the instance and removes it"), |
1434 | 1432 |
'rename': ( |
1435 | 1433 |
RenameInstance, |
1436 | 1434 |
[ArgInstance(min=1, max=1), ArgHost(min=1, max=1)], |
1437 |
[DEBUG_OPT, NOIPCHECK_OPT, SUBMIT_OPT],
|
|
1435 |
[NOIPCHECK_OPT, SUBMIT_OPT], |
|
1438 | 1436 |
"<instance> <new_name>", "Rename the instance"), |
1439 | 1437 |
'replace-disks': ( |
1440 | 1438 |
ReplaceDisks, ARGS_ONE_INSTANCE, |
1441 |
[DEBUG_OPT, AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT,
|
|
1439 |
[AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, |
|
1442 | 1440 |
NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT], |
1443 | 1441 |
"[-s|-p|-n NODE|-I NAME] <instance>", |
1444 | 1442 |
"Replaces all disks for the instance"), |
1445 | 1443 |
'modify': ( |
1446 | 1444 |
SetInstanceParams, ARGS_ONE_INSTANCE, |
1447 |
[BACKEND_OPT, DEBUG_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, |
|
1448 |
NET_OPT, SUBMIT_OPT], |
|
1445 |
[BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT], |
|
1449 | 1446 |
"<instance>", "Alters the parameters of an instance"), |
1450 | 1447 |
'shutdown': ( |
1451 | 1448 |
ShutdownInstance, [ArgInstance(min=1)], |
1452 |
[DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt,
|
|
1449 |
[m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, |
|
1453 | 1450 |
m_inst_opt, m_force_multi, SUBMIT_OPT], |
1454 | 1451 |
"<instance>", "Stops an instance"), |
1455 | 1452 |
'startup': ( |
1456 | 1453 |
StartupInstance, [ArgInstance(min=1)], |
1457 |
[DEBUG_OPT, FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt,
|
|
1454 |
[FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, |
|
1458 | 1455 |
m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, HVOPTS_OPT, |
1459 | 1456 |
BACKEND_OPT], |
1460 | 1457 |
"<instance>", "Starts an instance"), |
1461 | 1458 |
'reboot': ( |
1462 | 1459 |
RebootInstance, [ArgInstance(min=1)], |
1463 |
[DEBUG_OPT, m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, |
|
1464 |
m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, |
|
1465 |
SUBMIT_OPT], |
|
1460 |
[m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, m_node_opt, |
|
1461 |
m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT], |
|
1466 | 1462 |
"<instance>", "Reboots an instance"), |
1467 | 1463 |
'activate-disks': ( |
1468 |
ActivateDisks, ARGS_ONE_INSTANCE, |
|
1469 |
[DEBUG_OPT, SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1464 |
ActivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1470 | 1465 |
"<instance>", "Activate an instance's disks"), |
1471 | 1466 |
'deactivate-disks': ( |
1472 |
DeactivateDisks, ARGS_ONE_INSTANCE, |
|
1473 |
[DEBUG_OPT, SUBMIT_OPT], |
|
1467 |
DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT], |
|
1474 | 1468 |
"<instance>", "Deactivate an instance's disks"), |
1475 | 1469 |
'recreate-disks': ( |
1476 |
RecreateDisks, ARGS_ONE_INSTANCE, |
|
1477 |
[DEBUG_OPT, SUBMIT_OPT, DISKIDX_OPT], |
|
1470 |
RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT], |
|
1478 | 1471 |
"<instance>", "Recreate an instance's disks"), |
1479 | 1472 |
'grow-disk': ( |
1480 | 1473 |
GrowDisk, |
1481 | 1474 |
[ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), |
1482 | 1475 |
ArgUnknown(min=1, max=1)], |
1483 |
[DEBUG_OPT, SUBMIT_OPT, NWSYNC_OPT],
|
|
1476 |
[SUBMIT_OPT, NWSYNC_OPT], |
|
1484 | 1477 |
"<instance> <disk> <size>", "Grow an instance's disk"), |
1485 | 1478 |
'list-tags': ( |
1486 |
ListTags, ARGS_ONE_INSTANCE, [DEBUG_OPT],
|
|
1479 |
ListTags, ARGS_ONE_INSTANCE, [], |
|
1487 | 1480 |
"<instance_name>", "List the tags of the given instance"), |
1488 | 1481 |
'add-tags': ( |
1489 | 1482 |
AddTags, [ArgInstance(min=1, max=1), ArgUnknown()], |
1490 |
[DEBUG_OPT, TAG_SRC_OPT],
|
|
1483 |
[TAG_SRC_OPT], |
|
1491 | 1484 |
"<instance_name> tag...", "Add tags to the given instance"), |
1492 | 1485 |
'remove-tags': ( |
1493 | 1486 |
RemoveTags, [ArgInstance(min=1, max=1), ArgUnknown()], |
1494 |
[DEBUG_OPT, TAG_SRC_OPT],
|
|
1487 |
[TAG_SRC_OPT], |
|
1495 | 1488 |
"<instance_name> tag...", "Remove tags from given instance"), |
1496 | 1489 |
} |
1497 | 1490 |
|
Also available in: Unified diff