OpenStack 為終端用戶提供了 Web UI(Horizon)和命令行 CLI 兩種交換界面。兩種方式我們都要會用。可能有些同學覺得既然有更友好的 Web UI 了,干嘛還要用 CLI? 這里有下面的理由:
1、Web UI 的功能沒有 CLI 全,有些操作只提供了 CLI。 即便是都有的功能,CLI 可以使用的參數更多
2、一般來說,CLI 返回結果更快,操作起來更高效
4、CLI 可放在腳本中進行批處理
5、有些耗時的操作 CLI 更合適,比如創建鏡像(后面將涉及)
(1)Web UI 創建 image

(2)CLI 創建 image
將上傳的鏡像傳到控制節點

執行image上傳鏡像命令:
openstack image create "cirros" --file cirros-0.3.3-x86_64-disk.img.img --disk-format qcow2 --container-format bare --public

三、glance配置文件:
vim /etc/glance/glance-api.conf
[DEFAULT]
[cors]
[cors.subdomain]
[database]
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[image_format]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]
vim /etc/glance/glance-registry.conf
[DEFAULT]
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]