安裝數據庫,登錄數據庫創建 nova,nova_api,nova_cell0 數據庫
[ root@controller etcd
] # mysql
- uroot
- pmaster
Welcome to the MariaDB monitor
. Commands end with
; or \g
.
Your MariaDB connection id is
68
Server version
: 10.3 .20 - MariaDB MariaDB Server
Copyright ( c
) 2000 , 2018 , Oracle
, MariaDB Corporation Ab and others
. Type
'help;' or
'\h' for help
. Type
'\c' to clear the current input statement
. MariaDB
[ ( none
) ] > CREATE DATABASE nova_api
default character set utf8
;
Query OK
, 1 row
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > CREATE DATABASE nova
default character set utf8
;
Query OK
, 1 row
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > CREATE DATABASE nova_cell0
default character set utf8
;
Query OK
, 1 row
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova_api
. * TO
'nova' @
'localhost' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.006 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova_api
. * TO
'nova' @
'%' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova
. * TO
'nova' @
'localhost' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova
. * TO
'nova' @
'%' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.001 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova_cell0
. * TO
'nova' @
'localhost' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.000 sec
) MariaDB
[ ( none
) ] > GRANT ALL PRIVILEGES ON nova_cell0
. * TO
'nova' @
'%' IDENTIFIED BY
'openstack' ;
Query OK
, 0 rows
affected ( 0.000 sec
) MariaDB
[ ( none
) ] >
創建用戶和 API 服務端點 將 nova 加入到 service 項目以及 admin 角色
# source / etc/ keystone/ admin- openrc. sh
# openstack user create -- domain default -- password- prompt nova
密碼
: openstack2022
[ root@controller neutron
] # clear
[ root@controller neutron
] # openstack user create
-- domain
default -- password
- prompt nova
User Password
:
Repeat User Password
:
The passwords entered were not the same
User Password
: openstack2022
Repeat User Password
: openstack2022
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| Field
| Value
|
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| domain_id
| default |
| enabled
| True
|
| id
| 3e91f 4742 a0347db908629f5ca05728f
|
| name
| nova
|
| options
| { } |
| password_expires_at
| None
|
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
#將 nova 加入到 service 項目以及 admin 角色
[ root@controller neutron
] # openstack role add
-- project service
-- user nova admin
#創建 nova 服務實體
# openstack service create -- name nova -- description "OpenStack Compute" compute
[ root@controller neutron
] # openstack service create
-- name nova
-- description
"OpenStack Compute" compute
+ -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| Field
| Value
|
+ -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| description
| OpenStack Compute
|
| enabled
| True
|
| id
| 624 c9ae0addb4251ac52caa167978d1e
|
| name
| nova
|
| type
| compute
|
+ -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
創建 nova API 服務端點。
# openstack endpoint create -- region RegionOne compute public http: # openstack endpoint create -- region RegionOne compute internal http:
# openstack endpoint create -- region RegionOne compute admin http: [ root@controller neutron
] # openstack endpoint create
-- region RegionOne compute public http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| Field
| Value
|
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| enabled
| True
|
| id
| 87992f 70f c1949dbba2e9d1dda285163
|
| interface
| public
|
| region
| RegionOne
|
| region_id
| RegionOne
|
| service_id
| 624 c9ae0addb4251ac52caa167978d1e
|
| service_name
| nova
|
| service_type
| compute
|
| url
| http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
[ root@controller neutron
] # openstack endpoint create
-- region RegionOne compute internal http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| Field
| Value
|
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| enabled
| True
|
| id
| f3bc3cda06aa425b949eeee9542b09ad
|
| interface
| internal
|
| region
| RegionOne
|
| region_id
| RegionOne
|
| service_id
| 624 c9ae0addb4251ac52caa167978d1e
|
| service_name
| nova
|
| service_type
| compute
|
| url
| http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
[ root@controller neutron
] # openstack endpoint create
-- region RegionOne compute admin http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| Field
| Value
|
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| enabled
| True
|
| id
| 52 dcfd3faba2440390ff718f995a955f
|
| interface
| admin
|
| region
| RegionOne
|
| region_id
| RegionOne
|
| service_id
| 624 c9ae0addb4251ac52caa167978d1e
|
| service_name
| nova
|
| service_type
| compute
|
| url
| http
:
+ -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
[ root@controller neutron
] # openstack endpoint list
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- - + -- -- -- -- -- -- -- + -- -- -- -- -- -- -- + -- -- -- -- - + -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- - +
| ID
| Region
| Service Name
| Service Type
| Enabled
| Interface
| URL
|
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- - + -- -- -- -- -- -- -- + -- -- -- -- -- -- -- + -- -- -- -- - + -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- - +
| 13 c973c72cf948ababcc42ddb1cf119e
| RegionOne
| neutron
| network
| True
| public
| http
:
| 1e6 cc1d447794d23acb27b31ee623e03
| RegionOne
| keystone
| identity
| True
| public
| http
:
| 352 a0664398a43ab925a0258323ea028
| RegionOne
| keystone
| identity
| True
| internal
| http
:
| 45060 eb98d464fafa583b9059a790b7b
| RegionOne
| glance
| image
| True
| public
| http
:
| 4 ed1c70cc14b4bcfb9afe3037fd20345
| RegionOne
| neutron
| network
| True
| internal
| http
:
| 52 dcfd3faba2440390ff718f995a955f
| RegionOne
| nova
| compute
| True
| admin
| http
:
| 7 ad9669702454249bbc8451214d7088d
| RegionOne
| placement
| placement
| True
| public
| http
:
| 87992f 70f c1949dbba2e9d1dda285163
| RegionOne
| nova
| compute
| True
| public
| http
:
| 894 ebf45d0f34d209b42cb6aedb59e16
| RegionOne
| placement
| placement
| True
| admin
| http
:
| bc1c904203da41a0a4065d323c4efcdd
| RegionOne
| glance
| image
| True
| admin
| http
:
| bf94b27ee6a949b08427d78f6f341ad6
| RegionOne
| neutron
| network
| True
| admin
| http
:
| c1c689d076f04a268a8a70a34e055497
| RegionOne
| placement
| placement
| True
| internal
| http
:
| cf8962f9a9b64086af9f31b6d730ed86
| RegionOne
| keystone
| identity
| True
| admin
| http
:
| d00353e12a3d49f89448e6c39b8bc442
| RegionOne
| glance
| image
| True
| internal
| http
:
| f3bc3cda06aa425b949eeee9542b09ad
| RegionOne
| nova
| compute
| True
| internal
| http
:
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- - + -- -- -- -- -- -- -- + -- -- -- -- -- -- -- + -- -- -- -- - + -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- - +
[ root@controller neutron
] # #使用命令查看
# openstack endpoint list
安裝配置 Nova 安裝組件
# yum - y install openstack- nova- api openstack- nova- conductor openstack- nova- novncproxy openstack- nova- scheduler
centos
- openstack
- train
| 2.9 kB
00 : 00 : 00
centos
- qemu
- ev
| 2.9 kB
00 : 00 : 00
ceph
| 2.9 kB
00 : 00 : 00
ceph
- noarch
| 2.9 kB
00 : 00 : 00
docker
- ce
- stable
| 2.9 kB
00 : 00 : 00
epel
| 2.9 kB
00 : 00 : 00
extras
| 2.9 kB
00 : 00 : 00
Not
using downloaded extras
/ repomd
. xml because it is older than what we have
: Current
: Wed Nov
23 15 : 27 : 27 2022 Downloaded
: Wed Oct
5 01 : 24 : 54 2022
openresty
| 2.9 kB
00 : 00 : 00
updates
| 2.9 kB
00 : 00 : 00
Not
using downloaded updates
/ repomd
. xml because it is older than what we have
: Current
: Wed Nov
23 15 : 26 : 42 2022 Downloaded
: Sat Nov
12 01 : 10 : 48 2022
Package
1 : openstack
- nova
- api
- 20.6 . 0 - 1. el7
. noarch already installed
and latest version
Package
1 : openstack
- nova
- conductor
- 20.6 . 0 - 1. el7
. noarch already installed
and latest version
Package
1 : openstack
- nova
- novncproxy
- 20.6 . 0 - 1. el7
. noarch already installed
and latest version
Package
1 : openstack
- nova
- scheduler
- 20.6 . 0 - 1. el7
. noarch already installed
and latest version
Nothing to
do
[ root@controller neutron
] # vi
/ etc
/ nova
/ nova
. conf
[ root@controller neutron
] # vi
/ etc
/ neutron
/ metadata_agent
. ini
[ root@controller neutron
] # cat
/ etc
/ nova
/ nova
. conf
[ DEFAULT
]
enabled_apis
= osapi_compute
, metadata
transport_url
= rabbit
:
my_ip
= 192.168 . 182.30
use_neutron
= true
firewall_driver
= nova
. virt
. firewall
. NoopFirewallDriver
allow_resize_to_same_host
= true [ api
]
auth_strategy
= keystone
token_cache_time
= 3600 [ api_database
]
connection
= mysql
+ pymysql
: [ barbican
]
[ cache
]
[ cinder
]
[ compute
]
[ conductor
]
[ console
]
[ consoleauth
]
[ cors
] [ database
]
connection
= mysql
+ pymysql
: [ devices
]
[ ephemeral_storage_encryption
]
[ filter_scheduler
] [ glance
]
api_servers
= http
: [ guestfs
]
[ healthcheck
]
[ hyperv
]
[ ironic
]
[ key_manager
]
[ keystone
] [ keystone_authtoken
]
auth_url
= http
:
memcached_servers
= controller
: 11211
auth_type
= password
project_domain_name
= Default
user_domain_name
= Default
project_name
= service
username
= nova
password
= openstack2022
token_cache_time
= 3600 [ libvirt
]
[ metrics
]
[ mks
]
[ neutron
]
url
= http
:
auth_url
= http
:
auth_type
= password
project_domain_name
= default
user_domain_name
= default
region_name
= RegionOne
project_name
= service
username
= neutron
password
= openstack2022
service_metadata_proxy
= true
metadata_proxy_shared_secret
= openstack2022
[ notifications
]
[ osapi_v21
] [ oslo_concurrency
]
lock_path
= / var
/ lib
/ nova
/ tmp
[ oslo_messaging_amqp
]
[ oslo_messaging_kafka
]
[ oslo_messaging_notifications
]
[ oslo_messaging_rabbit
]
[ oslo_middleware
]
[ oslo_policy
]
[ pci
] [ placement
]
region_name
= RegionOne
project_domain_name
= Default
project_name
= service
auth_type
= password
user_domain_name
= Default
auth_url
= http
:
username
= placement
password
= openstack2022
[ powervm
]
[ privsep
]
[ profiler
]
[ quota
]
[ rdp
]
[ remote_debug
] [ scheduler
]
discover_hosts_in_cells_interval
= 180 [ serial_console
]
[ service_user
]
[ spice
]
[ upgrade_levels
]
[ vault
]
[ vendordata_dynamic_auth
]
[ vmware
] [ vnc
]
enabled
= true
server_listen
= $my_ip
server_proxyclient_address
= $my_ip
novncproxy_host
= 0.0 . 0.0
novncproxy_port
= 6080
novncproxy_base_url
= http
: [ workarounds
]
[ wsgi
]
[ xenserver
]
[ xvp
]
[ zvm
]
[ root@controller neutron
] # cat
/ etc
/ neutron
/ metadata_agent
. ini
[ DEFAULT
]
nova_metadata_host
= controller
metadata_proxy_shared_secret
= openstack2022
[ cache
]
同步 nova 數據庫并驗證
[ root@controller neutron
] # su
- s
/ bin
/ sh
- c
"nova-manage api_db sync" nova
[ root@controller neutron
] # su
- s
/ bin
/ sh
- c
"nova-manage cell_v2 map_cell0" nova
[ root@controller neutron
] # su
- s
/ bin
/ sh
- c
"nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
536f 18c4
- ae1e
- 4801 - 8105 - a82bf6b59877
#驗證 cell0 和 cell1 是否正確注冊
[ root@controller neutron
] # su
- s
/ bin
/ sh
- c
"nova-manage db sync" nova
/ usr
/ lib
/ python2
. 7 / site
- packages
/ pymysql
/ cursors
. py
: 170 : Warning
: ( 1831 , u
' Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`
. This is deprecated
and will be disallowed in a future release
' ) result
= self
. _query ( query
)
/ usr
/ lib
/ python2
. 7 / site
- packages
/ pymysql
/ cursors
. py
: 170 : Warning
: ( 1831 , u
' Duplicate index `uniq_instances0uuid`
. This is deprecated
and will be disallowed in a future release
' ) result
= self
. _query ( query
) - s
/ bin
/ sh
- c
"nova-manage cell_v2 list_cells" nova
+ -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- +
| Name
| UUID
| Transport URL
| Database Connection
| Disabled
|
+ -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- +
| cell0
| 00000000 - 0000 - 0000 - 0000 - 000000000000 | none
: / | mysql
+ pymysql
:
| cell1
| 536f 18c4
- ae1e
- 4801 - 8105 - a82bf6b59877
| rabbit
:
+ -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- + #啟動 nova 服務并設置為開機自啟動
[ root@controller neutron
] # systemctl enable openstack
- nova
- api
. service openstack
- nova
- scheduler
. service openstack
- nova
- conductor
. service openstack
- nova
- novncproxy
. service
Created symlink from
/ etc
/ systemd
/ system
/ multi
- user
. target
. wants
/ openstack
- nova
- api
. service to
/ usr
/ lib
/ systemd
/ system
/ openstack
- nova
- api
. service
.
Created symlink from
/ etc
/ systemd
/ system
/ multi
- user
. target
. wants
/ openstack
- nova
- scheduler
. service to
/ usr
/ lib
/ systemd
/ system
/ openstack
- nova
- scheduler
. service
.
Created symlink from
/ etc
/ systemd
/ system
/ multi
- user
. target
. wants
/ openstack
- nova
- conductor
. service to
/ usr
/ lib
/ systemd
/ system
/ openstack
- nova
- conductor
. service
.
Created symlink from
/ etc
/ systemd
/ system
/ multi
- user
. target
. wants
/ openstack
- nova
- novncproxy
. service to
/ usr
/ lib
/ systemd
/ system
/ openstack
- nova
- novncproxy
. service
.
[ root@controller neutron
] # systemctl restart openstack
- nova
- api
. service openstack
- nova
- scheduler
. service openstack
- nova
- conductor
. service openstack
- nova
- novncproxy
. service
[ root@controller neutron
] # systemctl status openstack
- nova
- api
. service openstack
- nova
- scheduler
. service openstack
- nova
- conductor
. service openstack
- nova
- novncproxy
. service
● openstack
- nova
- api
. service
- OpenStack Nova API ServerLoaded
: loaded ( / usr
/ lib
/ systemd
/ system
/ openstack
- nova
- api
. service
; enabled
; vendor preset
: disabled
) Active
: active ( running
) since Thu
2022 - 11 - 24 18 : 57 : 33 CST
; 39 s agoMain PID
: 76117 ( nova
- api
) Tasks
: 9 CGroup
: / system
. slice
/ openstack
- nova
- api
. service├─
76117 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76182 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76183 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76187 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76189 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76199 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76202 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api├─
76203 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- api└─
76204 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- apiNov
24 18 : 57 : 24 controller systemd
[ 1 ] : Starting OpenStack Nova API Server
. . .
Nov
24 18 : 57 : 29 controller nova
- api
[ 76117 ] : / usr
/ lib
/ python2
. 7 / site
- packages
/ paste
/ deploy
/ loadwsgi
. py
: 22 : PkgResourcesDeprecationW
. . . rately
.
Nov
24 18 : 57 : 29 controller nova
- api
[ 76117 ] : return pkg_resources
. EntryPoint
. parse ( "x=" + s
) . load ( False
)
Nov
24 18 : 57 : 33 controller systemd
[ 1 ] : Started OpenStack Nova API Server
. ● openstack
- nova
- scheduler
. service
- OpenStack Nova Scheduler ServerLoaded
: loaded ( / usr
/ lib
/ systemd
/ system
/ openstack
- nova
- scheduler
. service
; enabled
; vendor preset
: disabled
) Active
: active ( running
) since Thu
2022 - 11 - 24 18 : 57 : 41 CST
; 31 s agoMain PID
: 76121 ( nova
- scheduler
) Tasks
: 5 CGroup
: / system
. slice
/ openstack
- nova
- scheduler
. service├─
76121 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- scheduler├─
76256 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- scheduler├─
76257 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- scheduler├─
76258 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- scheduler└─
76259 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- schedulerNov
24 18 : 57 : 24 controller systemd
[ 1 ] : Starting OpenStack Nova Scheduler Server
. . .
Nov
24 18 : 57 : 41 controller systemd
[ 1 ] : Started OpenStack Nova Scheduler Server
. ● openstack
- nova
- conductor
. service
- OpenStack Nova Conductor ServerLoaded
: loaded ( / usr
/ lib
/ systemd
/ system
/ openstack
- nova
- conductor
. service
; enabled
; vendor preset
: disabled
) Active
: active ( running
) since Thu
2022 - 11 - 24 18 : 57 : 31 CST
; 42 s agoMain PID
: 76122 ( nova
- conductor
) Tasks
: 5 CGroup
: / system
. slice
/ openstack
- nova
- conductor
. service├─
76122 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- conductor├─
76162 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- conductor├─
76163 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- conductor├─
76164 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- conductor└─
76165 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- conductorNov
24 18 : 57 : 24 controller systemd
[ 1 ] : Starting OpenStack Nova Conductor Server
. . .
Nov
24 18 : 57 : 31 controller systemd
[ 1 ] : Started OpenStack Nova Conductor Server
. ● openstack
- nova
- novncproxy
. service
- OpenStack Nova NoVNC Proxy ServerLoaded
: loaded ( / usr
/ lib
/ systemd
/ system
/ openstack
- nova
- novncproxy
. service
; enabled
; vendor preset
: disabled
) Active
: active ( running
) since Thu
2022 - 11 - 24 18 : 57 : 24 CST
; 49 s agoMain PID
: 76123 ( nova
- novncproxy
) Tasks
: 1 CGroup
: / system
. slice
/ openstack
- nova
- novncproxy
. service└─
76123 / usr
/ bin
/ python2
/ usr
/ bin
/ nova
- novncproxy
-- web
/ usr
/ share
/ novnc
/ Nov
24 18 : 57 : 24 controller systemd
[ 1 ] : Started OpenStack Nova NoVNC Proxy Server
.
Hint
: Some lines were ellipsized
, use
- l to show in full
.
[ root@controller neutron
] #
總結
以上是生活随笔 為你收集整理的openstack 安装并验证 Nova( 计算节点 + 控制节点) 的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔 網站內容還不錯,歡迎將生活随笔 推薦給好友。