{"id":14432,"date":"2022-10-12T01:09:42","date_gmt":"2022-10-11T22:09:42","guid":{"rendered":"https:\/\/kifarunix.com\/?p=14432"},"modified":"2024-06-17T17:32:48","modified_gmt":"2024-06-17T14:32:48","slug":"create-and-upload-custom-linux-image-into-openstack","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/create-and-upload-custom-linux-image-into-openstack\/","title":{"rendered":"Create and Upload Custom Linux Image into OpenStack"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to create and upload custom Linux image into OpenStack. An image is <em>a single file that contains a virtual disk that contains a bootable operating system<\/em>. It is possible to create your own custom Linux images and upload them to OpenStack for your own use.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#create-upload-custom-linux-image-into-open-stack\">Create\/Upload Custom Linux Image into OpenStack<\/a><ul><li><a href=\"#how-to-create-your-own-custom-linux-image-for-open-stack\">How to Create Your own Custom Linux Image for OpenStack<\/a><ul><li><a href=\"#download-the-installation-iso-file\">Download the installation ISO file<\/a><\/li><li><a href=\"#install-virtualization-tool-on-your-host-system-such-as-kvm\">Install virtualization tool on your host system such as KVM<\/a><\/li><li><a href=\"#install-the-linux-vm-on-the-virtualization-tool-such-as-kvm\">Install the Linux vm on the virtualization tool such as KVM<\/a><\/li><li><a href=\"#install-cloud-init-package-on-the-virtual-machine\">Install Cloud-init Package on the Virtual Machine<\/a><\/li><\/ul><\/li><li><a href=\"#create-custom-linux-image-into-open-stack\">Create Custom Linux Image into OpenStack<\/a><ul><li><a href=\"#copy-the-image-to-open-stack\">Copy the Image to OpenStack<\/a><\/li><li><a href=\"#create-custom-linux-image-on-open-stack-horizon\">Create Custom Linux Image on OpenStack Horizon<\/a><\/li><li><a href=\"#create-custom-linux-image-on-open-stack-cli\">Create Custom Linux Image on OpenStack CLI<\/a><\/li><\/ul><\/li><li><a href=\"#other-tutorials\">Other Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-upload-custom-linux-image-into-open-stack\">Create\/Upload Custom Linux Image into OpenStack<\/h2>\n\n\n\n<p>By default, when you install OpenStack, it will have a single test image called <a href=\"https:\/\/docs.openstack.org\/image-guide\/obtain-images.html#cirros-test\" target=\"_blank\" rel=\"noreferrer noopener\">CirrOS<\/a>.<\/p>\n\n\n\n<p>You can confirm the same from the OpenStack horizon;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1901\" height=\"741\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-test-image-cirros.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14433\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-test-image-cirros.png?v=1665507420 1901w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-test-image-cirros-768x299.png?v=1665507420 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-test-image-cirros-1536x599.png?v=1665507420 1536w\" sizes=\"(max-width: 1901px) 100vw, 1901px\" \/><\/figure>\n\n\n\n<p>Or, just check available images using <strong><code>openstack<\/code><\/strong> command line tool.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source admin-openrc.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>openstack image list<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>+--------------------------------------+--------------------------+--------+\n| ID                                   | Name                     | Status |\n+--------------------------------------+--------------------------+--------+\n| 5cad7ba3-851b-4b87-a762-8506cf803965 | cirros-0.5.2-x86_64-disk | active |\n+--------------------------------------+--------------------------+--------+\n<\/code><\/pre>\n\n\n\n<p>So, in most cases, you might want to create and upload your own custom Linux image into OpenStack.<\/p>\n\n\n\n<p>You can use the <a href=\"https:\/\/docs.openstack.org\/image-guide\/obtain-images.html\" target=\"_blank\" rel=\"noreferrer noopener\">images that have already been created<\/a> or simply create your own custom image and upload it to openstack.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-create-your-own-custom-linux-image-for-open-stack\">How to Create Your own Custom Linux Image for OpenStack<\/h3>\n\n\n\n<p>To create your own custom Linux image for OpenStack;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"download-the-installation-iso-file\">Download the installation ISO file<\/h4>\n\n\n\n<p>Download the installation ISO file for the specific Linux distro you want to use on OpenStack. For example, we will use <a href=\"https:\/\/cdimage.ubuntu.com\/ubuntu\/releases\/\" target=\"_blank\" rel=\"noopener\">Ubuntu 22.04 headless server <\/a>image as an example in this guide.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-virtualization-tool-on-your-host-system-such-as-kvm\">Install virtualization tool on your host system such as KVM<\/h4>\n\n\n\n<p>You need to have virtualization tool such as KVM\/VirtualBox etc installed on your host system or somewhere else that enables you to create your custom Linux image.<\/p>\n\n\n\n<p>See example <a href=\"https:\/\/kifarunix.com\/install-kvm-on-oracle-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install KVM on Oracle Linux<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-the-linux-vm-on-the-virtualization-tool-such-as-kvm\">Install the Linux vm on the virtualization tool such as KVM<\/h4>\n\n\n\n<p>Once you have virtualization tool and ISO file ready, you need to install the VM and customize it in preparation to upload to OpenStack.<\/p>\n\n\n\n<p>In this guide, we are using KVM as our virtualization platform.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Thus, launch the virtual machine manager and create and install new Linux vm as follows;<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"555\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/create-new-kvm-machine.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14440\" title=\"\"><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Choose the ISO installation file and select OS type as Generic if not automatically detected.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"804\" height=\"549\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/attach-iso-installation-file.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14441\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/attach-iso-installation-file.png?v=1665519079 804w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/attach-iso-installation-file-768x524.png?v=1665519079 768w\" sizes=\"(max-width: 804px) 100vw, 804px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Choose memory and CPU settings;<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"566\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-memory-cpu-settings.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14442\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-memory-cpu-settings.png?v=1665519101 799w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-memory-cpu-settings-768x544.png?v=1665519101 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Create a disk image for the virtual machine;<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"579\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-storage-settings.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14443\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-storage-settings.png?v=1665519124 818w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/vm-storage-settings-768x544.png?v=1665519124 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Set the name of the VM and click &#8220;<strong>Customize Configuration before install<\/strong>&#8220;<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"554\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/set-name-of-the-vm.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14444\" title=\"\"><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>Finish<\/strong>.<\/li>\n\n\n\n<li>Change the disk bus type from IDE to VirtIO and apply the changes.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"724\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/disk-bus-type-virtio.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14445\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/disk-bus-type-virtio.png?v=1665519170 963w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/disk-bus-type-virtio-768x577.png?v=1665519170 768w\" sizes=\"(max-width: 963px) 100vw, 963px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Change network interface device model to VirtIO as well;<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"724\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/network-device-model-virtio.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14446\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/network-device-model-virtio.png?v=1665519202 961w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/network-device-model-virtio-768x579.png?v=1665519202 768w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Apply the changes and click <strong>Begin the installation<\/strong>.<\/li>\n\n\n\n<li>Proceed with the VM installation as usual&#8230;<\/li>\n\n\n\n<li>Under storage configuration, you can use entire disk and set it as lvm group.<\/li>\n\n\n\n<li>create usernames and install SSH<\/li>\n\n\n\n<li>and proceed with vm setup on KVM.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-cloud-init-package-on-the-virtual-machine\">Install Cloud-init Package on the Virtual Machine<\/h4>\n\n\n\n<p><em><a href=\"https:\/\/cloudinit.readthedocs.io\/en\/latest\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cloud-init<\/a> is the&nbsp;industry standard&nbsp;multi-distribution method for cross-platform cloud instance initialization.<\/em> It enables you to <em>resize root partition on boot automatically, access instance using ssh public key, update vm hostname to match the name given and process user data and other metadata on the vm<\/em>.<\/p>\n\n\n\n<p>Once the vm boots, login and install cloud-init package;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install cloud-init<\/code><\/pre>\n\n\n\n<p><code>\/etc\/cloud\/cloud.cfg<\/code> is the cloud-init configuration file and this is how it looks by default;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/cloud\/cloud.cfg<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code># The top level settings are used as module\n# and system configuration.\n# A set of users which may be applied and\/or used by various modules\n# when a 'default' entry is found it will reference the 'default_user'\n# from the distro configuration specified below\nusers:\n   - default\n\n\n# If this is set, 'root' will not be able to ssh in and they\n# will get a message to login instead as the default $user\ndisable_root: true\n\n# This will cause the set+update hostname module to not operate (if true)\npreserve_hostname: false\n\n# If you use datasource_list array, keep array items in a single line.\n# If you use multi line array, ds-identify script won't read array items.\n# Example datasource config\n# datasource:\n#    Ec2:\n#      metadata_urls: [ 'blah.com' ]\n#      timeout: 5 # (defaults to 50 seconds)\n#      max_wait: 10 # (defaults to 120 seconds)\n\n\n\n\n# The modules that run in the 'init' stage\ncloud_init_modules:\n - migrator\n - seed_random\n - bootcmd\n - write-files\n - growpart\n - resizefs\n - disk_setup\n - mounts\n - set_hostname\n - update_hostname\n - update_etc_hosts\n - ca-certs\n - rsyslog\n - users-groups\n - ssh\n\n# The modules that run in the 'config' stage\ncloud_config_modules:\n - snap\n - ssh-import-id\n - keyboard\n - locale\n - set-passwords\n - grub-dpkg\n - apt-pipelining\n - apt-configure\n - ubuntu-advantage\n - ntp\n - timezone\n - disable-ec2-metadata\n - runcmd\n - byobu\n\n# The modules that run in the 'final' stage\ncloud_final_modules:\n - package-update-upgrade-install\n - fan\n - landscape\n - lxd\n - ubuntu-drivers\n - write-files-deferred\n - puppet\n - chef\n - mcollective\n - salt-minion\n - reset_rmc\n - refresh_rmc_and_interface\n - rightscale_userdata\n - scripts-vendor\n - scripts-per-once\n - scripts-per-boot\n - scripts-per-instance\n - scripts-user\n - ssh-authkey-fingerprints\n - keys-to-console\n - install-hotplug\n - phone-home\n - final-message\n - power-state-change\n\n# System and\/or distro specific settings\n# (not accessible to handlers\/transforms)\nsystem_info:\n   # This will affect which distro class gets used\n   distro: ubuntu\n   # Default user name + that default users groups (if added\/used)\n   default_user:\n     name: ubuntu\n     lock_passwd: True\n     gecos: Ubuntu\n     groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]\n     sudo: [\"ALL=(ALL) NOPASSWD:ALL\"]\n     shell: \/bin\/bash\n   network:\n     renderers: ['netplan', 'eni', 'sysconfig']\n   # Automatically discover the best ntp_client\n   ntp_client: auto\n   # Other config here will be given to the distro class and\/or path classes\n   paths:\n      cloud_dir: \/var\/lib\/cloud\/\n      templates_dir: \/etc\/cloud\/templates\/\n   package_mirrors:\n     - arches: [i386, amd64]\n       failsafe:\n         primary: http:\/\/archive.ubuntu.com\/ubuntu\n         security: http:\/\/security.ubuntu.com\/ubuntu\n       search:\n         primary:\n           - http:\/\/%(ec2_region)s.ec2.archive.ubuntu.com\/ubuntu\/\n           - http:\/\/%(availability_zone)s.clouds.archive.ubuntu.com\/ubuntu\/\n           - http:\/\/%(region)s.clouds.archive.ubuntu.com\/ubuntu\/\n         security: []\n     - arches: [arm64, armel, armhf]\n       failsafe:\n         primary: http:\/\/ports.ubuntu.com\/ubuntu-ports\n         security: http:\/\/ports.ubuntu.com\/ubuntu-ports\n       search:\n         primary:\n           - http:\/\/%(ec2_region)s.ec2.ports.ubuntu.com\/ubuntu-ports\/\n           - http:\/\/%(availability_zone)s.clouds.ports.ubuntu.com\/ubuntu-ports\/\n           - http:\/\/%(region)s.clouds.ports.ubuntu.com\/ubuntu-ports\/\n         security: []\n     - arches: [default]\n       failsafe:\n         primary: http:\/\/ports.ubuntu.com\/ubuntu-ports\n         security: http:\/\/ports.ubuntu.com\/ubuntu-ports\n   ssh_svcname: ssh\n<\/code><\/pre>\n\n\n\n<p>In most cases, the default settings works fine.<\/p>\n\n\n\n<p>If you want to update hosts file to use the name of the vm, add the line <strong><code>manage_etc_hosts: true<\/code><\/strong> to cloud.cfg file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-custom-linux-image-into-open-stack\">Create Custom Linux Image into OpenStack<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"copy-the-image-to-open-stack\">Copy the Image to OpenStack<\/h4>\n\n\n\n<p>Shutdown the virtual machine from the <strong><code>virt-manager<\/code><\/strong> or from command line.<\/p>\n\n\n\n<p>On the host running KVM, you can find the image details;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>qemu-img info \/media\/kifarunix\/vol02\/kvm\/images\/ubuntu22.04.qcow2<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>image: \/media\/kifarunix\/vol02\/kvm\/images\/ubuntu22.04.qcow2\nfile format: qcow2\nvirtual size: 6 GiB (6442450944 bytes)\ndisk size: 3.73 GiB\ncluster_size: 65536\nFormat specific information:\n    compat: 1.1\n    lazy refcounts: true\n    refcount bits: 16\n    corrupt: false\n<\/code><\/pre>\n\n\n\n<p>Copy its image to OpenStack node;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -avP path\/vm-name.qcow2 username@openstack:<\/code><\/pre>\n\n\n\n<p>You can now either create OpenStack Image from Horizon or create it on command line.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"create-custom-linux-image-on-open-stack-horizon\">Create Custom Linux Image on OpenStack Horizon<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login to horizon as administrator;<\/li>\n\n\n\n<li>Select the project, e.g admin project and navigate to <strong>Project &gt; Compute &gt; Images &gt; +Create Image<\/strong> or <strong>Admin &gt; Compute &gt; Images <strong>&gt; +Create Image<\/strong><\/strong>.<\/li>\n\n\n\n<li>Under <strong>Image details;<\/strong>\n<ul class=\"wp-block-list\">\n<li>Image Name<\/li>\n\n\n\n<li>Image Description<\/li>\n\n\n\n<li>Image Source &gt; Choose the image from your host or kvm hosts as long as you can access the image.<\/li>\n\n\n\n<li>Enter the image format e.g QCOW2 (Use the <strong>qemu-img info<\/strong> command to confirm, refer above)<\/li>\n\n\n\n<li>Define image requirements, we only set minimum disk and RAM here.<\/li>\n\n\n\n<li>Choose your appropriate image visibility. We leave it as public.<\/li>\n\n\n\n<li>Protected: No<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1467\" height=\"814\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/jellyfish-openstack-image.png\" alt=\"\" class=\"wp-image-18714\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/jellyfish-openstack-image.png?v=1694111447 1467w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/jellyfish-openstack-image-768x426.png?v=1694111447 768w\" sizes=\"(max-width: 1467px) 100vw, 1467px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Under Metadata, we left the defaults.<\/li>\n\n\n\n<li>Click <strong>Create Image<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>After a short while, the image should now be created and available under images;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1903\" height=\"568\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/new-openstack-image-created.png\" alt=\"\" class=\"wp-image-14454\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/new-openstack-image-created.png?v=1665522289 1903w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/new-openstack-image-created-768x229.png?v=1665522289 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/new-openstack-image-created-1536x458.png?v=1665522289 1536w\" sizes=\"(max-width: 1903px) 100vw, 1903px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"create-custom-linux-image-on-open-stack-cli\">Create Custom Linux Image on OpenStack CLI<\/h4>\n\n\n\n<p id=\"block-032782a6-ec28-46b0-83cf-247699aba183\">Shutdown the virtual machine and copy its image to OpenStack node;<\/p>\n\n\n\n<pre id=\"block-3c28b05a-3be1-46c3-910a-112631291337\" class=\"wp-block-code\"><code>rsync -avP path\/vm-name.qcow2 username@openstack:<\/code><\/pre>\n\n\n\n<p>If you are CLI centric, you can create custom Linux image on OpenStack CLI using <strong><code>openstack image create <\/code><\/strong>or <strong><code>glance image-create<\/code><\/strong> commands;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openstack image create -h<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>usage: openstack image create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--noindent] [--prefix PREFIX] [--max-width &lt;integer>] [--fit-width] [--print-empty]\n                              [--id &lt;id>] [--container-format &lt;container-format>] [--disk-format &lt;disk-format>] [--min-disk &lt;disk-gb>] [--min-ram &lt;ram-mb>]\n                              [--file &lt;file> | --volume &lt;volume>] [--force] [--progress] [--sign-key-path &lt;sign-key-path>] [--sign-cert-id &lt;sign-cert-id>]\n                              [--protected | --unprotected] [--public | --private | --community | --shared] [--property &lt;key=value>] [--tag &lt;tag>] [--project &lt;project>]\n                              [--import] [--project-domain &lt;project-domain>]\n                              &lt;image-name>\n<\/code><\/pre>\n\n\n\n<p>Example;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>openstack image create \\\n\t--container-format bare \\\n\t--disk-format qcow2 \\\n\t--file .\/ubuntu22.04.qcow2 \\\n\t--progress \\\n\t--public \\\n\t--project admin \\\n\tjellyfish\n<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>[=============================&gt;] 100%\n+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+\n| Field            | Value                                                                                                                                         |\n+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+\n| container_format | bare                                                                                                                                          |\n| created_at       | 2022-10-11T21:17:13Z                                                                                                                          |\n| disk_format      | qcow2                                                                                                                                         |\n| file             | \/v2\/images\/ba33ea97-710d-4c14-9283-18f27de74e56\/file                                                                                          |\n| id               | ba33ea97-710d-4c14-9283-18f27de74e56                                                                                                          |\n| min_disk         | 0                                                                                                                                             |\n| min_ram          | 0                                                                                                                                             |\n| name             | jellyfish                                                                                                                                     |\n| owner            | a95d364c2b564742b1d3e7da4c8e294e                                                                                                              |\n| properties       | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images\/jellyfish', owner_specified.openstack.sha256='' |\n| protected        | False                                                                                                                                         |\n| schema           | \/v2\/schemas\/image                                                                                                                             |\n| status           | queued                                                                                                                                        |\n| tags             |                                                                                                                                               |\n| updated_at       | 2022-10-11T21:17:13Z                                                                                                                          |\n| visibility       | public                                                                                                                                        |\n+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+\n<\/code><\/pre>\n\n\n\n<p>To use <strong><code>glance image-create<\/code><\/strong>;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>glance image-create -h<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>usage: glance [--version] [-d] [-v] [--get-schema] [-f] [--os-image-url OS_IMAGE_URL] [--os-image-api-version OS_IMAGE_API_VERSION] [--profile HMAC_KEY]\n              [--os-region-name OS_REGION_NAME] [--os-auth-token OS_AUTH_TOKEN] [--os-service-type OS_SERVICE_TYPE] [--os-endpoint-type OS_ENDPOINT_TYPE] [--insecure]\n              [--os-cacert &lt;ca-certificate&gt;] [--os-cert &lt;certificate&gt;] [--os-key &lt;key&gt;] [--timeout &lt;seconds&gt;] [--collect-timing] [--os-auth-type &lt;name&gt;]\n              [--os-auth-url OS_AUTH_URL] [--os-system-scope OS_SYSTEM_SCOPE] [--os-domain-id OS_DOMAIN_ID] [--os-domain-name OS_DOMAIN_NAME]\n              [--os-project-id OS_PROJECT_ID] [--os-project-name OS_PROJECT_NAME] [--os-project-domain-id OS_PROJECT_DOMAIN_ID]\n              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME] [--os-trust-id OS_TRUST_ID] [--os-default-domain-id OS_DEFAULT_DOMAIN_ID]\n              [--os-default-domain-name OS_DEFAULT_DOMAIN_NAME] [--os-user-id OS_USER_ID] [--os-username OS_USERNAME] [--os-user-domain-id OS_USER_DOMAIN_ID]\n              [--os-user-domain-name OS_USER_DOMAIN_NAME] [--os-password OS_PASSWORD]\n              &lt;subcommand&gt; ...\n<\/code><\/pre>\n\n\n\n<p>Once the creation is done, you can list available images;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openstack image list<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>+--------------------------------------+--------------------------+--------+\n| ID                                   | Name                     | Status |\n+--------------------------------------+--------------------------+--------+\n| 5cad7ba3-851b-4b87-a762-8506cf803965 | cirros-0.5.2-x86_64-disk | active |\n| ba33ea97-710d-4c14-9283-18f27de74e56 | jellyfish                | active |\n+--------------------------------------+--------------------------+--------+\n<\/code><\/pre>\n\n\n\n<p>And that is it.<\/p>\n\n\n\n<p>You should now be able to use the custom image to launch an instance.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1344\" height=\"1268\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/test-OpenStack-Dashboard-running-instance.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14457\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/test-OpenStack-Dashboard-running-instance.png?v=1665525056 1344w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/test-OpenStack-Dashboard-running-instance-768x725.png?v=1665525056 768w\" sizes=\"(max-width: 1344px) 100vw, 1344px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1663\" height=\"936\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-vm-console.png\" alt=\"Create and Upload Custom Linux Image into OpenStack\" class=\"wp-image-14458\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-vm-console.png?v=1665525093 1663w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-vm-console-768x432.png?v=1665525093 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/10\/openstack-vm-console-1536x865.png?v=1665525093 1536w\" sizes=\"(max-width: 1663px) 100vw, 1663px\" \/><\/figure><\/div>\n\n\n<p>Note, the flavor assigned to the instance must be slightly bigger than the virtual size of the image.<\/p>\n\n\n\n<p>If you want to delete the image, just do it from the horizon or simply use the command line;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openstack image delete &lt;ID&gt;<\/code><\/pre>\n\n\n\n<p>That marks the end of our tutorial on creating and uploading custom Linux image into OpenStack.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/deploy-openstack-using-devstack-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Deploy OpenStack using DevStack on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-create-and-delete-openstack-project\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Create And Delete OpenStack Project<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to create and upload custom Linux image into OpenStack. An image is a single file that contains a<\/p>\n","protected":false},"author":1,"featured_media":14460,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[36,1885,121,1886],"tags":[5945,5941,5946,5944,5943,5942,5947],"class_list":["post-14432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtualization","category-cloud-compute","category-howtos","category-openstack","tag-create-and-upload-custom-linux-image-into-openstack","tag-create-custom-openstack-image","tag-custom-linux-image-openstack","tag-glance-image-create","tag-openstack-image-create","tag-upload-custom-openstack-image","tag-upload-ubuntu-22-04-image-into-openstack","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14432"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=14432"}],"version-history":[{"count":21,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14432\/revisions"}],"predecessor-version":[{"id":22917,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14432\/revisions\/22917"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/14460"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=14432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=14432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=14432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}