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
.zfsextension 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.
- has the
- 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
- In the left menu, select Provider Data Center → Image library. The Images tab opens.
- 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.
- 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.
| Field | What to enter |
|---|---|
| Name | Lowercase Latin letters, digits, dot, underscore and hyphen, up to 64 characters. The name does not have to be unique |
| Owner VDC | The 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 |
| Version | A whole number from 1 |
| OS type | The OS family of the image, for example Linux, FreeBSD or Windows |
| Guest customization | The initial configuration method that the OS of the image understands: Cloud-init: SmartOS and other cloud-init options, or Cloud-base for Cloudbase-Init |
| Description | Optional, up to 64 characters |
| Minimum VM disk size | In gigabytes, a whole number; 4 by default. A VM made from this image gets a disk of at least this size |
| Link scheme | The 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 0 | Turn it on if the interfaces in the guest OS are numbered from zero |
| Default shell | The path to the shell in the guest OS, for example /bin/sh, up to 64 characters |
| Logical sector size, bytes | 512 by default |
| Physical sector size, bytes | 4096 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
- 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.
- Clear the pools where you do not need the image. You cannot clear the last selected pool.
- 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.
- 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:
| Notification | What to do |
|---|---|
| You have reached the limit of unfinished uploads. Wait for one of them to finish or cancel it | You already have three unfinished uploads. Wait for one of them to finish or cancel it |
| Select the VDC that will own the image | Select the VDC in the Owner VDC field |
| You cannot upload images to the selected VDC | Select a VDC where you have the VDC admin role |
| The selected pool is unavailable | Open the window again and select pools from the list |
| The selected OS type or customization is no longer available. Reload the page and choose again | Reload 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 notification | What to do |
|---|---|
| the connection to the server did not come back within 15 minutes | Start the upload again |
| the session has ended. Sign in and start the upload again | Sign in to the web interface and start the upload again |
| the file is larger than the cluster allows | Reduce the file size or ask the cluster administrator to increase the limit |
| not enough space on the server for the file | Contact the cluster administrator |
| the file reception service is unavailable or misconfigured | Contact the cluster administrator |
| it was cancelled or expired on the server | Start 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 reason | What to do |
|---|---|
| The file transfer did not start in time | The transfer did not start within 15 minutes after the upload started. Start the upload again |
| The file transfer stopped and did not resume | Start the upload again |
| Not enough space on the server to receive the file | Contact the cluster administrator |
| The server could not check the received file | Start the upload again |
| No pool is available to distribute the image to | None of the selected pools is available. Start the upload again and select pools from the list |
| Distribution to pools failed | The 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
- Create a VM
- Delete an image
- Image library — how the catalog and the distribution to pools work.
API methods: direct-image-upload-init, direct-image-upload-cancel, vm-dictionaries-list, golden-images-list — in the API reference.