> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/api-reference/databases/v2/clusters/create-cluster.md).

# Create Cluster

Creates a new Cluster. The full Cluster needs to be provided to create the object. Optional data will be filled with defaults or left empty.

```json
{"openapi":"3.0.3","info":{"title":"IONOS CLOUD DBaaS In-Memory DB","version":"2.0.0"},"tags":[{"name":"Clusters","description":"An In-Memory DB cluster is a fully managed deployment consisting of one\nprimary instance and optional passive replicas. In standalone mode the cluster\nhas a single node. In replicated mode it has one primary and up to four passive\nsecondaries. Replication is asynchronous.\n\nCredentials are managed through the cluster resource. When credentials are provided in a <code>PUT</code>,\nthe specified user is created if it does not exist, or its password is updated if the\nuser already exists. Omitting credentials leaves the existing credentials unchanged.\nVersion upgrades are triggered by providing a new version value in <code>PUT</code>. Only versions\nlisted in <code>canUpgradeTo</code> are accepted. Downgrades are not supported. To restore from a\nsnapshot, include <code>restoreFromSnapshot</code> in the request body.\nThis tag groups all operations for clusters.\n"}],"servers":[{"url":"https://in-memory-db.de-fra.ionos.com/v2","description":"Germany, Frankfurt (de-fra)"},{"url":"https://in-memory-db.de-txl.ionos.com/v2","description":"Germany, Berlin"},{"url":"https://in-memory-db.es-vit.ionos.com/v2","description":"Spain, Logroño"},{"url":"https://in-memory-db.gb-bhx.ionos.com/v2","description":"United Kingdom, Worcester"},{"url":"https://in-memory-db.gb-lhr.ionos.com/v2","description":"United Kingdom, London"},{"url":"https://in-memory-db.us-ewr.ionos.com/v2","description":"United States, Newark"},{"url":"https://in-memory-db.us-las.ionos.com/v2","description":"United States, Las Vegas"},{"url":"https://in-memory-db.us-mci.ionos.com/v2","description":"United States, Lenexa"},{"url":"https://in-memory-db.fr-par.ionos.com/v2","description":"France, Paris"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The token can be generated using the \n[Authentication API](https://api.ionos.com/docs/authentication/v1/#tag/tokens/operation/tokensGenerate).\n"}},"schemas":{"ClusterCreate":{"type":"object","required":["properties"],"properties":{"metadata":{"description":"Metadata","additionalProperties":true},"properties":{"allOf":[{"$ref":"#/components/schemas/Cluster"},{"required":["credentials"]}]}}},"Cluster":{"type":"object","description":"An In-Memory DB cluster is a fully managed deployment consisting of one\nprimary instance and optional passive replicas. In standalone mode the cluster\nhas a single node. In replicated mode it has one primary and up to four passive\nsecondaries. Replication is asynchronous.\n\nCredentials are managed through the cluster resource. When credentials are provided in a <code>PUT</code>,\nthe specified user is created if it does not exist, or its password is updated if the\nuser already exists. Omitting credentials leaves the existing credentials unchanged.\nVersion upgrades are triggered by providing a new version value in <code>PUT</code>. Only versions\nlisted in <code>canUpgradeTo</code> are accepted. Downgrades are not supported. To restore from a\nsnapshot, include <code>restoreFromSnapshot</code> in the request body.\n","required":["name","version","instances","connection","evictionPolicy","snapshot","maintenanceWindow"],"properties":{"name":{"$ref":"#/components/schemas/ClusterName"},"description":{"$ref":"#/components/schemas/ClusterDescription"},"version":{"$ref":"#/components/schemas/ClusterVersion"},"instances":{"$ref":"#/components/schemas/InstanceConfiguration"},"connection":{"$ref":"#/components/schemas/ClusterConnection"},"persistenceMode":{"$ref":"#/components/schemas/PersistenceMode"},"evictionPolicy":{"$ref":"#/components/schemas/EvictionPolicy"},"snapshot":{"$ref":"#/components/schemas/SnapshotConfiguration"},"maintenanceWindow":{"$ref":"#/components/schemas/MaintenanceWindow"},"credentials":{"$ref":"#/components/schemas/User"},"restoreFromSnapshot":{"description":"Restores the cluster data from a snapshot.\nOn cluster creation, the new cluster is initialized from the referenced snapshot\n(`RestoreClusterFromSnapshot`). On in-place modification, the existing cluster is\nrestored from its own snapshot and the restore source is inferred automatically\n(`InPlaceRestoreClusterFromSnapshot`).\n","writeOnly":true,"oneOf":[{"$ref":"#/components/schemas/RestoreClusterFromSnapshot"},{"$ref":"#/components/schemas/InPlaceRestoreClusterFromSnapshot"}]},"logsEnabled":{"$ref":"#/components/schemas/LogsEnabled"},"metricsEnabled":{"$ref":"#/components/schemas/MetricsEnabled"}}},"ClusterName":{"type":"string","description":"The name of the In-Memory DB cluster.\nMust be 2-63 characters and must begin and end with an alphanumeric character\n([A-Za-z0-9]), with dashes (-), underscores (_), and dots (.) allowed in between.\n","pattern":"^[A-Za-z0-9][-A-Za-z0-9_.]*[A-Za-z0-9]$","minLength":2,"maxLength":63},"ClusterDescription":{"type":"string","description":"Human-readable description for the cluster."},"ClusterVersion":{"type":"string","description":"The version for the cluster. Use GET /versions to retrieve\nthe list of supported versions. To upgrade, provide a version listed\nin canUpgradeTo for the current version. Downgrades are not supported.\n"},"InstanceConfiguration":{"type":"object","description":"Compute configuration applied to each instance in the cluster.\nBlock storage is automatically derived from the configured RAM and persistence mode\nand cannot be set manually. It is allocated and billed for all persistence modes,\nincluding None:\n| persistenceMode | Storage allocated |\n|---|---|\n| None | 1 x RAM - disk is allocated and billed even without active persistence. |\n| RDB | 2 x RAM - space for the dataset plus a full RDB snapshot. |\n| AOF | 2 x RAM - AOF rewrite requires up to twice the dataset size. |\n| RDB_AOF | 4 x RAM - space for both AOF log and RDB snapshot copies of the dataset. |\nExample: a cluster with ram: 8 and persistenceMode: AOF is allocated 16 GB of storage.\nStorage cannot be downsized.\n","required":["count","cores","ram"],"properties":{"count":{"type":"integer","description":"The total number of instances in the cluster.\nA value of 1 creates a standalone instance.\nValues 2-5 create a replicated setup with one primary and n-1 passive secondaries.\nReplication is asynchronous.\n","minimum":1,"maximum":5},"cores":{"$ref":"#/components/schemas/InstanceCores"},"ram":{"$ref":"#/components/schemas/InstanceRam"}}},"InstanceCores":{"type":"integer","description":"The number of dedicated CPU cores per instance.","minimum":1,"maximum":62},"InstanceRam":{"type":"integer","description":"The amount of RAM per instance in gigabytes (GB).\nRAM cannot be downgraded. Because storage size is automatically derived\nfrom RAM, reducing RAM would require shrinking the disk, which is not supported.\n","minimum":4,"maximum":240},"ClusterConnection":{"type":"object","description":"Network connection configuration for the cluster. Each cluster connects to\nexactly one IONOS CLOUD Virtual Data Center.\n","required":["datacenterId","lanId","primaryInstanceAddress"],"properties":{"datacenterId":{"type":"string","format":"uuid","description":"The ID of the Virtual Data Center to connect the cluster to. Immutable. Cannot be changed after cluster creation."},"lanId":{"type":"string","description":"The numeric LAN ID within the data center to connect the cluster to. Immutable. Cannot be changed after cluster creation."},"primaryInstanceAddress":{"$ref":"#/components/schemas/ClusterInstanceAddress"}}},"ClusterInstanceAddress":{"type":"string","description":"The IP address and subnet mask assigned to the primary instance in CIDR notation.\nNote the following unavailable IP range: 10.210.0.0/16, 10.212.0.0/14.\n"},"PersistenceMode":{"type":"string","description":"Specifies how and whether data is persisted to disk.\n| Mode      | Description |\n|-----------|-------------|\n| None  | Data is in-memory only and will not be persisted. Suitable for pure cache use cases. |\n| AOF   | Append Only File - every write operation is logged for full durability. |\n| RDB   | Periodic point-in-time snapshots of the in-memory state. |\n| RDB_AOF | Both RDB and AOF mechanisms are active for maximum data safety. |\n","enum":["None","AOF","RDB","RDB_AOF"],"default":"None"},"EvictionPolicy":{"type":"string","description":"Defines the key eviction strategy when the memory limit is reached.\n| Policy            | Description |\n|-------------------|-------------|\n| noeviction        | Returns an error on write; no data is removed. |\n| allkeys-lru       | Evicts the least recently used keys across all keys. |\n| allkeys-lfu       | Evicts the least frequently used keys across all keys. |\n| allkeys-random    | Randomly evicts any key. |\n| volatile-lru      | Evicts least recently used keys that have an expiry set. |\n| volatile-lfu      | Evicts least frequently used keys that have an expiry set. |\n| volatile-random   | Randomly evicts keys that have an expiry set. |\n| volatile-ttl      | Evicts the key with the nearest expiry time. |\n","enum":["noeviction","allkeys-lru","allkeys-lfu","allkeys-random","volatile-lru","volatile-lfu","volatile-random","volatile-ttl"],"default":"allkeys-lru"},"SnapshotConfiguration":{"type":"object","description":"Snapshot storage and retention configuration for the cluster. The snapshot location cannot be changed after cluster creation.","required":["location","retentionDays","snapshotHours"],"properties":{"location":{"$ref":"#/components/schemas/SnapshotLocationName"},"retentionDays":{"type":"integer","description":"The number of days snapshots are retained before being automatically deleted.\nReducing this value causes the platform to purge any existing snapshots that\nfall outside the new retention window.\nPre-existing clusters that were created before this field was introduced\ndefault to 7 days.\n","minimum":1,"maximum":365,"default":7},"snapshotHours":{"type":"array","description":"Hours of the day (UTC) at which snapshots are scheduled to be taken.\nEach value must be between 0 and 23. At least one hour must be specified.\n","items":{"type":"integer","minimum":0,"maximum":23},"minItems":1,"maxItems":24}}},"SnapshotLocationName":{"description":"The Object Storage location where snapshots will be stored.\nFor added data safety, use a different location than the cluster.\nA list of supported locations is provided by the SnapshotLocations endpoint.\n","type":"string"},"MaintenanceWindow":{"description":"A weekly 4 hour-long window, during which maintenance might occur.\n","properties":{"time":{"type":"string","description":"Start of the maintenance window in UTC time."},"dayOfTheWeek":{"$ref":"#/components/schemas/DayOfTheWeek"}},"required":["time","dayOfTheWeek"],"type":"object"},"DayOfTheWeek":{"description":"The name of the week day.","type":"string","enum":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},"User":{"type":"object","description":"An In-Memory DB user with access to the cluster.\nThe user is granted access to all command categories; within the @dangerous\ncategory, only INFO, KEYS, and SORT commands are permitted.\nRestricted usernames (for example, admin, standby) are not allowed.\n","required":["username"],"properties":{"username":{"$ref":"#/components/schemas/Username"},"password":{"$ref":"#/components/schemas/HashedPassword"}}},"Username":{"type":"string","description":"The username for the In-Memory DB user.\nMust be 2–16 characters and may only contain alphanumeric characters ([A-Za-z0-9])\nand underscores (_).\nRestricted usernames (for example, admin, standby) are not allowed.\n","pattern":"^[A-Za-z0-9_]+$","minLength":2,"maxLength":16},"HashedPassword":{"type":"object","description":"A pre-hashed password for the user.\nPassword is required whenever credentials are supplied, on create and on update; never returned in responses.\n","writeOnly":true,"required":["algorithm","hash"],"properties":{"algorithm":{"type":"string","enum":["SHA-256"]},"hash":{"type":"string","description":"The hex-encoded hash of the password. Must be exactly 64 lowercase\nhexadecimal characters (the standard output of SHA-256).\nNote: base64-encoded SHA-256 hashes (44 characters) are not accepted.\n","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64}}},"RestoreClusterFromSnapshot":{"type":"object","writeOnly":true,"description":"Valid only for cluster creation and is not valid for in-place restore.\nWhen specified during cluster creation, it initializes the new cluster with data from an\nexisting snapshot.\nOnly snapshots from clusters within the same region are eligible for restore.\nThe snapshot includes the cluster's stored credentials; credentials provided in the\ncluster's `credentials` field override those stored in the snapshot.\n","required":["sourceSnapshotId"],"properties":{"sourceSnapshotId":{"type":"string","format":"uuid","description":"The UUID of the snapshot to restore from."},"recoveryTargetDatetime":{"type":"string","format":"date-time","description":"Provide an ISO 8601 timestamp to restore from the most recent snapshot taken at or\nbefore that time, within the snapshot's recovery window. In-Memory DB does not provide\ncontinuous point-in-time recovery; the nearest preceding snapshot is used. If omitted,\nthe cluster is restored from the latest available snapshot.\n"}}},"InPlaceRestoreClusterFromSnapshot":{"type":"object","additionalProperties":false,"writeOnly":true,"description":"Valid only for cluster modifications and cannot be used during cluster creation.\nWhen modifying an existing cluster, this field configures an in-place restore from the\ncluster's snapshot, with the restore source inferred automatically.\nDuring the restore process, the cluster's current data is overwritten with the data from the snapshot, and the cluster may experience a brief period of downtime.\nAny existing credentials are replaced with those stored in the snapshot; any `credentials` provided in the request are ignored.\n","required":["recoveryTargetDatetime"],"properties":{"recoveryTargetDatetime":{"type":"string","format":"date-time","description":"Provide an ISO 8601 timestamp to restore from the most recent snapshot taken at or\nbefore that time. In-Memory DB does not provide continuous point-in-time recovery; the\nnearest preceding snapshot is used. This field is required for in-place restore.\n"}}},"LogsEnabled":{"type":"boolean","default":false,"description":"Activates or deactivates log collection and reporting for this cluster's observability.\nIf the observability service is not activated on the contract, this setting is\naccepted but has no effect until the service is activated.\n"},"MetricsEnabled":{"type":"boolean","default":false,"description":"Activates or deactivates metrics collection and reporting for this cluster's observability.\nIf the observability service is not activated on the contract, this setting is\naccepted but has no effect until the service is activated.\n"},"ClusterRead":{"type":"object","required":["id","type","href","metadata","properties"],"properties":{"id":{"type":"string","description":"The ID (UUID) of the Cluster.","format":"uuid"},"type":{"description":"The type of the resource.","type":"string","enum":["cluster"]},"href":{"description":"The URL of the Cluster.","type":"string"},"metadata":{"$ref":"#/components/schemas/ClusterMetadata"},"properties":{"$ref":"#/components/schemas/Cluster"}}},"ClusterMetadata":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Metadata"},{"type":"object","properties":{"state":{"$ref":"#/components/schemas/ClusterState"},"statusMessage":{"type":"string","description":"A human-readable message describing the current state. Populated when state is FAILED.","readOnly":true},"dnsName":{"type":"string","description":"The DNS name used to connect to the cluster's primary instance.\nPattern: <clusterId>.in-memory-db.<location>.ionos.com\n","readOnly":true}}}]},"Metadata":{"type":"object","description":"Metadata of the resource.","properties":{"createdDate":{"type":"string","format":"date-time","description":"The ISO 8601 creation timestamp.","readOnly":true},"createdBy":{"type":"string","description":"Unique name of the identity that created the resource.","readOnly":true},"createdByUserId":{"type":"string","description":"Unique id of the identity that created the resource.","readOnly":true},"lastModifiedDate":{"type":"string","format":"date-time","description":"The ISO 8601 modified timestamp.","readOnly":true},"lastModifiedBy":{"type":"string","description":"Unique name of the identity that last modified the resource.","readOnly":true},"lastModifiedByUserId":{"type":"string","description":"Unique id of the identity that last modified the resource.","readOnly":true},"resourceURN":{"type":"string","description":"Unique name of the resource.","readOnly":true}}},"ClusterState":{"description":"The current lifecycle state of the cluster.\n- PROVISIONING: The system is actively applying the changes.\n- AVAILABLE: The resource is fully operational with no pending changes.\n- UPDATING: A modification is in progress.\n- DESTROYING: The resource is being deleted.\n- FAILED: A terminal lifecycle error occurred. See statusMessage for details.\n","type":"string","enum":["PROVISIONING","AVAILABLE","UPDATING","DESTROYING","FAILED"]},"Error":{"description":"The Error object is used to represent an error response from the API.\n","type":"object","properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","description":"A list of error messages.\n","items":{"type":"object","properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotAllowed":{"description":"### Not Allowed\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnsupportedMediaType":{"description":"### Unsupported Media Type\nThe request has an unsupported media type.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnprocessableEntity":{"description":"### Unprocessable Entity\nThe request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"### Too Many Requests\nThe user has sent too many requests in a given amount of time.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServiceUnavailable":{"description":"### Service Unavailable\nThe server is currently unable to handle the request due to a temporary overloading or maintenance of the server.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnexpectedError":{"description":"### Unexpected Internal Server Error\nAn unexpected internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/clusters":{"post":{"operationId":"clustersPost","summary":"Create Cluster","tags":["Clusters"],"description":"Creates a new Cluster.\nThe full Cluster needs to be provided to create the object.\nOptional data will be filled with defaults or left empty.\n","requestBody":{"description":"Cluster to create.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterCreate"}}}},"responses":{"201":{"description":"Cluster successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterRead"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/NotAllowed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"default":{"$ref":"#/components/responses/UnexpectedError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/api-reference/databases/v2/clusters/create-cluster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
