##5.2 Nova计算节点
openstack pike 安装 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html
##5.2 Nova计算节点
# compute 安装
#5.2.Nova-compute.sh #基本配置:
#关闭selinux、防火墙
#更换阿里源、升级、重启、时间同步
#hostname设置
#安装OpenStack库 #安装配置Nova
yum install -y openstack-nova-compute
yum install -y python-openstackclient openstack-selinux #设置Nova实例路径(磁盘镜像文件)
Vdir=/XLH_Data/nova
VHD=$Vdir/instances
mkdir -p $VHD
chown -R nova:nova $Vdir #使用QEMU或KVM ,KVM硬件加速需要硬件支持
[[ `egrep -c '(vmx|svm)' /proc/cpuinfo` = ]] && { Kvm=qemu; } || { Kvm=kvm; }
echo "使用 $Kvm" VncProxy=172.16.11.50 #VNC代理外网IP地址 # #nova配置
/usr/bin/cp /etc/nova/nova.conf{,.$(date +%s).bak}
#egrep -v '^$|#' /etc/nova/nova.conf
echo '#
[DEFAULT]
instances_path='$VHD'
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack@controller
my_ip = 10.2.1.21
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver [api_database]
connection = mysql+pymysql://nova:nova@controller/nova_api
[database]
connection = mysql+pymysql://nova:nova@controller/nova [api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova [vnc]
enabled = true
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://'$VncProxy':6080/vnc_auto.html
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp [placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = placement [libvirt]
virt_type = '$Kvm'
#'>/etc/nova/nova.conf
#sed -i 's#controller:6080#10.2.10.20:6080#' /etc/nova/nova.conf #启动
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service #-----------------------------------------