Move Elasticsearch resource instances
- POST /deployments/{deployment_id}/elasticsearch/{ref_id}/instances/{instance_ids}/_move
Moves one or more instances belonging to the given Elasticsearch resource to a different allocator.
Query parameters
-
ignore_missingboolean · default: false -
When
trueand the instance does not exist, proceeds to the next instance, or treats the instance as an error. -
force_updateboolean · default: false -
When
true, cancels and overwrites the pending plans, or treats the instance as an error. -
instances_downboolean · default: false -
When
true, the instances specified byinstance_idsare considered permanently shut down for data migration logic. -
move_onlyboolean · default: true -
When
true, moves the specified instances and ignores the changes for the cluster state.
Request body
Overrides the default move configuration
-
strategyobject -
The options for performing a plan change. Specify only one property each time. The default is
grow_and_shrink. -
rollingobject -
Performs inline, rolling configuration changes that mutate existing containers. TIP: This is the fastest way to update a plan, but can fail for complex plan changes, such as topology changes. Also, this is less safe for configuration changes that leave a cluster in a non running state. NOTE: When you perform a major version upgrade, and 'group_by' is set to 'pass:macros[all]';, rolling is required.
-
group_bystring -
Specifies the grouping attribute to use when rolling several instances. Instances that share the same value for the provided attribute key are rolled together as a unit. Examples that make sense to use are '__all__' (roll all instances as a single unit), 'logical_zone_name' (roll instances by zone), '__name__' (roll one instance at a time, the default if not specified). Note that '__all__' is required when performing a major version upgrade
-
allow_inline_resizeboolean -
Whether we allow changing the capacity of instances (default false). This is currently implemented by stopping, re-creating then starting the affected instance on its associated allocator when performing the changes. NOTES: This requires a round-trip through the allocation infrastructure of the active constructor, as it has to reserve the target capacity without over-committing
-
grow_and_shrinkobject -
A strategy that creates instances with the new plan, migrates data from the old instances, then shuts down the old instances.
GrowShrinkStrategyConfigis safer than 'rolling' and ensures single node availability during a plan change, but can be a lot slower on larger clusters. -
plan_configurationobject -
The configuration settings for the timeout and fallback parameters.
-
timeoutinteger · format: int64 -
The total timeout in seconds after which the plan is cancelled even if it is not complete. Defaults to 4x the max memory capacity per node (in MB). NOTES: A 3 zone cluster with 2 nodes of 2048 each would have a timeout of 4*2048=8192 seconds. Timeout does not include time required to run rollback actions.
-
calm_wait_timeinteger · format: int64 -
This timeout determines how long to give a cluster after it responds to API calls before performing actual operations on it. It defaults to 5s
-
move_onlyboolean -
If true (default: false) only move_instances and move_allocators instructions will be executed, all other changes will be ignored
-
reallocate_instancesboolean -
If true (default: false) does not allow re-using any existing instances currently in the cluster, ie even unchanged instances will be re-created
-
preferred_allocatorsstring -
List of allocators on which instances are placed if possible (if not possible/not specified then any available allocator with space is used)
-
Map containing allocators tags in form of key value pairs, increasing the likelihood during move requests for allocators with matching tags, to be selected as target allocators
-
skip_snapshotboolean -
If true (default: false), does not take (or require) a successful snapshot to be taken before performing any potentially destructive changes to this cluster
-
max_snapshot_attemptsinteger · format: int32 -
If taking a snapshot (ie unless 'skip_snapshots': true) then will retry on failure at most this number of times (default: 5)
-
max_snapshot_ageinteger · format: int64 -
When you take a snapshot and 'skip_snapshots' is false, specifies the maximum age in seconds of the most recent snapshot before a new snapshot is created. Default is 300
-
extended_maintenanceboolean -
If true (default false), does not clear the maintenance flag (which prevents its API from being accessed except by the constructor) on new instances added until after a snapshot has been restored, otherwise, the maintenance flag is cleared once the new instances successfully join the new cluster
-
cluster_reboot -
Set to 'forced' to force a reboot as part of the upgrade plan. NOTES: (ie taking an existing plan and leaving it alone except for setting 'transient.plan_configuration.cluster_reboot': 'forced' will reboot the cluster)
-
Values:
forced -
override_failsafeboolean -
If false (the default) then the plan will fail out if it believes the requested sequence of operations can result in data loss - this flag will override some of these restraints
-
skip_data_migrationboolean -
If true (default: false) then the plan will not wait for data to be migrated from old instances to new instances before continuing the plan (potentially deleting the old instances and losing data)
-
skip_upgrade_checkerboolean -
If false, the cluster is checked for issues that should be resolved before migration (eg contains old Lucene segments), if true this is bypassed
-
restore_snapshotobject -
Restores a snapshot from a local or remote repository.
-
repository_namestring -
If specified, contains the name of the snapshot repository - else will default to the Elastic Cloud system repo ('found-snapshots')
-
snapshot_namestringrequired -
The name of the snapshot to restore. Use '__latest_success__' to get the most recent snapshot from the specified repository
-
repository_configobject -
Configures the location of a remote repository. The default is the system repository.
-
restore_payloadobject -
The configuration for the restore command, such as which indices you want to restore.
-
snapshot_dependencyobject -
Configuration for attaching a snapshot repository dependency from another cluster. This creates a snapshot repository in the target cluster pointing to the source cluster's snapshots.
-
remote_clustersobject -
The list of resources used as remote clusters
-
resourcesobjectrequired -
The remote resources
-
elasticsearch_ref_idstringrequired -
The locally-unique user-specified id of an Elasticsearch Resource
-
aliasstringrequired -
The alias for this remote cluster. Aliases must only contain letters, digits, dashes and underscores
-
If true, skip this cluster during search if it is disconnected. Default: false
-
cluster_settings_jsonobject -
If specified, contains transient settings to be applied to an Elasticsearch cluster during changes,default values shown below applied. These can be overridden by specifying them in the map (or null to unset). Additional settings can also be set. Settings will be cleared after the plan has finished. If not specified, no settings will be applied. NOTE: These settings are only explicitly cleared for 5.x+ clusters, they must be hand-reset to their defaults in 2.x- (or a cluster reboot will clear them).
- indices.store.throttle.max_bytes_per_sec: 120Mb
- indices.recovery.max_bytes_per_sec: 120Mb
- cluster.routing.allocation.cluster_concurrent_rebalance: 5
- cluster.routing.allocation.node_initial_primaries_recoveries: 5
- cluster.routing.allocation.node_concurrent_incoming_recoveries: 5 For version 8.1 and later no defaults are provided through this mechanism, but instead hardware dependent settings are provided to each instance.
Responses
If validate_only is true, the calculated plan is returned
-
strategyobject -
The options for performing a plan change. Specify only one property each time. The default is
grow_and_shrink. -
rollingobject -
Performs inline, rolling configuration changes that mutate existing containers. TIP: This is the fastest way to update a plan, but can fail for complex plan changes, such as topology changes. Also, this is less safe for configuration changes that leave a cluster in a non running state. NOTE: When you perform a major version upgrade, and 'group_by' is set to 'pass:macros[all]';, rolling is required.
-
group_bystring -
Specifies the grouping attribute to use when rolling several instances. Instances that share the same value for the provided attribute key are rolled together as a unit. Examples that make sense to use are '__all__' (roll all instances as a single unit), 'logical_zone_name' (roll instances by zone), '__name__' (roll one instance at a time, the default if not specified). Note that '__all__' is required when performing a major version upgrade
-
allow_inline_resizeboolean -
Whether we allow changing the capacity of instances (default false). This is currently implemented by stopping, re-creating then starting the affected instance on its associated allocator when performing the changes. NOTES: This requires a round-trip through the allocation infrastructure of the active constructor, as it has to reserve the target capacity without over-committing
-
grow_and_shrinkobject -
A strategy that creates instances with the new plan, migrates data from the old instances, then shuts down the old instances.
GrowShrinkStrategyConfigis safer than 'rolling' and ensures single node availability during a plan change, but can be a lot slower on larger clusters. -
restore_snapshotobject -
Restores a snapshot from a local or remote repository.
-
repository_namestring -
If specified, contains the name of the snapshot repository - else will default to the Elastic Cloud system repo ('found-snapshots')
-
snapshot_namestringrequired -
The name of the snapshot to restore. Use '__latest_success__' to get the most recent snapshot from the specified repository
-
repository_configobject -
Configures the location of a remote repository. The default is the system repository.
-
restore_payloadobject -
The configuration for the restore command, such as which indices you want to restore.
-
snapshot_dependencyobject -
Configuration for attaching a snapshot repository dependency from another cluster. This creates a snapshot repository in the target cluster pointing to the source cluster's snapshots.
-
cluster_settings_jsonobject -
If specified, contains transient settings to be applied to an Elasticsearch cluster during changes,default values shown below applied. These can be overridden by specifying them in the map (or null to unset). Additional settings can also be set. Settings will be cleared after the plan has finished. If not specified, no settings will be applied. NOTE: These settings are only explicitly cleared for 5.x+ clusters, they must be hand-reset to their defaults in 2.x- (or a cluster reboot will clear them).
- indices.store.throttle.max_bytes_per_sec: 120Mb
- indices.recovery.max_bytes_per_sec: 120Mb
- cluster.routing.allocation.cluster_concurrent_rebalance: 5
- cluster.routing.allocation.node_initial_primaries_recoveries: 5
- cluster.routing.allocation.node_concurrent_incoming_recoveries: 5 For version 8.1 and later no defaults are provided through this mechanism, but instead hardware dependent settings are provided to each instance.
The move command was issued successfully. Use the "GET" command on the /{deployment_id} resource to monitor progress
Response Type: object
- The Deployment specified by {deployment_id} cannot be found. (code:
deployments.deployment_not_found) - The Elasticsearch Resource specified by {ref_id} cannot be found. (code:
deployments.deployment_resource_not_found) - One or more instances of the given resource type are missing. (code:
deployments.instances_missing_on_update_error)