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 Configure OpenStack CLI subsection with OS tools or Configure OpenStack CLI in the Docker container of the 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 of the finished image which will be the source for disk creation. The list of images can be viewed with the commandopenstack image list
;<size>
— is the size of the disk 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 on the maximum size;<volume_type>
— ID or name of the network disk type. For example,universal2.ru-9a
— name to create a network disk with the SSD type Universal v2 in the pool segment ru-9a. The list of disk types can be viewed using the commandopenstack volume type list
or in the 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
AVAILABLE
status:openstack volume show <volume> -c status
Specify
<volume>
— the ID or name of the network disk. You can view the list of disks using theopenstack volume list
command.
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 with the commandopenstack volume list
;<disk_size>
— disk size in GB. The minimum disk size should be equal to the disk size of the of the finished image from which you created the disk. Take into account network disk limits on the maximum size;<ram_size>
— memory size in GB. The minimum memory size must be equal to the memory size of the of the finished image from which you created the disk from;<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
— the driver has no data rate limitation, but the default cloud platform limitation is 3 Gbps;
-
hw_vif_multiqueue_enabled=true
— property enables 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 name of the image. You can view the list of images with the commandopenstack image list
.
-
5. Delete a network drive
-
Delete the network drive that you created from the prepared image:
openstack volume delete <volume>
Specify
<volume>
— the ID or name of the network disk. You can view the list of disks using theopenstack volume list
command.