Skip to main content

Modify a ready-made image

You can modify ready-made images — for example, reformat an image to increase the data transfer speed to 5 Gbit/s or enable UEFI booting for the image.

  1. Configure the OpenStack CLI.

  2. Create a network volume from a default image.

  3. Create a custom image from a volume.

  4. Apply properties to the custom image.

  5. Delete the network volume.

1. Configure OpenStack CLI

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

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

  1. Open the OpenStack CLI.

  2. Create a volume:

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

    Specify:

    • <image> — ID or name of the default image that will be used as a source to create the volume. You can view the list of images using the command openstack image list;
    • <size> — volume size in GB. The minimum volume size must be equal to the size of the source it was created from. Keep in mind the network volume limits on maximum size;
    • <volume_type> — ID or name of the network volume type. For example, universal2.ru-9a is the name for creating a network volume of the Universal SSD v2 type in the pool segment ru-9a. You can view the list of volume types using the openstack volume type list command or in the List of network volume types across all pool segments;
    • <pool_segment> — pool segment where the image will be uploaded, for example, ru-9a. You can view the list of available pool segments in the Selectel infrastructure;
    • <volume_name> — volume name.
  3. Optional: verify that the created volume is in the AVAILABLE status:

    openstack volume show <volume> -c status

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

3. Create a custom image from a volume

  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 volume. You can view the list of volumes 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 default image from which you created the volume. Keep in mind the network volume limits on maximum size;
    • <ram_size> — RAM size in GB. The minimum RAM size must be equal to the RAM size of the default image from which you created the volume;
    • <image_name> — image name.

4. Apply properties to a custom image

  1. Open the OpenStack CLI.

  2. Optionally, add one or more required 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 interface card driver type:

      • e1000 — with a data transfer rate of up to 1 Gbps;
      • e1000e — with a data transfer rate of up to 2.5 Gbps;
      • virtio — the driver has no data transfer rate limits, but the default Cloud Platform limit is 3 Gbps;
    • hw_vif_multiqueue_enabled=true — the property enables the virtio network driver to use multiple vCPUs. This is required to increase the data transfer rate from 3 Gbps to 5 Gbps;

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

5. Delete a network volume

  1. Open the OpenStack CLI.

  2. Delete the network volume that you created from the default image:

    openstack volume delete <volume>

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