openstack Verified current stable Not installed? Cloud Infrastructure

Openstack / Create Or Upload Image

Create Or Upload Image

Creates or uploads an image to OpenStack from a specified file.

$
Terminal
openstack image create --file <path/to/file> --private <image_name>

When To Use

When initializing a new virtual machine and requiring a base image to boot from.

Pro Tip

The `--container-format` and `--disk-format` flags may not be documented; specify them correctly for proper image categorization to avoid corruption.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
openstack image create --file <path/to/file> --private <image_name>

Anatomy of Output

Understanding the result

+---------------+------------------------------------+ Table Header

Start of summary for newly created image.

| ID | 654def321 | Image ID

Unique identifier assigned to the image.

| Name | My Image | Image Name

Designated name for easier identification.

| Visibility | private | Visibility Status

Access privileges assigned to the image.

+---------------+------------------------------------+ Table End

End of image creation summary.

Troubleshooting

Common pitfalls

Image upload failed: empty file

Solution: Ensure the specified file path is correct and the file is not empty.

Disk format not recognized

Solution: Check the specified format against the supported list: raw, qcow2, vmdk.

Insufficient quota for images

Solution: Review available resource quotas in your OpenStack project.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.
<path/to/file>
Input Files
The file path or paths supplied to this command.
--private
private| shared| all
The value supplied for private| shared| all.
<image_name>
image name
The value supplied for image name.
--file
Command Option
Tool-specific option used by this command invocation.
--private
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.