This section shows how to create an Image from the Web GUI and CLI two methods.
OpenStack provides end users with a Web UI (Horizon) and a command-line CLI two switching interfaces.
We both have to use it in two ways.
Maybe some students think that since there is a more friendly Web UI, why use the CLI? Here Cloudman gives the following reasons:
The functionality of the Web UI does not have a full CLI, and some operations only provide the CLI. Even though all features are available, the CLI can use more parameters
In general, the CLI returns results faster and operates more efficiently.
CLI can be placed in a script for batch processing
Some time-consuming operation of the CLI is more appropriate, such as creating a mirror (which will be covered later)
Web UI creation Image
After admin login, Project--Compute-Images
Click the top right button to name the new image.
Here we upload an image. Click to select the image file Cirros-0.3.4-x86_64-disk.img. Cirros is a very small Linux image and is ideal for testing purposes. Everyone can download to http://download.cirros-cloud.net/.
Format Selection QCOW2.
If checked, the image can be used by other Project if checked, the image is not allowed to be deleted.
Click, upload the file to OpenStack and create a new image
Click the image link to display more information
CLI Create Image
Cirros This Linux image is very small and uploads quickly through the Web UI, and the operation will be smooth. But if we want to upload a larger image (such as several G), then the operation of the long time to stay in the uploaded Web interface, we do not know what is currently in the state. For such operations, the CLI is a better choice.
-
upload the image to the file system of the control node, for example/tmp/ Cirros-0.3.4-x86_64-disk.img
-
devstack installation directory. Source This file allows you to configure environment variables for the CLI. Here we pass two parameters, the first parameter is OpenStack username admin, the second parameter is Project name admin
-
Execute image creation command
Glance image-create--name cirros--file/tmp/cirros-0.3.4-x86_64-disk.img--disk-format qcow2--container-format Bare- -progress
Is it more intuitive than the Web UI that we use--progress to show the percent% of file uploads in the CLI parameter that created the image?
View the new Image under/opt/stack/data/glance/images/
In the next section we show you how to delete an image.
Create Image-5 minutes a day to play with OpenStack (21)