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
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
-
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 commandopenstack 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-9ais 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 theopenstack volume type listcommand 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.
-
Optional: verify that the created volume is in the
AVAILABLEstatus:openstack volume show <volume> -c statusSpecify
<volume>— ID or name of the network volume. You can view the list of volumes using the commandopenstack volume list.
3. Create a custom image from a volume
-
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 commandopenstack 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
-
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:biosoruefi; -
<video_model>— graphics device driver:vgaorqxl; -
<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 thevirtionetwork 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 commandopenstack image list.
-
5. Delete a network volume
-
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 commandopenstack volume list.