> For the complete documentation index, see [llms.txt](https://docs.i3d.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.i3d.net/compute/flexmetal/reinstall-your-servers.md).

# Reinstall your servers

{% hint style="danger" %}
Warning: By default, the operation will cause a **full disk wipe** and all data will be lost! You can opt out by appending `?wipeDisk=false` to the request URL. Proceed with caution.
{% endhint %}

To reinstall your servers, use the endpoint provided in the [API documentation](https://docs.i3d.net/api/api_flexmetal#patch-v3-flexmetal-servers-uuid). Ensure you obtain the required UUID from the POST /servers response body. You may pass optional parameters such as:

* `name` (hostname)
* `os` (operating system), which must include a slug property. If the OS is not Windows or Talos, the `sshKey` is mandatory.
* `kernelParam` (optional)
* `partitions` (optional)
* `sshKey` (essential if the OS is not Windows or Talos)
* `postInstallScript` (must be a valid Shell script)

### Usage Scenarios

{% tabs %}
{% tab title="Reinstall with the Initially Requested OS" %}

* **Parameters:**
  * `name`: (string)\
    Optionally include `kernelParam`, `partitions`, `sshKey`
* **Behavior:**\
  The originally provisioned OS will be reinstalled, including any specified `kernelParam`, custom `partitions`, and/or `sshKey`.
  * If you pass a new `sshKey`, it replaces the original.
    {% endtab %}

{% tab title="Reinstall with a Different OS" %}

* **Parameters:**
  * `os`: (object)\
    Fully specify the OS you want to install.
* **Behavior:**\
  The originally provisioned OS will be replaced by the provided OS object, which is installed instead.
  {% endtab %}

{% tab title="Reinstall with Specific SSH Keys" %}

* **Parameters:**
  * `sshKey`: (array)
* **Behavior:**\
  The originally provisioned OS is reinstalled, but **only** the passed SSH keys are injected (not the default/original ones).
  {% endtab %}

{% tab title="Reinstall Without Wiping the Disk" %}

* **Query parameter:** `?wipeDisk=false`
* **Behavior:**\
  The OS is reinstalled, but the explicit quick-format pre-step is skipped.
  {% endtab %}
  {% endtabs %}

**Example PATCH request with all of the options**

```json
{
  "name": "host.example.com",
  "os": {
    "slug": "ubuntu-2404-lts",
    "kernelParams": [
      {
        "key": "test-kernel-param-key",
        "value": "test-kernel-param-value"
      }
    ],
    "partitions": [
      {
        "target": "/custom",
        "filesystem": "ext4",
        "size": 10240
      }
    ]
  },
  "sshKey": [
    "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHo8IaPkQ6UnDZvi4F4RBSouRa6Gtysdg2EF+SIXheVF2SGBQ2uH7RfDjXRfvq4VpHJrKYs4kWfNoHQg8ZG6PH4= ecdsa-key-20240131"
  ],
  "postInstallScript": "#!/bin/bash\necho \"Hello world!\" > /root/test.txt"
}

```


---

# 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.i3d.net/compute/flexmetal/reinstall-your-servers.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.
