X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/74409b129fee67d6dcd378435d298d6ada644870..1ba9227f00db3c7c58ce789f9adcb423d16f489c:/lib/opcodes.py diff --git a/lib/opcodes.py b/lib/opcodes.py index cd9b88e..c40d51b 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -171,6 +171,8 @@ class OpCode(BaseOpCode): return txt +# cluster opcodes + class OpDestroyCluster(OpCode): """Destroy the cluster. @@ -255,8 +257,23 @@ class OpSetClusterParams(OpCode): """ OP_ID = "OP_CLUSTER_SET_PARAMS" - __slots__ = ["vg_name"] + __slots__ = [ + "vg_name", + "enabled_hypervisors", + "hvparams", + "beparams", + "nicparams", + "candidate_pool_size", + ] + +class OpRedistributeConfig(OpCode): + """Force a full push of the cluster configuration. + + """ + OP_ID = "OP_CLUSTER_REDIST_CONF" + __slots__ = [ + ] # node opcodes @@ -303,7 +320,7 @@ class OpAddNode(OpCode): class OpQueryNodes(OpCode): """Compute the list of nodes.""" OP_ID = "OP_NODE_QUERY" - __slots__ = ["output_fields", "names"] + __slots__ = ["output_fields", "names", "use_locking"] class OpQueryNodeVolumes(OpCode): @@ -312,6 +329,28 @@ class OpQueryNodeVolumes(OpCode): __slots__ = ["nodes", "output_fields"] +class OpSetNodeParams(OpCode): + """Change the parameters of a node.""" + OP_ID = "OP_NODE_SET_PARAMS" + OP_DSC_FIELD = "node_name" + __slots__ = [ + "node_name", + "force", + "master_candidate", + "offline", + "drained", + ] + + +class OpPowercycleNode(OpCode): + """Tries to powercycle a node.""" + OP_ID = "OP_NODE_POWERCYCLE" + OP_DSC_FIELD = "node_name" + __slots__ = [ + "node_name", + "force", + ] + # instance opcodes class OpCreateInstance(OpCode): @@ -319,10 +358,11 @@ class OpCreateInstance(OpCode): OP_ID = "OP_INSTANCE_CREATE" OP_DSC_FIELD = "instance_name" __slots__ = [ - "instance_name", "mem_size", "disk_size", "os_type", "pnode", - "disk_template", "snode", "swap_size", "mode", - "vcpus", "ip", "bridge", "src_node", "src_path", "start", - "wait_for_sync", "ip_check", "mac", + "instance_name", "os_type", "pnode", + "disk_template", "snode", "mode", + "disks", "nics", + "src_node", "src_path", "start", + "wait_for_sync", "ip_check", "file_storage_dir", "file_driver", "iallocator", "hypervisor", "hvparams", "beparams", @@ -353,7 +393,7 @@ class OpStartupInstance(OpCode): """Startup an instance.""" OP_ID = "OP_INSTANCE_STARTUP" OP_DSC_FIELD = "instance_name" - __slots__ = ["instance_name", "force", "extra_args"] + __slots__ = ["instance_name", "force", "hvparams", "beparams"] class OpShutdownInstance(OpCode): @@ -367,8 +407,7 @@ class OpRebootInstance(OpCode): """Reboot an instance.""" OP_ID = "OP_INSTANCE_REBOOT" OP_DSC_FIELD = "instance_name" - __slots__ = ["instance_name", "reboot_type", "extra_args", - "ignore_secondaries" ] + __slots__ = ["instance_name", "reboot_type", "ignore_secondaries" ] class OpReplaceDisks(OpCode): @@ -385,6 +424,20 @@ class OpFailoverInstance(OpCode): __slots__ = ["instance_name", "ignore_consistency"] +class OpMigrateInstance(OpCode): + """Migrate an instance. + + This migrates (without shutting down an instance) to its secondary + node. + + @ivar instance_name: the name of the instance + + """ + OP_ID = "OP_INSTANCE_MIGRATE" + OP_DSC_FIELD = "instance_name" + __slots__ = ["instance_name", "live", "cleanup"] + + class OpConnectConsole(OpCode): """Connect to an instance's console.""" OP_ID = "OP_INSTANCE_CONSOLE" @@ -409,13 +462,13 @@ class OpDeactivateInstanceDisks(OpCode): class OpQueryInstances(OpCode): """Compute the list of instances.""" OP_ID = "OP_INSTANCE_QUERY" - __slots__ = ["output_fields", "names"] + __slots__ = ["output_fields", "names", "use_locking"] class OpQueryInstanceData(OpCode): """Compute the run-time status of instances.""" OP_ID = "OP_INSTANCE_QUERY_DATA" - __slots__ = ["instances"] + __slots__ = ["instances", "static"] class OpSetInstanceParams(OpCode): @@ -423,8 +476,9 @@ class OpSetInstanceParams(OpCode): OP_ID = "OP_INSTANCE_SET_PARAMS" OP_DSC_FIELD = "instance_name" __slots__ = [ - "instance_name", "mem", "vcpus", "ip", "bridge", "mac", - "hvparams", "force", + "instance_name", + "hvparams", "beparams", "force", + "nics", "disks", ] @@ -432,7 +486,7 @@ class OpGrowDisk(OpCode): """Grow a disk of an instance.""" OP_ID = "OP_INSTANCE_GROW_DISK" OP_DSC_FIELD = "instance_name" - __slots__ = ["instance_name", "disk", "amount"] + __slots__ = ["instance_name", "disk", "amount", "wait_for_sync"] # OS opcodes @@ -446,7 +500,7 @@ class OpDiagnoseOS(OpCode): class OpQueryExports(OpCode): """Compute the list of exported images.""" OP_ID = "OP_BACKUP_QUERY" - __slots__ = ["nodes"] + __slots__ = ["nodes", "use_locking"] class OpExportInstance(OpCode): @@ -533,5 +587,5 @@ class OpTestAllocator(OpCode): __slots__ = [ "direction", "mode", "allocator", "name", "mem_size", "disks", "disk_template", - "os", "tags", "nics", "vcpus", + "os", "tags", "nics", "vcpus", "hypervisor", ]