Openstack Nova 添加计算节点(六.一)

Openstack Nova 添加计算节点(六.一)

# 重要的两点:
1 时间同步
2 yum 源

# 安装软件:
yum install openstack-selinux openstack-nova-compute  python-openstackclient -y

# copy 配置: 
scp -r 10.10.5.135:/etc/nova/* ./

# 添加解析:
vim /etc/hosts
10.10.5.140 openstack-linux36-vip.magedu.net 

# 修改配置:
[root@node-1 yum.repos.d]#  grep -vE "^$|^#" /etc/nova/nova.conf 
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@openstack-linux36-vip.magedu.net
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
[barbican]
[cache]
[cells]
[cinder]
[cloudpipe]
[conductor]
[console]
[consoleauth]
[cors]
[cors.subdomain]
[crypto]
[database]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://openstack-linux36-vip.magedu.net:9292
[guestfs]
[healthcheck]
[hyperv]
[image_file_url]
[ironic]
[key_manager]
[keystone_authtoken]
auth_uri = http://openstack-linux36-vip.magedu.net:5000
auth_url = http://openstack-linux36-vip.magedu.net:35357
memcached_servers = openstack-linux36-vip.magedu.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = 123456
[libvirt]
virt_type=qemu
[matchmaker_redis]
[metrics]
[mks]
[neutron]
url = http://openstack-linux36-vip.magedu.net:9696
auth_url = http://openstack-linux36-vip.magedu.net:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://openstack-linux36-vip.magedu.net:35357/v3
username = placement
password = 123456
[placement_database]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[ssl]
[trusted_computing]
[upgrade_levels]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 10.10.5.135
novncproxy_base_url = http://openstack-linux36-vip.magedu.net:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]

#############################################################################################################################

# 设置发现新主机的时长:
[scheduler]
discover_hosts_in_cells_interval = 300

# 添加开机启动项目:
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service

# 操作管理主机测试一下是否已添加(cont-1):
[root@cont-1 nova]# openstack host  list
+-----------+-------------+----------+
| Host Name | Service     | Zone     |
+-----------+-------------+----------+
| cont-1    | scheduler   | internal |
| cont-1    | conductor   | internal |
| cont-1    | consoleauth | internal |
| node-1    | compute     | nova     |
| node-2    | compute     | nova     |
+-----------+-------------+----------+
[root@cont-1 nova]# nova service-list
/usr/lib/python2.7/site-packages/novaclient/client.py:278: UserWarning: The 'tenant_id' argument is deprecated in Ocata and its use may result in errors in future releases. As 'project_id' is provided, the 'tenant_id' argument will be ignored.
  warnings.warn(msg)
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host   | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-scheduler   | cont-1 | internal | enabled | up    | 2020-05-26T07:13:28.000000 | -               |
| 2  | nova-conductor   | cont-1 | internal | enabled | up    | 2020-05-26T07:13:26.000000 | -               |
| 4  | nova-consoleauth | cont-1 | internal | enabled | up    | 2020-05-26T07:13:29.000000 | -               |
| 7  | nova-compute     | node-1 | nova     | enabled | up    | 2020-05-26T07:13:31.000000 | -               |
| 8  | nova-compute     | node-2 | nova     | enabled | up    | 2020-05-26T07:13:23.000000 | -               |
+----+------------------+--------+----------+---------+-------+----------------------------+-----------------+
[root@cont-1 nova]# openstack image list
+--------------------------------------+--------------+--------+
| ID                                   | Name         | Status |
+--------------------------------------+--------------+--------+
| 1511da48-c7d3-4237-85fb-015a69d2134b | cirros-0.3.5 | active |
+--------------------------------------+--------------+--------+

[root@cont-1 nova]# openstack hypervisor list
+----+---------------------+-----------------+-----------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP   | State |
+----+---------------------+-----------------+-----------+-------+
|  1 | node-1              | QEMU            | 127.0.0.1 | up    |
|  2 | node-2              | QEMU            | 127.0.0.1 | up    |
+----+---------------------+-----------------+-----------+-------+



原文地址:https://www.cnblogs.com/zhenxing06/p/13025350.html