NOVA计算服务
1 API负责接收和相应外部请求
2 Cert身份认证
3 scheduler 云主机调度(决策虚拟机创建到那个节点上的)
4 conductor 计算节点访问数据的中间价
5 consoleauth 控制台授权
6 novncproxy VNC代理

安装nova命令
yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler

配置nova
vim /etc/nova/nova.conf
[default]

auth_strategy=keystone
enabled_apis = osapi_compute,metadata
my_ip=192.168.56.11
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
transport_url = rabbit://openstack:[email protected]
[vnc]
vncserver_listen=$my_ip
vncserver_proxyclient_address=$my_ip
[glance]
api_servers = http://192.168.56.11:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[database]
connection = mysql+pymysql://nova:[email protected]/nova

[api_database]
connection = mysql+pymysql://nova:[email protected]/nova_api
!!!!!!!!!!!!!!!有报错
[oslo_messaging_rabbit]
rabbit_host=192.168.56.11
rabbit_port=5672
rabbit_userid=openstack
rabbit_password=openstack
!!!!!!!!!!!!!!!有报错
[keystone_authtoken]
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

同步数据库
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova

创建nova用户
source /etc/keystone/admin-openrc
openstack user create --domain default --password=nova nova
openstack role add --project service --user nova admin
创建服务
openstack service create --name nova \
--description "OpenStack Compute" compute
创建endpoints
openstack endpoint create --region RegionOne \
compute public http://192.168.56.11:8774/v2.1/%\(tenant_id\)s

openstack endpoint create --region RegionOne \
compute internal http://192.168.56.11:8774/v2.1/%\(tenant_id\)s

openstack endpoint create --region RegionOne \
compute admin http://192.168.56.11:8774/v2.1/%\(tenant_id\)s

开机启动服务
systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
启动
systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service

查看是否成功
openstack host list

============================================================
nova计算节点
通过消息队列接收并管理VM生命周期
nova-computer通过libvirt管理KVM,通过Xenapi管理Xen
192.168.56.12
vi /etc/sysconfig/selinux
SELINUX=disabled
setenforce 0
[root@linux-node2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.11 linux-node1 linux-node1.oldboyedu.com
192.168.56.12 linux-node2 linux-node2.oldboyedu.com
安装命令
yum install centos-release-openstack-newton
yum install openstack-nova-compute
在192.168.56.11
scp /etc/nova/nova.conf 192.168.56.12:/etc/nova/
在192.168.56.12
vim /etc/nova/nova.conf
my_ip=192.168.56.12
[vnc]
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.56.12
novncproxy_base_url=http://192.168.56.11:6080/vnc_auto.html
enabled=true
[libvirt]
virt_type = qemu (有时候必须要写qemu)

#当grep -E '(vmx|svm)' /proc/cpuinfo 有内容的时候用KVM,没有用qemu
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service

配置时间同步
yum install chrony -y
vim /etc/chrony.conf 清空后只要下面一行
server 192.168.56.11 iburst
设置时区
timedatectl set-timezone Asia/Shanghai
启动时间务
systemctl enable chronyd.service
systemctl start chronyd.service

在192.168.56.11用命令查看
openstack compute service list
openstack host list
nova endpoints