---
title: "Upload and create an image"
sidebar_label: "Upload and create an image"
sidebar_position: 2
description: "How to upload an image from a file or via a link, upload a vmdk image, and create an image from a disk"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from 'docs-kit/components'
import Formbricks from '@theme/MDXComponents/Formbricks'
import MoreVerticalIcon from 'docs-kit/icons/more-vertical'

# Upload and create an image

You can upload the following images to the Selectel image storage:

* [from a file](#upload-image-from-file);
* [via a link](#upload-image-by-link);
* [via S3](#upload-image-via-object-storage);
* [in vmdk format](#upload-vmdk).

You can [create a disk image](#create-image-from-volume) from any [local](/cloud-servers/volumes/about-local-disks.mdx) or [network](/cloud-servers/volumes/about-network-volumes.mdx) cloud server disk.<br />The disk can be either a boot or an extra disk.

Such an image can be used for:

* for cloning cloud servers. If an operating system and software are installed on a server, you can deploy already configured servers from the boot disk image. This is faster than configuring the necessary settings for multiple servers;
* changing the boot disk type;
* transferring a server to other pools, projects, or accounts;
* exporting a cloud server network volume;
* if the image from which the server was previously created is deleted, you can create an image from the server disk and, if necessary, create an identical cloud server.

## Limitations \{#limitations}

When uploading an image to the Selectel image storage from a file or via a link, the image size must be less than 2048 GB (2 TB).

If you need to upload an image from a larger file, [upload it via S3](#upload-image-via-object-storage).

You can create an image from a disk smaller than 2048 GB (2 TB).

## Upload an image from a file \{#upload-image-from-file}

In Selectel image storage, you can upload an image from a file of a certain size from your local computer. Learn more about image size limitations in the [Limitations](#limitations) subsection.

<Tabs queryString="upload-image-from-file">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/images/), on the top menu, click **Products** and select **Cloud Servers**.

    2. Go to the **Images** section.

    3. Click **Create image**.

    4. Enter the image name.

    5. Select a [location](/infrastructure/locations.mdx) to upload the image to.

       Images smaller than 16 GB are automatically replicated to adjacent pool segments in the location.

    6. Select an operating system.

    7. Select a file as the image source.

    8. Click **Upload**.

    9. Select the image format or container format. Learn more about formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) subsection.

       If you are uploading an archive with the `.ova` container format, we recommend unpacking the archive before uploading so the image works correctly.

       If you are not sure which formats to specify, specify the `raw` image format and the `bare` container format.

    10. Optional: check the **Specify minimum disk and memory size** checkbox and specify the RAM size in MB and disk size in GB. This is the minimum disk and RAM size required to create a server from this image. For images in `.iso` format, you cannot specify minimum values.

        After an image is created, you cannot change the minimum disk and memory size in the Control panel. To change the minimum values, you will need to recreate the image or use the [OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    11. Click **Create**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    The image will only be available to the project and pool for which you [configured authorization in the OpenStack API](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#configure-openstack-in-os).

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Create an image:

       ```bash
       openstack image create \
         --disk-format <image_format> \
         --container-format <container_format> \
         --file <path> \
         --property hw_disk_bus=scsi \
         --property hw_scsi_model=virtio-scsi \
         --property x_sel_image_owner=Selectel \
         --property hw_qemu_guest_agent=yes \
         --store <pool_segment> \
         <image_name>
       ```

       Specify:

       * `<image_format>` — image format. Learn more about image formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) section. If you do not know which format to specify, use `raw`;
       * `<container_format>` — container format. Learn more about container formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) subsection.

         If you are uploading an archive with the `.ova` container format, we recommend unpacking the archive before uploading so the image works correctly.

         If you are not sure which format to specify, specify `bare`;
       * `<path>` — path to the image file;
       * `<pool_segment>` — [pool segment](/infrastructure/locations.mdx#pool) where the image will be uploaded, for example `ru-1a`. You can view the list of available pool segments in the [Selectel infrastructure](/infrastructure/locations.mdx#selectel-infrastructure) table. Images smaller than 16 GB are automatically replicated to adjacent pool segments;
       * `<image_name>` — image name.
  </TabItem>
</Tabs>

## Upload an image via a link \{#upload-image-by-link}

In Selectel image storage, you can upload an image using a public link to a file of a certain size containing the image. Learn more about image size limitations in the [Limitations](#limitations) subsection.

<Tabs queryString="upload-image-by-link">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/images/), on the top menu, click **Products** and select **Cloud Servers**.

    2. Go to the **Images** section.

    3. Click **Create image**.

    4. Enter the image name.

    5. Select a [location](/infrastructure/locations.mdx) to upload the image to.

       Images smaller than 16 GB are automatically replicated to adjacent pool segments in the location.

    6. Select an operating system.

    7. Select a URL as the image source.

    8. Enter a link to the image file in the `https://example.com/file.raw` format.

    9. Select the image format or container format. Learn more about formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) subsection.

       If you are uploading an archive with the `.ova` container format, we recommend unpacking the archive before uploading for the image to work correctly.

       If you are not sure which formats to specify, specify the `raw` image format and the `bare` container format.

    10. Optional: check the **Specify minimum disk and memory size** checkbox and specify the RAM size in MB and disk size in GB. This is the minimum disk and RAM size required to create a server from this image. For images in `.iso` format, you cannot specify minimum values.

        After an image is created, you cannot change the minimum disk and memory size in the Control panel. To change the minimum values, you will need to recreate the image or use the [OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    11. Click **Create**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    The image will only be available to the project and pool for which you [configured authorization in the OpenStack API](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#configure-openstack-in-os).

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Create an empty image:

       ```bash
       openstack image create <image_name>
       ```

       Specify `<image_name>` — image name.

    3. Import a file into the image:

       ```bash
       openstack image import \
         --method web-download \
         --uri <image_url> \
         <image>
       ```

       Specify:

       * `<image_url>` — link to the image file in the `https://example.com/file.raw` format;
       * `<image>` — ID or name of the image you created in step 2.
  </TabItem>
</Tabs>

## Upload an image via S3 \{#upload-image-via-object-storage}

1. [Upload the image to S3](/s3/objects/upload-object.mdx#segmented-upload) using segmented upload.

2. [Get an IAM token for your project (X-Auth-Token)](/api/authorization/#iam-token-project-scoped).

3. In the request output, copy the value in the `X-Subject-Token` field.

4. Open CLI on your local computer.

5. Create an image via API:

   ```bash
   curl 'https://<pool>.cloud.api.selcloud.ru/image/v2/images' \
     -H 'X-Auth-Token: <x_auth_token>' \
     -H 'Content-Type: application/json;charset=utf-8' \
     --data '{"name":"<image_name>","disk_format":"<image_format>","container_format":"<container_format>"}'
   ```

   Specify:

   * `<pool>` — [pool](/infrastructure/locations.mdx#pool) where the image will be uploaded, for example `ru-1`. The address (URL) depends on the region and pool; you can view it in the [URL list](/api/urls/). You can view the list of available pools in the [Selectel infrastructure](/infrastructure/locations.mdx#selectel-infrastructure);
   * `<x_auth_token>` — IAM token for the project that you copied in step 3;
   * `<image_name>` — image name;
   * `<image_format>` — image format. Learn more about image formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) section. If you do not know which format to specify, use `raw`;
   * `<container_format>` — container format. Learn more about container formats in the [Custom images](/cloud-servers/images/about-images.mdx#own-images) subsection.

     If you are uploading an archive with the `.ova` container format, we recommend unpacking the archive before uploading for the image to work correctly.

     If you are not sure which format to specify, specify `bare`.

6. In the request output, copy the value in the `id` field.

7. [Get the link to the image in S3](/s3/objects/obtain-link-to-object.mdx).

8. Upload the image to the image storage:

   ```bash
   curl 'https://<pool>.cloud.api.selcloud.ru/image/v2/images/<image_id>/import' \
     -X POST \
     -H 'Content-Type: application/octet-stream' \
     -H 'X-Image-Meta-Store: <pool_segment>' \
     -H 'X-Auth-Token: <x_auth_token>' \
     --data-raw '{"method":{"name":"web-download","uri":"<object_storage_url>"}}'
   ```

   Specify:

   * `<pool>` — [pool](/infrastructure/locations.mdx#pool) where the image will be uploaded, for example `ru-1`. The address (URL) depends on the region and pool; you can view it in the [URL list](/api/urls/). You can view the list of available pools in the [Selectel infrastructure](/infrastructure/locations.mdx#selectel-infrastructure);
   * `<image_id>` — ID of the image that you copied in step 6;
   * `<pool_segment>` — [pool segment](/infrastructure/locations.mdx#pool) where the image will be uploaded, for example `ru-1a`. You can view the list of available pool segments in the [Selectel infrastructure](/infrastructure/locations.mdx#selectel-infrastructure);
   * `<x_auth_token>` — IAM token that you copied in step 3;
   * `<object_storage_url>` — link to the image in S3 like `https://<uuid>.selstorage.ru/container_name/object_name`, which you obtained in step 7.

## Upload vmdk from a file or via a link \{#upload-vmdk}

Read more about image size limitations in the [Limitations](#limitations) subsection.

<Tabs queryString="upload-vmdk">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. Export your virtual machine from VMware in `.ovf` format. Learn more in the [Export an ovf Template](https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/6-5/vsphere-virtual-machine-administration-guide-6-5/deploying-ovf-templates-vSphereVirtualMachineAdministration/export-an-ovf-template-vSphereVirtualMachineAdministration.html) instruction in the VMware documentation.

       If the virtual disk is `MONOLITHIC_SPARSE` or `MONOLITHIC_FLAT`, you can skip this step, but we recommend exporting the VM in `.ovf` format.

    2. In the [Control panel](https://my.selectel.ru/vpc/default/images/), on the top menu, click **Products** and select **Cloud Servers**.

    3. Go to the **Images** section.

    4. Click **Create image**.

    5. Enter the image name.

    6. Select a [location](/infrastructure/locations.mdx) to upload the image to.

       Images smaller than 16 GB are automatically replicated to adjacent pool segments in the location.

    7. Select an operating system.

    8. Select a file or URL as the image source.

    9. If you selected a file, click **Upload**. If you selected a URL, enter the link to the image file in the `https://example.com/file.raw` format.

    10. Select the image format:

        * `vmdk` — if the virtual machine was exported from VMware in `.ovf` format or you are uploading a virtual disk of type `MONOLITHIC_SPARSE`;
        * `raw` — if you are uploading a virtual disk of type `MONOLITHIC_FLAT`.

    11. Select the container format:

        * `ovf` — if the virtual machine was exported from VMware in `.ovf` format;
        * `bare` — if you are uploading a virtual disk of type `MONOLITHIC_SPARSE` or `MONOLITHIC_FLAT`.

    12. Optional: select the **Specify minimum disk and memory size** checkbox and specify the RAM size in MB and disk size in GB. This is the minimum disk and RAM size required to create a server from this image. For images in `.iso` format, you cannot specify minimum values.

        After an image is created, you cannot change the minimum disk and memory size in the Control panel. To change the minimum values, you will need to recreate the image or use the [OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    13. Click **Create**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    The image will only be available to the project and pool for which you [configured authorization in the OpenStack API](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#configure-openstack-in-os).

    1. Export your virtual machine from VMware in `.ovf` format. Learn more in the [Export an ovf Template](https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.vm_admin.doc/GUID-B05A4E9F-DD21-4397-95A1-00125AFDA9C8.html) instruction in the VMware documentation.

       If the virtual disk is `MONOLITHIC_SPARSE` or `MONOLITHIC_FLAT`, you can skip this step, but we recommend exporting the VM in `.ovf` format.

    2. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    3. Create an image:

       ```bash
       openstack image create \
         --file <path> \
         --disk-format=<image_format> \
         --container-format=<container_format> \
         --property hw_disk_bus=scsi \
         --property hw_scsi_model=virtio-scsi \
         --store <pool_segment> \
         <image_name>
       ```

       Specify:

       * `<path>` — path to the image file;

       * `<image_format>` — image format:

         * `vmdk` — if the virtual machine was exported from VMware in `.ovf` format or you are uploading a virtual disk of type `MONOLITHIC_SPARSE`;
         * `raw` — if you are uploading a virtual disk of type `MONOLITHIC_FLAT`;

       * `<container_format>` — container format:

         * `ovf` — if the virtual machine was exported from VMware in `.ovf` format;
         * `bare` — if you are uploading a virtual disk of type `MONOLITHIC_SPARSE` or `MONOLITHIC_FLAT`;

       * `<pool_segment>` — [pool segment](/infrastructure/locations.mdx#pool) where the image will be uploaded, for example `ru-1a`. You can view the list of available pool segments in the [Selectel infrastructure](/infrastructure/locations.mdx#selectel-infrastructure) table. Images smaller than 16 GB are automatically replicated to adjacent pool segments;

       * `<image_name>` — image name.
  </TabItem>
</Tabs>

## Create an image from a disk \{#create-image-from-volume}

See the [limitations](#limitations) on the disk size you can create an image from.

<Tabs queryString="create-image-from-volume">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    The image creation process depends on the disk type.

    <Tabs queryString="volume-type-to-create-image">
      <TabItem value="local-disk" default>
        <TabItemLabel>
          Local disk
        </TabItemLabel>

        1. If the disk is connected to a cloud server, we recommend [turning off the cloud server](/cloud-servers/manage/manage-server.mdx#turn-off-server) — an inconsistent image may be created from a running disk.

        2. In the [Control panel](https://my.selectel.ru/vpc/default/images/), on the top menu, click **Products** and select **Cloud Servers**.

        3. Go to the **Servers** section.

        4. In the server's <MoreVerticalIcon /> menu, select **Create local disk image**.

        5. Enter the image name.

        6. Optional: select the **Specify minimum disk and memory size** checkbox and specify the RAM size in MB and disk size in GB. This is the minimum disk and RAM size required to create a server from this image. For images in `.iso` format, you cannot specify minimum values.

        7. Click **Create**.
      </TabItem>

      <TabItem value="network-volume">
        <TabItemLabel>
          Network volume
        </TabItemLabel>

        1. If the disk is connected to a cloud server, we recommend [turning off the cloud server](/cloud-servers/manage/manage-server.mdx#turn-off-server) — an inconsistent image may be created from a running disk.

        2. In the [Control panel](https://my.selectel.ru/vpc/default/images/), on the top menu, click **Products** and select **Cloud Servers**.

        3. Go to the **Images** section.

        4. Click **Create image**.

        5. Enter the image name.

        6. Select a [location](/infrastructure/locations.mdx) to upload the image to.

           Images smaller than 16 GB are automatically replicated to adjacent pool segments in the location.

        7. Select an operating system.

        8. Select a disk as the image source.

        9. Select a disk from which the image will be created. An image can only be created in the pool segment where the disk is located.

        10. Optional: select the **Specify minimum disk and memory size** checkbox and specify the RAM size in MB and disk size in GB. This is the minimum disk and RAM size required to create a server from this image. For images in `.iso` format, you cannot specify minimum values.

            After an image is created, you cannot change the minimum disk and memory size in the Control panel. To change the minimum values, you will need to recreate the image or use the [OpenStack CLI](/cloud-servers/tools/openstack-cli/).

        11. Click **Create**.
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    The image creation process depends on the disk type.

    The image will only be available to the project and pool for which you [configured authorization in OpenStack](/cloud-servers/tools/openstack-cli/configure-openstack-cli.mdx#configure-openstack-in-os).

    <Tabs queryString="volume-type-to-create-image">
      <TabItem value="local-disk" default>
        <TabItemLabel>
          Local disk
        </TabItemLabel>

        1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/run-openstack-cli.mdx).

        2. If the disk is connected to a cloud server, we recommend turning off the cloud server — an inconsistent image may be created from a running disk:

           ```bash
           openstack server stop <server>
           ```

           Specify `<server>` — the server ID or name. You can view the list using the `openstack server list` command.

           The server will switch to the `SHUTOFF` status.

        3. Create a local disk image:

           ```bash
           openstack server image create --name <image_name> <server>
           ```

           Specify:

           * `<image_name>` — image name;
           * `<server>` — server ID or name. You can view the list using `openstack server list`.
      </TabItem>

      <TabItem value="network-volume">
        <TabItemLabel>
          Network volume
        </TabItemLabel>

        1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/run-openstack-cli.mdx).

        2. If the disk is connected to a cloud server, we recommend turning off the cloud server — an inconsistent image may be created from a running disk:

           ```bash
           openstack server stop <server>
           ```

           Specify `<server>` — the server ID or name. You can view the list using the `openstack server list`

           The server will switch to the `SHUTOFF` status.

        3. Disconnect the network volume from the server:

           ```bash
           openstack server remove volume <server> <volume>
           ```

           Specify:

           * `<server>` — server ID or name. You can view the list using `openstack server list`;
           * `<volume>` — ID or name of the network volume. You can view the list using `openstack volume list`.

        4. Check that the network volume has switched to the `AVAILABLE` status:

           ```bash
           openstack volume list
           ```

        5. Create a network volume image:

           ```bash
           openstack image create --volume <volume> <image_name>
           ```

           Specify `<image_name>` — image name.
      </TabItem>
    </Tabs>
  </TabItem>
</Tabs>

<Formbricks />
