Import/Export
In this article:
Import/Export#
General information#
The Import/Export service allows you to import instances and individual volumes from your existing environment into the K2 Cloud and export them to your local virtualization infrastructure. Thus, in the K2 Cloud, you can use cut and dried instances and volumes that meet corporate IT security, configuration management and other standards and requirements.
Instances and volumes can be imported and exported either through the K2 Cloud web interface or using API.
The Import feature automatically imports the specified object from the object storage into an image or snapshot. Once the import is complete, you can create instances from the resulting image or create volumes from a snapshot in the K2 Cloud.
The Export feature automatically exports your selected instance or volume to a specified bucket in the object storage. Then you can download and launch the exported instance or volume in your local virtualization infrastructure.
Import#
To import your instance images or volume snapshots to the K2 Cloud, you should first upload them to a bucket in the object storage.
Import from the following file formats is supported:
VMDK;
VHD;
QCOW2;
OVA (only import to an image is supported);
RAW.
Importing a snapshot#
Go to the Object Storage section Buckets.
In the resource table, find the bucket containing the object to be used for snapshot creation, and click on its name to go to the bucket page.
In the Objects tab, select the desired object and click Create snapshot.
If this button is not shown, open the additional action menu (More).
In the window that opens, you can edit the suggested description of the snapshot.
Select the appropriate option and enter your email address if you want to be notified when the import process is complete.
When all parameters are set, click Create snapshot.
The parameters, progress, and status of the snapshot that you import are displayed in the section Virtual machines Storage Import/Export. You can abort import if needed. To do this, go to the task page and click Abort import.
After the process completion, the snapshot will be available in the section Virtual machines Storage Snapshots.
Importing a snapshot#
Attention
Importing of virtual machine images that use UEFI mode is not supported.
Go to the Object Storage section Buckets.
In the resource table, find the bucket containing the objects to be used for image creation, and click on its name to go to the bucket page.
In the Objects tab, select the desired objects and click Create image.
If this button is not shown, open the additional action menu (More).
In the window that opens, you can specify the image name and its description and change the order of objects in the image.
Use the vertical ellipsis to drag-and-drop objects.
Note
The first object in the image will be used as the boot device.
You can also add volume snapshot description. It will be assigned to all snapshots to be created along with the image. If the Snapshot Description field is left blank, all snapshots will be given a default description like Snapshot for cmi-XXXXXXXX, where cmi-XXXXXXXX is the image ID.
If the virtual machine whose image you are importing does not have VirtIO drivers installed, check Enable support for legacy OS. To be notified of the import process completion, select the relevant option and specify the email address.
When all parameters are set, click Create.
The parameters, progress, and status of the image that you import are displayed in the section Virtual machines Storage Import/Export. You can abort import if needed. To do this, go to the task page and click Abort import.
After the process completion, the image will be available in Images subsection.
Export#
K2 Cloud supports exporting volumes and instances to the following formats:
VMDK;
VHD (for volumes with a size of no more than 2 TB);
QCOW2;
VMDK + OVF (for instances only).
Exporting a volume#
You can export a volume in the Available or In Use state. If a volume is attached to a running instance, its snapshot may be in a inconsistent state. If you want to avoid the inconsistency and do not want to stop the instance, you should flush the cache to the volume and suspend writing to it before importing.
Go to Virtual machines Storage Volumes.
In the resource table, select the volume and click Export.
Alternatively, you can start export from the page of the instance to which the volume is attached. To do this, go to the Volumes tab, select the volume and click Export.
In the window that opens, set the parameters:
prefix;
export format;
description;
bucket in which the snapshot will be exported.
Select the appropriate option and enter your email address if you want to be notified when the import process is complete.
When all parameters are set, click Export.
The resulting snapshot file is saved to a separate folder in the bucket in the object storage. The folder name consists of the specified prefix and the export task ID.
Exporting an instance#
An instance can be exported when it is in the Stopped state and in the Running state. When exporting a running instance, snapshots of all volumes are taken simultaneously. All data that has already been written to the volume is saved, but data in RAM is not included in the snapshot. To ensure that all data is included in the image, we recommend you flush the cache to the volumes and suspend writing to them before exporting.
To export an instance from K2 Cloud:
Go to the Virtual machines section Compute Instances.
In the resource table, select the instance and click Export.
If this button is not shown, open the additional action menu (More).
Alternatively, you can start export on the instance page. To do this, in the Information tab select Export.
In the window that opens, set the parameters:
prefix;
export format;
description;
bucket into which the instance image will be exported.
Select the appropriate option and enter your email address if you want to be notified when the import process is complete.
When all parameters are set, click Export.
The resulting image files are saved to a separate folder in the bucket in the object storage. The folder name consists of the specified prefix and the export task ID.
Information about import/export task#
To view parameters, progress, and status of the import/export tasks, go to Virtual machines Storage Import/Export. Click the task ID to open its page where you can view the task details and also abort a not-yet-completed task.
For a task, its respective page displays its status, progress, description, and creation date. In addition, the image import task page contains links to the ready image and snapshots included in it. The snapshot import task page contains links to the ready snapshot and the source object in the object storage. Instance and volume export task pages contain links to the target directory in the object storage where the created images and snapshots are stored.