Download and create an image
You can download images to the image repository:
You can create your own image from disk.
Download image from
Images smaller than 100 GB can be downloaded from a file on your local computer.
- Control panel
- OpenStack CLI
-
In Control Panel, go to Cloud Platform → Objects.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment into which to load the image.
Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
-
Select the operating system.
-
Select a file as the image source.
-
Click Download.
-
Select an image format or container format. More details about formats in the [Own Images] subsection(docs/cloud/servers/images/about-images.mdx#own-images).
If you are downloading an archive with the
ova
container format, we recommend unzipping the archive before downloading for the image to work correctly.If you don't know which formats to specify, specify the image format as
raw
, the container format asbare
. -
Optional: check the Specify minimum disk and memory size checkbox. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check for these restrictions.
-
Press Create.
-
Create an image:
glance image-create {\
--name <image_name> {
--disk-format <image_format> {
--container-format <container_format> {
--file <path> {
--property hw_disk_bus=scsi {
--property hw_scsi_model=virtio-scsi {
--store <pool_segment>Specify:
-
<image_name>
is the name of the image; -
<image_format>
is the format of the image. For more information about image formats, see Own Images. If you don't know which format to specify, specifyraw
; -
<container_format>
— container format. For more information about container formats, see Own Images.If you are downloading an archive with the
ova
container format, we recommend unzipping the archive before downloading for the image to work correctly.If you don't know which format to specify, specify
bare
; -
<path>
— path to the image file; -
<pool_segment>
— pool segment to which the image will be loaded, for exampleru-1a
. Images smaller than 16 GB are automatically replicated to neighboring pool segments.
-
Download large image
Images larger than 100 GB can be downloaded via object storage.
-
Upload image to object storage via segmented upload.
-
Get Keystone token. Copy the value of
x-subject-token
. -
Open the CLI on the local computer.
-
Create a request to create an image:
curl 'https://<pool>.cloud.api.selcloud.ru/image/v2/images' \
-H 'X-Auth-Token: <token>' \
-H 'Content-Type: application/json;charset=utf-8' \
--data '{"name":"<image_name>", "disk_format":"<disk_format>", "container_format":"<container_format>"}'Specify:
-
<pool>
— pool into which to load the image, e.g.ru-1
. The address (URL) varies by region and pool, can be viewed on the URL list; -
<keystone_token>
is the Keystone token that you copied in step 2; -
<image_name>
is the name of the image; -
<image_format>
is the format of the image. For more information about image formats, see Own Images. If you don't know which format to specify, specifyraw
; -
<container_format>
— container format. For more information about container formats, see Own Images.If you are downloading an archive with the
ova
container format, we recommend unzipping the archive before downloading for the image to work correctly.If you don't know which format to specify, specify
bare
.
-
-
In the query output, copy the value of
id
. -
Upload the image to the Selectel image store:
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: <keystone_token>' \
--data-raw '{"method":{"name": "web-download", "uri":"<object_storage_url>"}}'Specify:
<pool>
— pool into which to load the image, e.g.ru-1
. The address (URL) varies by region and pool, can be viewed on the URL list;<image_id>
is the ID of the image you copied in step 5;<pool_segment>
— pool segment to which the image will be loaded, for exampleru-1a
;<keystone_token>
is the Keystone token that you copied in step 2;<object_storage_url>
— reference to the image in the object store of the formhttps://123456.selcdn.ru/bucket_name/object_name
. Can be obtained using the Obtain link to object instruction.
Download the image at
You can download the image via a public link to the image file.
- Control panel
- OpenStack CLI
-
In Control Panel, go to Cloud Platform → Objects.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment into which to load the image.
Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
-
Select the operating system.
-
Select the URL as the image source.
-
Enter a link to the image file in
https://domain.com/file.raw
format. -
Select an image format or container format. More details about formats in the [Own Images] subsection(docs/cloud/servers/images/about-images.mdx#own-images).
If you are downloading an archive with the
ova
container format, we recommend unzipping the archive before downloading for the image to work correctly.If you don't know which formats to specify, specify the image format as
raw
, the container format asbare
. -
Optional: check the Specify minimum disk and memory size checkbox. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check for these restrictions.
-
Press Create.
-
Create an image:
glance image-create-via-import \
--import-method web-download \
--uri <image_url> \
--name <image_name> \
--disk-format <image_format> \
--container-format <container_format> \
--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>Specify:
-
<image_url>
— link to the image file inhttps://domain.com/file.raw
format; -
<image_name>
is the name of the image; -
<image_format>
is the format of the image. For more information about image formats, see Own Images. If you don't know which format to specify, specifyraw
; -
<container_format>
— container format. For more information about container formats, see Own Images.If you are downloading an archive with the
ova
container format, we recommend unzipping the archive before downloading for the image to work correctly.If you don't know which format to specify, specify
bare
; -
<pool_segment>
— pool segment to which the image will be loaded, e.g.ru-1a
. Images smaller than 16 GB are automatically replicated to neighboring pool segments.
-
Download vmdk
- Control panel
- OpenStack CLI
-
Export the virtual machine from VMware in
ovf
format. See the Export an ovf Template instructions in the VMware documentation for details.If the virtual disk type is
MONOLITHIC_SPARSE
orMONOLITHIC_FLAT
, you can skip this step, but we recommend exporting the VM inovf
format. -
In Control Panel, go to Cloud Platform → Objects.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment into which to load the image.
Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
-
Select the operating system.
-
Select a file or URL as the image source.
-
If you have selected a file, click Download.
-
If you selected URL, enter a link to the image file in
https://domain.com/file.raw
format. -
Select the format of the image:
vmdk
— If the virtual machine was exported from VMware inovf
format or you are booting a virtual disk with theMONOLITHIC_SPARSE
type;raw
— if you are loading a virtual disk with typeMONOLITHIC_FLAT
.
-
Select the container format:
ovf
— if the virtual machine was exported from VMware inovf
format;bare
— if you are booting a virtual disk with typeMONOLITHIC_SPARSE
orMONOLITHIC_FLAT
.
-
Optional: check the Specify minimum disk and memory size checkbox. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check for these restrictions.
-
Press Create.
-
Export the virtual machine from VMware in
ovf
format. See the Export an ovf Template instructions in the VMware documentation for details.If the virtual disk type is
MONOLITHIC_SPARSE
orMONOLITHIC_FLAT
, you can skip this step, but we recommend exporting the VM inovf
format. -
Create an image:
glance image-create {\
--name <image_name> {
--file <path> {
--disk-format=<image_format> {
--container-format=<container_format> {
--property hw_disk_bus=scsi {
--property hw_scsi_model=virtio-scsi {
--store <pool_segment>Specify:
<image_name>
is the name of the image;<path>
— path to the image file;<image_format>
is the format of the image:vmdk
— If the virtual machine was exported from VMware inovf
format or you are booting a virtual disk with theMONOLITHIC_SPARSE
type;raw
— if you are loading a virtual disk with typeMONOLITHIC_FLAT
;
<container_format>
— container format:ovf
— if the virtual machine was exported from VMware inovf
format;bare
— if you are booting a virtual disk with typeMONOLITHIC_SPARSE
orMONOLITHIC_FLAT
;
<pool_segment>
— pool segment to which the image will be loaded, e.g.ru-1a
. Images smaller than 16 GB are automatically replicated to neighboring pool segments.
Create an image from the disk
The image can be created from any local or network disk of the cloud server, and the disk can be bootable or optional. An image is a complete copy of a disk.
You can use the image:
- To quickly set up identical cloud servers — server cloning. If the operating system and software are installed on the server, you can deploy already configured servers from the boot disk image. This is faster than setting up the desired configuration of multiple servers;
- to change the type of boot disk;
- transferring the server to other pools, projects or accounts;
- cloud server disk export;
- 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 the same cloud server.
- Control panel
- OpenStack CLI
-
If the disk is connected to a cloud server, we recommend turn off cloud server — a non-consistent image may be created from a running disk.
-
In Control Panel, go to Cloud Platform → Objects.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment into which to load the image.
Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
-
Select the operating system.
-
Select the disk as the image source.
-
Select the disk from which the image will be created. You can only create an image in the pool segment where the disk is located.
-
Optional: check the Specify minimum disk and memory size checkbox. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check for these restrictions.
-
Press Create.
The process of creating an image depends on the type of disk.
- Локальный диск
- Сетевой диск
-
If the disk is connected to a cloud server, we recommend shutting down the cloud server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— server name or ID, can be viewed with theopenstack server list
commandThe server will go to the
SHUTOFF
status. -
Create a local disk image:
openstack server image create --name <image_name> <server>
Specify:
<image_name>
is the name of the image;<server>
— server name or ID, can be viewed withopenstack server list
-
If the disk is connected to a cloud server, we recommend shutting down the cloud server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— server name or ID, can be viewed with theopenstack server list
commandThe server will go to the
SHUTOFF
status. -
Disconnect the network drive from the server:
openstack server remove volume <server> <volume>
Specify:
<server>
— server name or ID, can be viewed withopenstack server list
;<volume>
— name or ID of the network drive, the list can be viewed withopenstack volume list
-
Check that the network disk has moved to
AVAILABLE
status:openstack volume list
-
Create a network volume image:
openstack image create --volume <volume> <image_name>
Specify
<image_name>
is the name of the image.