Revision 1c3231aa lib/opcodes.py

b/lib/opcodes.py
69 69
#: a required node name (for single-node LUs)
70 70
_PNodeName = ("node_name", ht.NoDefault, ht.TNonEmptyString, "Node name")
71 71

  
72
#: a node UUID (for use with _PNodeName)
73
_PNodeUuid = ("node_uuid", None, ht.TMaybeString, "Node UUID")
74

  
72 75
#: a required node group name (for single-group LUs)
73 76
_PGroupName = ("group_name", ht.NoDefault, ht.TNonEmptyString, "Group name")
74 77

  
......
133 136
_PMigrationTargetNode = ("target_node", None, ht.TMaybeString,
134 137
                         "Target node for shared-storage instances")
135 138

  
139
_PMigrationTargetNodeUuid = ("target_node_uuid", None, ht.TMaybeString,
140
                             "Target node UUID for shared-storage instances")
141

  
136 142
_PStartupPaused = ("startup_paused", False, ht.TBool,
137 143
                   "Pause instance at startup")
138 144

  
......
1051 1057
  """Interact with OOB."""
1052 1058
  OP_PARAMS = [
1053 1059
    ("node_names", ht.EmptyList, ht.TListOf(ht.TNonEmptyString),
1054
     "List of nodes to run the OOB command against"),
1060
     "List of node names to run the OOB command against"),
1061
    ("node_uuids", None, ht.TMaybeListOf(ht.TNonEmptyString),
1062
     "List of node UUIDs to run the OOB command against"),
1055 1063
    ("command", ht.NoDefault, ht.TElemOf(constants.OOB_COMMANDS),
1056 1064
     "OOB command to be run"),
1057 1065
    ("timeout", constants.OOB_TIMEOUT, ht.TInt,
......
1073 1081
    _PUseLocking,
1074 1082
    ("nodes", ht.NoDefault, ht.TListOf(ht.TNonEmptyString),
1075 1083
     "Nodes on which the command should be run (at least one)"),
1084
    ("node_uuids", None, ht.TMaybeListOf(ht.TNonEmptyString),
1085
     "Node UUIDs on which the command should be run (at least one)"),
1076 1086
    ("command", ht.NoDefault, ht.TNonEmptyString,
1077 1087
     "Command name (no parameters)"),
1078 1088
    ]
......
1100 1110
  OP_DSC_FIELD = "node_name"
1101 1111
  OP_PARAMS = [
1102 1112
    _PNodeName,
1113
    _PNodeUuid
1103 1114
    ]
1104 1115
  OP_RESULT = ht.TNone
1105 1116

  
......
1187 1198
  OP_DSC_FIELD = "node_name"
1188 1199
  OP_PARAMS = [
1189 1200
    _PNodeName,
1201
    _PNodeUuid,
1190 1202
    _PStorageType,
1191 1203
    _PStorageName,
1192 1204
    ("changes", ht.NoDefault, ht.TDict, "Requested changes"),
......
1199 1211
  OP_DSC_FIELD = "node_name"
1200 1212
  OP_PARAMS = [
1201 1213
    _PNodeName,
1214
    _PNodeUuid,
1202 1215
    _PStorageType,
1203 1216
    _PStorageName,
1204 1217
    _PIgnoreConsistency,
......
1211 1224
  OP_DSC_FIELD = "node_name"
1212 1225
  OP_PARAMS = [
1213 1226
    _PNodeName,
1227
    _PNodeUuid,
1214 1228
    _PForce,
1215 1229
    _PHvState,
1216 1230
    _PDiskState,
......
1240 1254
  OP_DSC_FIELD = "node_name"
1241 1255
  OP_PARAMS = [
1242 1256
    _PNodeName,
1257
    _PNodeUuid,
1243 1258
    _PForce,
1244 1259
    ]
1245 1260
  OP_RESULT = ht.TMaybeString
......
1250 1265
  OP_DSC_FIELD = "node_name"
1251 1266
  OP_PARAMS = [
1252 1267
    _PNodeName,
1268
    _PNodeUuid,
1253 1269
    _PMigrationMode,
1254 1270
    _PMigrationLive,
1255 1271
    _PMigrationTargetNode,
1272
    _PMigrationTargetNodeUuid,
1256 1273
    _PAllowRuntimeChgs,
1257 1274
    _PIgnoreIpolicy,
1258 1275
    _PIAllocFromDesc("Iallocator for deciding the target node"
......
1267 1284
  OP_PARAMS = [
1268 1285
    _PEarlyRelease,
1269 1286
    _PNodeName,
1287
    _PNodeUuid,
1270 1288
    ("remote_node", None, ht.TMaybeString, "New secondary node"),
1289
    ("remote_node_uuid", None, ht.TMaybeString, "New secondary node UUID"),
1271 1290
    _PIAllocFromDesc("Iallocator for computing solution"),
1272 1291
    ("mode", ht.NoDefault, ht.TElemOf(constants.NODE_EVAC_MODES),
1273 1292
     "Node evacuation mode"),
......
1333 1352
    ("osparams", ht.EmptyDict, ht.TDict, "OS parameters for instance"),
1334 1353
    ("os_type", None, ht.TMaybeString, "Operating system"),
1335 1354
    ("pnode", None, ht.TMaybeString, "Primary node"),
1355
    ("pnode_uuid", None, ht.TMaybeString, "Primary node UUID"),
1336 1356
    ("snode", None, ht.TMaybeString, "Secondary node"),
1357
    ("snode_uuid", None, ht.TMaybeString, "Secondary node UUID"),
1337 1358
    ("source_handshake", None, ht.TMaybe(ht.TList),
1338 1359
     "Signed handshake from source (remote import only)"),
1339 1360
    ("source_instance_name", None, ht.TMaybeString,
......
1344 1365
    ("source_x509_ca", None, ht.TMaybeString,
1345 1366
     "Source X509 CA in PEM format (remote import only)"),
1346 1367
    ("src_node", None, ht.TMaybeString, "Source node for import"),
1368
    ("src_node_uuid", None, ht.TMaybeString, "Source node UUID for import"),
1347 1369
    ("src_path", None, ht.TMaybeString, "Source directory for import"),
1348 1370
    ("start", True, ht.TBool, "Whether to start instance after creation"),
1349 1371
    ("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Instance tags"),
......
1502 1524
    ("disks", ht.EmptyList, ht.TListOf(ht.TNonNegativeInt),
1503 1525
     "Disk indexes"),
1504 1526
    ("remote_node", None, ht.TMaybeString, "New secondary node"),
1527
    ("remote_node_uuid", None, ht.TMaybeString, "New secondary node UUID"),
1505 1528
    _PIAllocFromDesc("Iallocator for deciding new secondary node"),
1506 1529
    ]
1507 1530
  OP_RESULT = ht.TNone
......
1515 1538
    _PShutdownTimeout,
1516 1539
    _PIgnoreConsistency,
1517 1540
    _PMigrationTargetNode,
1541
    _PMigrationTargetNodeUuid,
1518 1542
    _PIgnoreIpolicy,
1519 1543
    _PIAllocFromDesc("Iallocator for deciding the target node for"
1520 1544
                     " shared-storage instances"),
......
1538 1562
    _PMigrationMode,
1539 1563
    _PMigrationLive,
1540 1564
    _PMigrationTargetNode,
1565
    _PMigrationTargetNodeUuid,
1541 1566
    _PAllowRuntimeChgs,
1542 1567
    _PIgnoreIpolicy,
1543 1568
    ("cleanup", False, ht.TBool,
......
1566 1591
    _PShutdownTimeout,
1567 1592
    _PIgnoreIpolicy,
1568 1593
    ("target_node", ht.NoDefault, ht.TNonEmptyString, "Target node"),
1594
    ("target_node_uuid", None, ht.TMaybeString, "Target node UUID"),
1569 1595
    _PIgnoreConsistency,
1570 1596
    ]
1571 1597
  OP_RESULT = ht.TNone
......
1620 1646
     " index and a possibly empty dictionary with disk parameter changes"),
1621 1647
    ("nodes", ht.EmptyList, ht.TListOf(ht.TNonEmptyString),
1622 1648
     "New instance nodes, if relocation is desired"),
1649
    ("node_uuids", None, ht.TMaybeListOf(ht.TNonEmptyString),
1650
     "New instance node UUIDs, if relocation is desired"),
1623 1651
    _PIAllocFromDesc("Iallocator for deciding new nodes"),
1624 1652
    ]
1625 1653
  OP_RESULT = ht.TNone
......
1707 1735
    ("disk_template", None, ht.TMaybe(_BuildDiskTemplateCheck(False)),
1708 1736
     "Disk template for instance"),
1709 1737
    ("pnode", None, ht.TMaybeString, "New primary node"),
1738
    ("pnode_uuid", None, ht.TMaybeString, "New primary node UUID"),
1710 1739
    ("remote_node", None, ht.TMaybeString,
1711 1740
     "Secondary node (used when changing disk template)"),
1741
    ("remote_node_uuid", None, ht.TMaybeString,
1742
     "Secondary node UUID (used when changing disk template)"),
1712 1743
    ("os_name", None, ht.TMaybeString,
1713 1744
     "Change the instance's OS without reinstalling the instance"),
1714 1745
    ("osparams", None, ht.TMaybeDict, "Per-instance OS parameters"),
......
1773 1804
    _PForce,
1774 1805
    ("nodes", ht.NoDefault, ht.TListOf(ht.TNonEmptyString),
1775 1806
     "List of nodes to assign"),
1807
    ("node_uuids", None, ht.TMaybeListOf(ht.TNonEmptyString),
1808
     "List of node UUIDs to assign"),
1776 1809
    ]
1777 1810
  OP_RESULT = ht.TNone
1778 1811

  
......
1908 1941
    # (e.g. "destination")
1909 1942
    ("target_node", ht.NoDefault, ht.TOr(ht.TNonEmptyString, ht.TList),
1910 1943
     "Destination information, depends on export mode"),
1944
    ("target_node_uuid", None, ht.TMaybeString,
1945
     "Target node UUID (if local export)"),
1911 1946
    ("shutdown", True, ht.TBool, "Whether to shutdown instance before export"),
1912 1947
    ("remove_instance", False, ht.TBool,
1913 1948
     "Whether to remove instance after export"),
......
2015 2050
    ("duration", ht.NoDefault, ht.TNumber, None),
2016 2051
    ("on_master", True, ht.TBool, None),
2017 2052
    ("on_nodes", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), None),
2053
    ("on_node_uuids", None, ht.TMaybeListOf(ht.TNonEmptyString), None),
2018 2054
    ("repeat", 0, ht.TNonNegativeInt, None),
2019 2055
    ]
2020 2056

  

Also available in: Unified diff