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
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
-
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 commandopenstack 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 commandopenstack 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.
-
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 commandopenstack volume list
.
3. Create your own image from a disk
-
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 commandopenstack 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
-
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
oruefi
; -
<video_model>
- graphics device driver:vga
orqxl
; -
<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 thevirtio
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 commandopenstack image list
.
-
5. Delete a network drive
-
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 commandopenstack volume list
.