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 OpenStack CLI.

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

  3. Create a custom image from a volume.

  4. Apply properties to a custom image.

  5. Delete a network volume.

1. Configure OpenStack CLI

Use the Configure OpenStack CLI in the OS or Configure OpenStack CLI in a Docker container section of the OpenStack CLI instructions.

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

  1. Open 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 ready-made image that will be the source for creating the volume. You can view the list of images using the openstack image list;
    • <size> — disk size in GB. The minimum disk size must be equal to the source size from which it was created. Take into account network volume limits on the maximum size;
    • <volume_type> — ID or name of the network volume type. For example, universal2.ru-9a — name for creating a network volume of type SSD Universal v2 in the pool segment ru-9a. The list of disk types can be viewed using the openstack volume type list command or in the List of network volume types in all pool segments;
    • <pool_segment>pool segment where the image will be loaded, for example, ru-9a. A list of available pool segments can be viewed in the Servercore Infrastructure;
    • <volume_name> — volume name.
  3. Optionally, check 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 openstack volume list.

3. Create a custom image from a volume

  1. Open 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 openstack volume list;
    • <disk_size> — disk size in GB. The minimum disk size must be equal to the disk size of the ready-made image from which you created the volume. Take into account network volume limits on the maximum size;
    • <ram_size> — memory size in GB. The minimum memory size must be equal to the memory size of the ready-made image from which you created the volume;
    • <image_name> — image name.

4. Apply properties to a custom image

  1. Open 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> — type of virtual network card driver:

      • e1000 — with a data transfer speed of up to 1 Gbit/s;
      • e1000e — with a data transfer speed of up to 2.5 Gbit/s;
      • virtio — the driver has no data transfer speed limit, but the cloud platform default limit is 3 Gbit/s;
    • hw_vif_multiqueue_enabled=true — this property enables the network driver virtio to use multiple vCPUs. This is required to increase the data transfer speed from 3 Gbit/s to 5 Gbit/s;

    • <image> — ID or name of the image. The list of images can be viewed using the openstack image list.

5. Delete a network volume

  1. Open OpenStack CLI.

  2. Delete the network volume that you created from a ready-made image:

    openstack volume delete <volume>

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