Creating an image with diskimage-builder
The list of supported images is available in the official documentation of the diskimage-builder utility.
As an example, this guide covers creating and configuring a VM image with the OpenSuse Leap OS. All actions are performed on a local computer running Ubuntu.
- Free up at least 3 GB of disk space on your computer.
- Connect your computer to a network with internet access.
-
Set up Python library support:
sudo apt updatesudo apt -y install python-pip curl -
Install the
qemu-utilspackage, which provides QEMU utilities:sudo apt install qemu-utils -
Install the
virtualenvapplication for creating a Python virtual environment, as described in the official documentation. -
Find out the version of Python installed on your computer:
python –version -
Create and activate a Python virtual environment by running the commands one by one:
virtualenv -p python<PYTHON_VERSION> venv_py<PYTHON_VERSION>source venv_py<PYTHON_VERSION>/bin/activate -
Install the
diskimage-builderutility:pip install git+https://opendev.org/openstack/diskimage-builder.git
Run the command:
DIB_RELEASE=15.3 disk-image-create -t raw -o opensuse-15.3.raw vm opensuse
A file named opensuse-15.3.raw with a VM image in RAW format will be created.
-
Make sure that the OpenStack client is installed and pass authentication in your VK Cloud project.
-
Upload the
opensuse-15.3.rawimage to VK Cloud under the nameOpensuse:openstack image create \--progress \--private \--container-format bare \--disk-format raw \--file opensuse-15.3.raw \--property store=s3 \--property hw_qemu_guest_agent=True \--property os_require_quiesce=yes \--property mcs_name='Opensuse' \OpensuseHere, arguments of the form
--property <KEY>=<VALUE>are used to assign {metadata tags to the image.
- Go to the VK Cloud management console.
- Navigate to the Cloud Computing → Images section.
- Make sure that the list contains an image named
Opensuse.
If you no longer need the uploaded image, delete it.