Skip to main content

Upload an image as a file

Upload an OS image as a file from your computer when the image is not in a connected source — for example, at a site from which the source is not reachable. Center accepts a .zfs file — a zfs send stream of a ZFS volume with the boot disk of a VM. When the whole file has been received, Center computes its checksum and distributes the image to pools in the same way as an import from a source.

Upload as a file is available on any cluster, you do not need to turn it on separately.

Before you begin​

  • You need the Cluster master or VDC admin role — both have the Upload OS Image privilege. An image uploaded by a user with the Cluster master role is shared by all VDCs (virtual data centers); a VDC admin selects the VDC that will own the image.
  • The file:
    • has the .zfs extension and is not empty;
    • is not larger than the cluster limit — 32 GiB by default;
    • the OS in the image boots in UEFI mode: Center does not accept other images.
  • You have fewer than three unfinished uploads.
  • You know the values of the image passport: the OS type, the initial configuration method of the guest OS, the network interface name pattern, the default shell, the disk sector sizes and the minimum VM disk size — Image passport.
  • You can keep the browser tab that runs the upload open until the file transfer ends.

1. Select the file​

  1. In the left menu, select Provider Data Center → Image library. The Images tab opens.
  2. Click Add image and open the File tab. If the tab is inactive and shows Insufficient permissions, the role does not have the Upload OS Image privilege.
  3. Click the Click to choose a file area and select the file, or drag the file into this area.

The name and the size of the selected file appear instead of the area. If the file does not meet the requirements, an error is shown below it: Only .zfs files are supported, The file is empty or The file is larger than <limit>, the limit of the cluster.

2. Fill in the passport​

A file has no image description, unlike an image from a source, so you set the image properties manually. Center configures every VM made from this image according to them.

FieldWhat to enter
NameLowercase Latin letters, digits, dot, underscore and hyphen, up to 64 characters. The name does not have to be unique
Owner VDCThe VDC that will own the image. The field is shown for all roles except Cluster master; if there is only one VDC, it is selected automatically
VersionA whole number from 1
OS typeThe OS family of the image, for example Linux, FreeBSD or Windows
Guest customizationThe initial configuration method that the OS of the image understands: Cloud-init: SmartOS and other cloud-init options, or Cloud-base for Cloudbase-Init
DescriptionOptional, up to 64 characters
Minimum VM disk sizeIn gigabytes, a whole number; 4 by default. A VM made from this image gets a disk of at least this size
Link schemeThe network interface name pattern in the guest OS, up to 32 characters. %d is replaced with the interface number, for example eth%d or enp0s%d
Interface numbering starts at 0Turn it on if the interfaces in the guest OS are numbered from zero
Default shellThe path to the shell in the guest OS, for example /bin/sh, up to 64 characters
Logical sector size, bytes512 by default
Physical sector size, bytes4096 by default

The form has no field for UEFI boot: below the fields, it says Only images that boot in UEFI mode are supported. While a field is empty or filled in incorrectly, the Next and Upload buttons are inactive.

If Could not load OS types and customizations. is shown instead of OS type and Guest customization, click Try again.

3. Select pools and start the upload​

  1. Click Next. The list of pools opens, all of them selected; below the list — how much space the copies take: the file size multiplied by the number of selected pools.
  2. Clear the pools where you do not need the image. You cannot clear the last selected pool.
  3. Click Upload.

If there is no Next button, your role has no pool selection step: click Upload on the first step, and Center distributes the image to all pools of the cluster.

The web interface shows the notification Upload of image <name> has started, closes the window and opens the panel of the new image. The catalog shows the image row with the Waiting for the file status, then Uploading the file with the transferred volume and the speed. The upload is also visible in the Tasks section — Tasks.

4. Wait until the file is received​

The file is transferred by the browser tab where you started the upload:

  • Do not close or reload this tab while the file is being transferred: the browser asks for confirmation before closing. If you close the tab, the upload stops, and you need to start it again. Signing out of the web interface also cancels the uploads of this tab.
  • If the connection is lost, the status shows No connection, retrying. When the connection is restored, the transfer continues from where it stopped. If the connection is not restored within 15 minutes, the upload stops: Upload of <name> stopped: the connection to the server did not come back within 15 minutes.

When the whole file has been received, the web interface shows the notification The file of <name> has been received: it is being checked and distributed to the pools. You can now close the tab: the status changes to Checking the file and then to Importing.

Other users see the upload row and its status, but not the transferred volume and the speed: only the tab that transfers the file has this data.

Check the result​

  • The image status is Available.
  • In the Availability column, the number of pools with a copy equals the number of selected pools.
  • In the Origin block of the image panel, the source is File.

Create a VM from the image and check that the guest OS has booted and received the host name and the password set when creating the VM — Create a VM.

Cancel the upload​

You can cancel an upload until the whole file has been received. The user who started the upload can cancel it from the same browser tab, and the Cluster master can cancel any upload.

  1. In the image row, select Actions → Cancel upload, or click Cancel upload in the image panel.

The web interface shows the notification Upload of image <name> has been cancelled. The row stays in the catalog with the Failure status and the reason The upload was cancelled — remove it with the Delete command — Delete an image.

If the file has already been received, you cannot cancel the upload: The file has already been received, so the upload cannot be cancelled. Delete the image once it appears in the catalogue.

Troubleshooting​

If Center has not started the upload, the window stays open, and the web interface shows a notification:

NotificationWhat to do
You have reached the limit of unfinished uploads. Wait for one of them to finish or cancel itYou already have three unfinished uploads. Wait for one of them to finish or cancel it
Select the VDC that will own the imageSelect the VDC in the Owner VDC field
You cannot upload images to the selected VDCSelect a VDC where you have the VDC admin role
The selected pool is unavailableOpen the window again and select pools from the list
The selected OS type or customization is no longer available. Reload the page and choose againReload the page and fill in the passport again

If the file transfer has stopped, the web interface shows the notification Upload of <name> stopped: … with the reason:

Reason in the notificationWhat to do
the connection to the server did not come back within 15 minutesStart the upload again
the session has ended. Sign in and start the upload againSign in to the web interface and start the upload again
the file is larger than the cluster allowsReduce the file size or ask the cluster administrator to increase the limit
not enough space on the server for the fileContact the cluster administrator
the file reception service is unavailable or misconfiguredContact the cluster administrator
it was cancelled or expired on the serverStart the upload again

If the upload or the distribution has failed after it started, the image status is Failure, and the reason is in the Failure reason field of the image panel:

Failure reasonWhat to do
The file transfer did not start in timeThe transfer did not start within 15 minutes after the upload started. Start the upload again
The file transfer stopped and did not resumeStart the upload again
Not enough space on the server to receive the fileContact the cluster administrator
The server could not check the received fileStart the upload again
No pool is available to distribute the image toNone of the selected pools is available. Start the upload again and select pools from the list
Distribution to pools failedThe nodes did not accept the file. Check that the file is a full zfs send stream of a ZFS volume, and upload it again

Remove the failed row with the Delete command — Delete an image.

Next​

API methods: direct-image-upload-init, direct-image-upload-cancel, vm-dictionaries-list, golden-images-list — in the API reference.