上文提到了利用命令列下使用openstack的命令來建立虛擬機器,這裡選擇安裝dashboard來安裝基於web介面的openstack平臺
利用dashboard介面來建立虛擬機器
dashboard這裡選擇安裝在控制端,詳細的dashboard配置檔案參考:https://github.com/jsonhc/openstack_project
1、安裝dashboard,安裝它有手動編譯安裝和yum自動安裝,這裡選擇使用yum進行安裝
# yum install openstack-dashboard
修改配置檔案:/etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "192.168.101.10" Allow your hosts to access the dashboard: ALLOWED_HOSTS = ['*‘] [‘*’] to accept all hosts,the host is validated Configure the memcached session storage service: SESSION_ENGINE = 'django.contrib.sessions.backends.cache' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '192.168.101.10:11211', } } 註釋掉其他的session配置 Enable the Identity API version 3: OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST Enable support for domains: OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True Configure API versions: OPENSTACK_API_VERSIONS = { "identity": 3, "image": 2, "volume": 2, } Configure Default as the default domain for users that you create via the dashboard: OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default" Configure user as the default role for users that you create via the dashboard: OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user" If you chose networking option 1, disable support for layer-3 networking services: OPENSTACK_NEUTRON_NETWORK = { 'enable_router': False, 'enable_quotas': False, 'enable_distributed_router': False, 'enable_ha_router': False, 'enable_lb': False, 'enable_firewall': False, 'enable_vpn': False, 'enable_fip_topology_check': False, } Optionally, configure the time zone: TIME_ZONE = "TIME_ZONE" 例如:Asia/Shanghai Restart the web server and session storage service: # systemctl restart httpd.service memcached.service
校驗dashboard:
Access the dashboard using a web browser at http://controller/dashboard.
當訪問dashboard的web頁面時,報錯500,日誌報錯如下:
在配置檔案:/etc/httpd/conf.d/openstack-dashboard.conf
新增:WSGIApplicationGroup %{GLOBAL},如下所示:
新增上面一行即可,重啟httpd服務:# systemctl restart httpd.service
再次觀察日誌:
沒有報錯出現,於是再次訪問:
預設域:default,賬戶密碼:admin:bootstrap/demo:demo也可以
至此dashboard安裝完成,可以在web介面進行安裝虛擬機器instance了