Skip to main content
Modify the finished image
Last update:

Modify the finished image

You can modify ready-made images — for example, convert the image to increase the data transfer rate to 5 Gbps or enable UEFI booting for the image.

  1. Configure the OpenStack CLI.

  2. Create a network disk from a ready-made image.

  3. Create your own image from the disk.

  4. Apply the properties to your own image.

  5. Delete the network drive.

1. Configure the OpenStack CLI

Use the subsection Configure OpenStack CLI using OS tools or Configure OpenStack CLI in a Docker container OpenStack CLI instructions.

2. Create a network disk from a ready-made image

  1. Open the OpenStack CLI.

  2. Create a disk:

    openstack volume create \
    --image <image> \
    --size <size> \
    --type <volume_type> \
    --availability-zone <pool_segment> \
    <volume_name>

    Specify:

    • <image> — ID or name finished image which will be the source for creating the disk. The list of images can be viewed using the command openstack image list;
    • <size> — disk size in GB. For a disk, the minimum size must be equal to the size of the source from which it was created. Take into account network disk limits to the maximum size;
    • <volume_type> — ID or name network drive type. For example, universal2.ru-9a — name to create a network drive with the SSD Universal v2 type in the pool segment ru-9a. The list of disk types can be viewed using the command openstack volume type list or in a table List of network disk types in all pool segments;
    • <pool_segment> — pool segment into which the image will be loaded, e.g. ru-9a. The list of available pool segments can be viewed in the table below Selectel Infrastructure;
    • <volume_name> — disk name.
  3. Optional: check that the created disk is in status AVAILABLE:

    openstack volume show <volume> -c status

    Specify <volume> — ID or name of the network disk. You can view the list of disks using the command openstack volume list.

3. Create your own image from a disk

  1. Open the OpenStack CLI.

  2. Create an image:

    openstack image create \
    --volume <volume> \
    --min-disk <disk_size> \
    --min-ram <ram_size> \
    <image_name>

    Specify:

    • <volume> — ID or name of the network disk. You can view the list of disks using the command openstack volume list;
    • <disk_size> — disk size in GB. The minimum disk size must be equal to the disk size of the disk finished image from which you created a disk. Take into account network disk limits to the maximum size;
    • <ram_size> — memory size in GB. The minimum memory size must be equal to the memory size finished image from which you created a disk;
    • <image_name> — image name.

4. Apply the properties to your own image

  1. Open the OpenStack CLI.

  2. Optionally add one or more desired properties:

    openstack image set \
    --property hw_cpu_sockets <sockets>\
    --property hw_cpu_cores <cores>\
    --property hw_cpu_threads <threads> \
    --property hw_firmware_type <firmware_type> \
    --property hw_video_model <video_model> \
    --property hw_vif_model <vif_model> \
    --property hw_vif_multiqueue_enabled=true \
    <image>

    Specify:

    • <sockets> — number of CPU sockets;

    • <cores> — number of CPU cores;

    • <threads> — number of CPU threads;

    • <firmware_type> — firmware type: bios or uefi;

    • <video_model>- graphics device driver: vga or qxl;

    • <vif_model> — virtual network card driver type:

      • e1000 — with data transfer rates of up to 1 Gbps;
      • e1000e — with data transfer rates of up to 2.5 Gbps;
      • virtio — driver has no data rate limitation, but the default cloud platform limitation is 3 Gbps;
    • hw_vif_multiqueue_enabled=true — property includes the ability for the network driver to use the virtio multiple vCPUs. This is necessary to increase the data transfer rate from 3 Gbps to 5 Gbps;

    • <image> — ID or image name. You can view the list of images using the command openstack image list.

5. Delete a network drive

  1. Open the OpenStack CLI.

  2. Delete the network drive that you created from an off-the-shelf image:

    openstack volume delete <volume>

    Specify <volume>  — ID or name of the network drive. You can view the list of disks using the command openstack volume list.