Skip to content

Custom images

Along with the community supported images, there are many sources of images around the Internet.

Importing VMWare VMs: In most cases, importing your Linux VMs only require to install the package cloud-init before creating an image from the .vmdk disk file. For a Debian VM for instance :

  • In your running VM run sudo apt install cloud-init
  • Export your VM disk to a single vmdk file.
  • Then from the hypervisor running your VM create an image using for example openstack image create "My Debian10 vmware imported VM" --container-format bare --disk-format vmdk --file path_to_my-vmware-linux-vm.vmdk --private
  • When the image has been created, start a VM using for example openstack server create --flavor a4-ram8-disk20-perf1 --key-name mykeypair --network ext-net1 --image "My Debian10 vmware imported VM"

Procedure for uploading images

Along with the standard images, it is possible to create your own images. In many cases, it is better to use a standard image.

Note

  • infomaniak does not support any images other than the community ones. If there are issues using other images, support should be requested from the image provider rather than from the infomaniak cloud infrastructure support team. This may also apply to higher level services such as configuration management and monitoring thus contextualisation should be considered if the operating system is one of the standard configurations listed above.
  • Users with private images should keep a copy of the image they have uploaded in their private archives. If an image is accidentally deleted or corrupted, the user should upload a new copy as no archive is maintained within the cloud.
  • Data inside images can be accessed by members of the project. Thus, passwords should not be stored in the images and security information should be passed as part of contextualisation.
  • If you are uploading a Windows based image, please make sure that you have the VirtIO drivers installed. You can get them from cloudbase-init
  • Project members can upload their own images to their projects. These images are private, meaning that they are only available to the users of the projects they are uploaded for.
  • Image sizes are limited to 100GB

Many open source projects such as Ubuntu and Fedora now produce pre-build images which can be used for certain clouds.

Building your own images is also possible but support for these images and the virtual machines created from them should be via the image provider, such as the community mailing lists on the Internet.

As for all resources in the cloud, the owner of the instance is responsible that

  • There is automatic software updating on a regular basis to ensure security updates
  • A time synchronisation process such as NTP is enabled

As an example of how images can be uploaded, the following steps are provided.

Taking an example of the Centos8 image, the steps to upload such an image (using the command line tools) are as follows

$ wget https://cloud.centos.org/Centos/8/x86_64/images/CentOS-8-GenericCloud-8.3.2011-20201204.2.x86_64.qcow2

Having retrieved the image and authenticated to OpenStack using the openrc source, it can be uploaded to Glance as a private image (i.e. only available in the project you are authenticated for)

If not otherwise specified, it will default to LINUX image.

$ openstack image create "CentOS 8 GenericCloud" --container-format bare  --disk-format raw --file /tmp/CentOS-8-GenericCloud-8.3.2011-20201204.2.x86_64.qcow2
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                                                                     |
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| container_format | bare                                                                                                                                                      |
| created_at       | 2021-02-26T08:56:53Z                                                                                                                                      |
| disk_format      | raw                                                                                                                                                       |
| file             | /v2/images/69112d12-0acb-4321-bbc6-f2d493ab6be3/file                                                                                                      |
| id               | 69112d12-0acb-4321-bbc6-f2d493ab6be3                                                                                                                      |
| min_disk         | 0                                                                                                                                                         |
| min_ram          | 0                                                                                                                                                         |
| name             | CentOS 8 GenericCloud                                                                                                                                     |
| owner            | ac4fafd60021431585bbb23470119557                                                                                                                          |
| properties       | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/CentOS 8 GenericCloud', owner_specified.openstack.sha256='' |
| protected        | False                                                                                                                                                     |
| schema           | /v2/schemas/image                                                                                                                                         |
| status           | queued                                                                                                                                                    |
| tags             |                                                                                                                                                           |
| updated_at       | 2021-02-26T08:56:53Z                                                                                                                                      |
| visibility       | shared                                                                                                                                                    |
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+

This can then be checked using openstack image list.

Once loaded, the image can then be used to create a virtual machine. The my-key key-name should be replaced by the appropriate one for the project concerned.

taylor@laptop:~$ openstack server create --key-name mykeypair --flavor cpu2-ram6-disk20 --image "CentOS 8 GenericCloud" my-vm-name
+-----------------------------+--------------------------------------------------------------+
| Field                       | Value                                                        |
+-----------------------------+--------------------------------------------------------------+
| OS-DCF:diskConfig           | MANUAL                                                       |
| OS-EXT-AZ:availability_zone |                                                              |
| OS-EXT-STS:power_state      | NOSTATE                                                      |
| OS-EXT-STS:task_state       | scheduling                                                   |
| OS-EXT-STS:vm_state         | building                                                     |
| OS-SRV-USG:launched_at      | None                                                         |
| OS-SRV-USG:terminated_at    | None                                                         |
| accessIPv4                  |                                                              |
| accessIPv6                  |                                                              |
| addresses                   |                                                              |
| adminPass                   | Dy9vPpWnue29                                                 |
| config_drive                |                                                              |
| created                     | 2021-02-26T09:00:44Z                                         |
| flavor                      | cpu2-ram6-disk20 (2655c1e3-a43a-4dea-a957-650517e8fa72)      |
| hostId                      |                                                              |
| id                          | 28323a60-e1b2-433b-b712-902e71e73054                         |
| image                       | CentOS 8 GenericCloud (69112d12-0acb-4321-bbc6-f2d493ab6be3) |
| key_name                    | mykeypair                                                    |
| name                        | my-vm-name                                                   |
| progress                    | 0                                                            |
| project_id                  | ac4fafd60021431585bbb23470119557                             |
| properties                  |                                                              |
| security_groups             | name='default'                                               |
| status                      | BUILD                                                        |
| updated                     | 2021-02-26T09:00:44Z                                         |
| user_id                     | b1580497f51e4d10b9110c60c154562c                             |
| volumes_attached            |                                                              |
+-----------------------------+--------------------------------------------------------------+
The machine can then be accessed using ssh as centos. use openstack server list to get your VM IP.

$ ssh centos@195.15.241.77
[centos@my-vm-name ~]$

Many of these images include the cloud-init package for contextualisation. This allows easy customisation of the image after installation. See the contextualisation chapter for more details on how to use this feature.

Similar techniques can be applied to the other images in the list.

The image can be tagged with a number of different properties. Full details are available in the OpenStack documentation. It is recommended that the following properties be set

os os_distro release_date

In addition, the following options can have a performance impact

hw_rng_model

Error Messages

Error Description
Denying attempt to upload image larger than 2147483648 bytes.(HTTP 400) The maximum image size for users to upload has been exceeded. Re-build the image to be a smaller size with techniques such as ephemeral disks or external volumes
403 Forbidden.Access was denied to this resource. (HTTP 403) Only administrators can set images to be public. The --public option should not be used by non-administrators. To share images between projects, use the image sharing functions

Image Deletion

Images should only be deleted if no VM is running which was booted from that image.

Images can be deleted using the openstack image delete command.

$ openstack image delete id_of_the_image

Sources of images

Only use images from a reputable source as they could contain security issues.

Downloading an image

You have the possibility to download locally the images stored on th einfomaniak Openstack Public Cloud issuing the command :

openstack image save --file </destination/path/filename> <image_id_or_name_to_download>

Additional Information

The OpenStack documentation contains more details of how to work with images. Some features may not be configured on the infomaniak Openstack Public Cloud.