---
title: "Upload and replace qcow2"
method: POST
path: "/kvm/v2/upload_qcow2"
tags: ["Installation"]
---

# Upload and replace qcow2

`POST /kvm/v2/upload_qcow2`

## Request

- Base URL: `https://api_host.edisglobal.com`
- URL: `https://api_host.edisglobal.com/kvm/v2/upload_qcow2`
- Auth: none required
- TypeScript: <https://skmtc.dev/edisglobal/apis/edis-global-management-api/docs/kvm/v2/upload_qcow2/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint uploads and replaces the current qcow2 image on the specified KVM VPS.  
**Warning:** All data on the VPS will be permanently lost if this operation is performed.  
The `api_host` parameter, obtained from the "Create AUTH-session" response,  
is dynamically set in the URL.  
Provide the `signature`, `kvm_id`, `valid_until`, and confirm data replacement by including `yes_purge_all_my_data` parameter.

## Request body `application/x-www-form-urlencoded`

- V2UploadQcow2Body
  - `signature` string: The session signature obtained from the "Create AUTH-session" call.
  - `kvm_id` string: The unique identifier of the KVM VPS where the qcow2 image will be replaced. This value is specific to your VPS.
  - `valid_until` string: The expiration timestamp for the session, as obtained from the "Create AUTH-session" call. Ensure that the session is valid and has not expired.
  - `yes_purge_all_my_data` integer: Confirmation to purge all data on the VPS. This parameter must be set to `1` to proceed.
  - `file` string, binary: The qcow2 file to upload. Provide the full path to the file.
  - `pw` string: The new root password for the VPS. Used if cloud-init is enabled.
  - `cloudinit_user_data` string: Optional cloud-init configuration for the VPS. See [Cloud-init Documentation](https://cloudinit.readthedocs.io/en/latest/reference/examples.html) for examples.

## Response `200`

The qcow2 image was successfully uploaded and replaced on the VPS.

- InlineResponse2003
  - `status` string
  - `kvmid` string
  - `serviceid` string

## Other responses

- `400`: Bad Request - Invalid parameters or missing fields.
- `401`: Unauthorized - The session signature is invalid or expired.
- `403`: Forbidden - The client does not have permission to access this resource.
- `500`: Internal Server Error - An unexpected error occurred.

---

[API](https://skmtc.dev/edisglobal/apis/edis-global-management-api.md) - [All operations](https://skmtc.dev/edisglobal/apis/edis-global-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edisglobal/apis/edis-global-management-api/revisions/223263c91ac0?raw)
